2.12.7 Problem 44

2.12.7.1 Maple
2.12.7.2 Mathematica
2.12.7.3 Sympy

Internal problem ID [13406]
Book : Handbook of exact solutions for ordinary differential equations. By Polyanin and Zaitsev. Second edition
Section : Chapter 1, section 1.2. Riccati Equation. subsection 1.2.6-4. Equations with cotangent.
Problem number : 44
Date solved : Friday, December 19, 2025 at 03:56:27 AM
CAS classification : [[_1st_order, `_with_symmetry_[F(x),G(x)]`], _Riccati]

\begin{align*} y^{\prime }&=a \cot \left (\lambda x +\mu \right )^{k} \left (y-b \,x^{n}-c \right )^{2}+b n \,x^{n -1} \\ \end{align*}
Entering first order ode riccati solver
\begin{align*} y^{\prime }&=a \cot \left (\lambda x +\mu \right )^{k} \left (y-b \,x^{n}-c \right )^{2}+b n \,x^{n -1} \\ \end{align*}
In canonical form the ODE is
\begin{align*} y' &= F(x,y)\\ &= \cot \left (\lambda x +\mu \right )^{k} x^{2 n} a \,b^{2}+2 \cot \left (\lambda x +\mu \right )^{k} x^{n} a b c -2 \cot \left (\lambda x +\mu \right )^{k} x^{n} a b y +\cot \left (\lambda x +\mu \right )^{k} a \,c^{2}-2 \cot \left (\lambda x +\mu \right )^{k} a c y +\cot \left (\lambda x +\mu \right )^{k} a \,y^{2}+b n \,x^{n -1} \end{align*}

This is a Riccati ODE. Comparing the ODE to solve

\[ y' = \left (-\frac {1}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}+\frac {\cot \left (\mu \right ) \cot \left (\lambda x \right )}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}\right )^{k} x^{2 n} a \,b^{2}+2 \left (-\frac {1}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}+\frac {\cot \left (\mu \right ) \cot \left (\lambda x \right )}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}\right )^{k} x^{n} a b c -2 \left (-\frac {1}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}+\frac {\cot \left (\mu \right ) \cot \left (\lambda x \right )}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}\right )^{k} x^{n} a b y +\left (-\frac {1}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}+\frac {\cot \left (\mu \right ) \cot \left (\lambda x \right )}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}\right )^{k} a \,c^{2}-2 \left (-\frac {1}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}+\frac {\cot \left (\mu \right ) \cot \left (\lambda x \right )}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}\right )^{k} a c y +\left (-\frac {1}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}+\frac {\cot \left (\mu \right ) \cot \left (\lambda x \right )}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}\right )^{k} a \,y^{2}+\frac {b \,x^{n} n}{x} \]
With Riccati ODE standard form
\[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]
Shows that \(f_0(x)=\cot \left (\lambda x +\mu \right )^{k} x^{2 n} a \,b^{2}+2 \cot \left (\lambda x +\mu \right )^{k} x^{n} a b c +\cot \left (\lambda x +\mu \right )^{k} a \,c^{2}+b n \,x^{n -1}\), \(f_1(x)=-2 \cot \left (\lambda x +\mu \right )^{k} x^{n} b a -2 \cot \left (\lambda x +\mu \right )^{k} c a\) and \(f_2(x)=\cot \left (\lambda x +\mu \right )^{k} a\). Let
\begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{\cot \left (\lambda x +\mu \right )^{k} a u} \tag {1} \end{align*}

Using the above substitution in the given ODE results (after some simplification) in a second order ODE to solve for \(u(x)\) which is

\begin{align*} f_2 u''(x) -\left ( f_2' + f_1 f_2 \right ) u'(x) + f_2^2 f_0 u(x) &= 0 \tag {2} \end{align*}

But

\begin{align*} f_2' &=\frac {\cot \left (\lambda x +\mu \right )^{k} k \lambda \left (-1-\cot \left (\lambda x +\mu \right )^{2}\right ) a}{\cot \left (\lambda x +\mu \right )}\\ f_1 f_2 &=\left (-2 \cot \left (\lambda x +\mu \right )^{k} x^{n} b a -2 \cot \left (\lambda x +\mu \right )^{k} c a \right ) \cot \left (\lambda x +\mu \right )^{k} a\\ f_2^2 f_0 &=\cot \left (\lambda x +\mu \right )^{2 k} a^{2} \left (\cot \left (\lambda x +\mu \right )^{k} x^{2 n} a \,b^{2}+2 \cot \left (\lambda x +\mu \right )^{k} x^{n} a b c +\cot \left (\lambda x +\mu \right )^{k} a \,c^{2}+b n \,x^{n -1}\right ) \end{align*}

Substituting the above terms back in equation (2) gives

\[ \cot \left (\lambda x +\mu \right )^{k} a u^{\prime \prime }\left (x \right )-\left (\frac {\cot \left (\lambda x +\mu \right )^{k} k \lambda \left (-1-\cot \left (\lambda x +\mu \right )^{2}\right ) a}{\cot \left (\lambda x +\mu \right )}+\left (-2 \cot \left (\lambda x +\mu \right )^{k} x^{n} b a -2 \cot \left (\lambda x +\mu \right )^{k} c a \right ) \cot \left (\lambda x +\mu \right )^{k} a \right ) u^{\prime }\left (x \right )+\cot \left (\lambda x +\mu \right )^{2 k} a^{2} \left (\cot \left (\lambda x +\mu \right )^{k} x^{2 n} a \,b^{2}+2 \cot \left (\lambda x +\mu \right )^{k} x^{n} a b c +\cot \left (\lambda x +\mu \right )^{k} a \,c^{2}+b n \,x^{n -1}\right ) u \left (x \right ) = 0 \]
Unable to solve. Will ask Maple to solve this ode now.

Unable to solve. Terminating.

2.12.7.1 Maple. Time used: 0.005 (sec). Leaf size: 41
ode:=diff(y(x),x) = a*cot(lambda*x+mu)^k*(y(x)-b*x^n-c)^2+b*n*x^(n-1); 
dsolve(ode,y(x), singsol=all);
 
\[ y = b \,x^{n}+c +\frac {1}{c_1 -a \int \left (\frac {-1+\cot \left (\mu \right ) \cot \left (\lambda x \right )}{\cot \left (\mu \right )+\cot \left (\lambda x \right )}\right )^{k}d x} \]

Maple trace

Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
trying Bernoulli 
trying separable 
trying inverse linear 
trying homogeneous types: 
trying Chini 
differential order: 1; looking for linear symmetries 
trying exact 
Looking for potential symmetries 
trying Riccati 
trying Riccati sub-methods: 
   <- Riccati particular case Kamke (d) successful
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=a \cot \left (\lambda x +\mu \right )^{k} \left (y \left (x \right )-b \,x^{13406}-c \right )^{2}+13406 b \,x^{13405} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d x}y \left (x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=a \cot \left (\lambda x +\mu \right )^{k} \left (y \left (x \right )-b \,x^{13406}-c \right )^{2}+13406 b \,x^{13405} \end {array} \]
2.12.7.2 Mathematica. Time used: 1.197 (sec). Leaf size: 74
ode=D[y[x],x]==a*Cot[\[Lambda]*x+mu]^k*(y[x]-b*x^n-c)^2+b*n*x^(n-1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{\frac {a \cot ^{k+1}(\mu +\lambda x) \operatorname {Hypergeometric2F1}\left (1,\frac {k+1}{2},\frac {k+3}{2},-\cot ^2(\mu +x \lambda )\right )}{(k+1) \lambda }+c_1}+b x^n+c\\ y(x)&\to b x^n+c \end{align*}
2.12.7.3 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
k = symbols("k") 
lambda_ = symbols("lambda_") 
mu = symbols("mu") 
n = symbols("n") 
y = Function("y") 
ode = Eq(-a*(-b*x**n - c + y(x))**2/tan(lambda_*x + mu)**k - b*n*x**(n - 1) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out