61.11.4 problem 30

Internal problem ID [12125]
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 : 30
Date solved : Sunday, March 30, 2025 at 11:00:17 PM
CAS classification : [[_1st_order, `_with_symmetry_[F(x),G(x)]`], _Riccati]

\begin{align*} y^{\prime }&=a y^{2}+2 a b \tan \left (x \right ) y+b \left (a b -1\right ) \tan \left (x \right )^{2} \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 81
ode:=diff(y(x),x) = a*y(x)^2+2*a*b*tan(x)*y(x)+b*(a*b-1)*tan(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {2 a b c_1 -2 i a^{{3}/{2}} b^{{3}/{2}} \tan \left (x \right ) c_1 +i {\mathrm e}^{-2 i \sqrt {a}\, \sqrt {b}\, x} \sqrt {a}\, \sqrt {b}-{\mathrm e}^{-2 i \sqrt {a}\, \sqrt {b}\, x} \tan \left (x \right ) a b}{a \left (2 i c_1 \sqrt {a}\, \sqrt {b}+{\mathrm e}^{-2 i \sqrt {a}\, \sqrt {b}\, x}\right )} \]
Mathematica. Time used: 7.716 (sec). Leaf size: 37
ode=D[y[x],x]==a*y[x]^2+2*a*b*Tan[x]*y[x]+b*(a*b-1)*Tan[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -b \tan (x)+\sqrt {\frac {b}{a}} \tan \left (a x \sqrt {\frac {b}{a}}+c_1\right ) \]
Sympy. Time used: 38.701 (sec). Leaf size: 71
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-2*a*b*y(x)*tan(x) - a*y(x)**2 - b*(a*b - 1)*tan(x)**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} + x + \frac {\sqrt {- \frac {1}{a b}} \log {\left (- b \sqrt {- \frac {1}{a b}} + b \tan {\left (x \right )} + y{\left (x \right )} \right )}}{2} - \frac {\sqrt {- \frac {1}{a b}} \log {\left (b \sqrt {- \frac {1}{a b}} + b \tan {\left (x \right )} + y{\left (x \right )} \right )}}{2} = 0 \]