55.11.3 problem 29

Internal problem ID [13423]
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-3. Equations with tangent.
Problem number : 29
Date solved : Wednesday, October 01, 2025 at 11:39:42 AM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }&=a y^{2}+b \tan \left (x \right ) y+c \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 261
ode:=diff(y(x),x) = a*y(x)^2+b*tan(x)*y(x)+c; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-\sin \left (x \right ) \left (-\cos \left (x \right )^{2} \sqrt {4 a c +b^{2}}+\left (b -1\right ) \sin \left (x \right )^{2}-\cos \left (x \right )^{2}-b +1\right ) \operatorname {LegendreP}\left (\frac {\sqrt {4 a c +b^{2}}}{2}-\frac {1}{2}, -\frac {1}{2}+\frac {b}{2}, \sin \left (x \right )\right )-c_1 \sin \left (x \right ) \left (-\cos \left (x \right )^{2} \sqrt {4 a c +b^{2}}+\left (b -1\right ) \sin \left (x \right )^{2}-\cos \left (x \right )^{2}-b +1\right ) \operatorname {LegendreQ}\left (\frac {\sqrt {4 a c +b^{2}}}{2}-\frac {1}{2}, -\frac {1}{2}+\frac {b}{2}, \sin \left (x \right )\right )+\left (-\sqrt {4 a c +b^{2}}+b -2\right ) \left (\operatorname {LegendreQ}\left (\frac {\sqrt {4 a c +b^{2}}}{2}+\frac {1}{2}, -\frac {1}{2}+\frac {b}{2}, \sin \left (x \right )\right ) c_1 +\operatorname {LegendreP}\left (\frac {\sqrt {4 a c +b^{2}}}{2}+\frac {1}{2}, -\frac {1}{2}+\frac {b}{2}, \sin \left (x \right )\right )\right ) \cos \left (x \right )^{2}}{2 \cos \left (x \right ) \left (\sin \left (x \right )^{2}-1\right ) a \left (\operatorname {LegendreQ}\left (\frac {\sqrt {4 a c +b^{2}}}{2}-\frac {1}{2}, -\frac {1}{2}+\frac {b}{2}, \sin \left (x \right )\right ) c_1 +\operatorname {LegendreP}\left (\frac {\sqrt {4 a c +b^{2}}}{2}-\frac {1}{2}, -\frac {1}{2}+\frac {b}{2}, \sin \left (x \right )\right )\right )} \]
Mathematica. Time used: 0.763 (sec). Leaf size: 488
ode=D[y[x],x]==a*y[x]^2+b*Tan[x]*y[x]+c; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\sin (x) \left (\left (-b^3+3 b^2+b-3\right ) \operatorname {Hypergeometric2F1}\left (\frac {1}{4} \left (-b-\sqrt {b^2+4 a c}+2\right ),\frac {1}{4} \left (-b+\sqrt {b^2+4 a c}+2\right ),\frac {3-b}{2},\cos ^2(x)\right )+\cos (x) \left ((b+1) \cos (x) (a c+b-1) \operatorname {Hypergeometric2F1}\left (\frac {1}{4} \left (-b-\sqrt {b^2+4 a c}+6\right ),\frac {1}{4} \left (-b+\sqrt {b^2+4 a c}+6\right ),\frac {5-b}{2},\cos ^2(x)\right )+a i^{b+1} (b-3) c c_1 \cos ^b(x) \operatorname {Hypergeometric2F1}\left (\frac {1}{4} \left (b-\sqrt {b^2+4 a c}+4\right ),\frac {1}{4} \left (b+\sqrt {b^2+4 a c}+4\right ),\frac {b+3}{2},\cos ^2(x)\right )\right )\right )}{a (b-3) (b+1) \left (\cos (x) \operatorname {Hypergeometric2F1}\left (\frac {1}{4} \left (-b-\sqrt {b^2+4 a c}+2\right ),\frac {1}{4} \left (-b+\sqrt {b^2+4 a c}+2\right ),\frac {3-b}{2},\cos ^2(x)\right )-i i^b c_1 \cos ^b(x) \operatorname {Hypergeometric2F1}\left (\frac {1}{4} \left (b-\sqrt {b^2+4 a c}\right ),\frac {1}{4} \left (b+\sqrt {b^2+4 a c}\right ),\frac {b+1}{2},\cos ^2(x)\right )\right )}\\ y(x)&\to -\frac {c \sin (x) \cos (x) \operatorname {Hypergeometric2F1}\left (\frac {1}{4} \left (b-\sqrt {b^2+4 a c}+4\right ),\frac {1}{4} \left (b+\sqrt {b^2+4 a c}+4\right ),\frac {b+3}{2},\cos ^2(x)\right )}{(b+1) \operatorname {Hypergeometric2F1}\left (\frac {1}{4} \left (b-\sqrt {b^2+4 a c}\right ),\frac {1}{4} \left (b+\sqrt {b^2+4 a c}\right ),\frac {b+1}{2},\cos ^2(x)\right )} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
y = Function("y") 
ode = Eq(-a*y(x)**2 - b*y(x)*tan(x) - c + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -a*y(x)**2 - b*y(x)*tan(x) - c + Derivative(y(x), x) cannot be solved by the lie group method