58.7.2 problem 2

Internal problem ID [14657]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, Section 2.4. Special integrating factors and transformations. Exercises page 67
Problem number : 2
Date solved : Thursday, October 02, 2025 at 09:48:52 AM
CAS classification : [[_1st_order, `_with_symmetry_[F(x),G(x)]`]]

\begin{align*} 2 x +\tan \left (y\right )+\left (x -x^{2} \tan \left (y\right )\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.017 (sec). Leaf size: 134
ode:=2*x+tan(y(x))+(x-x^2*tan(y(x)))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \arctan \left (\frac {-\sqrt {x^{4}-c_1^{2}+x^{2}}\, x -c_1}{\left (x^{2}+1\right ) x}, \frac {-c_1 x +\sqrt {x^{4}-c_1^{2}+x^{2}}}{\left (x^{2}+1\right ) x}\right ) \\ y &= \arctan \left (\frac {\sqrt {x^{4}-c_1^{2}+x^{2}}\, x -c_1}{\left (x^{2}+1\right ) x}, \frac {-c_1 x -\sqrt {x^{4}-c_1^{2}+x^{2}}}{\left (x^{2}+1\right ) x}\right ) \\ \end{align*}
Mathematica. Time used: 31.583 (sec). Leaf size: 177
ode=(2*x+Tan[y[x]])+(x-x^2*Tan[y[x]])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\arccos \left (-\frac {c_1 x^2+\sqrt {x^6+x^4-c_1{}^2 x^2}}{x^4+x^2}\right )\\ y(x)&\to \arccos \left (-\frac {c_1 x^2+\sqrt {x^6+x^4-c_1{}^2 x^2}}{x^4+x^2}\right )\\ y(x)&\to -\arccos \left (\frac {\sqrt {x^6+x^4-c_1{}^2 x^2}-c_1 x^2}{x^4+x^2}\right )\\ y(x)&\to \arccos \left (\frac {\sqrt {x^6+x^4-c_1{}^2 x^2}-c_1 x^2}{x^4+x^2}\right ) \end{align*}
Sympy. Time used: 3.667 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x + (-x**2*tan(y(x)) + x)*Derivative(y(x), x) + tan(y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \operatorname {asin}{\left (\frac {C_{1}}{x \sqrt {x^{2} + 1}} \right )} - \operatorname {atan}{\left (x \right )}, \ y{\left (x \right )} = - \operatorname {asin}{\left (\frac {C_{1}}{x \sqrt {x^{2} + 1}} \right )} - \operatorname {atan}{\left (x \right )} + \pi \right ] \]