78.1.25 problem 2 (k)

Internal problem ID [18009]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 1. The Nature of Differential Equations. Separable Equations. Section 2. Problems at page 9
Problem number : 2 (k)
Date solved : Monday, March 31, 2025 at 04:56:28 PM
CAS classification : [_separable]

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

Maple. Time used: 0.007 (sec). Leaf size: 16
ode:=x*diff(y(x),x) = (-2*x^2+1)*tan(y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \arcsin \left (\frac {x \,{\mathrm e}^{-x^{2}}}{c_1}\right ) \]
Mathematica. Time used: 37.548 (sec). Leaf size: 23
ode=x*D[y[x],x]==(1-2*x^2)*Tan[y[x]]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \arcsin \left (x e^{-x^2+c_1}\right ) \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.424 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - (1 - 2*x**2)*tan(y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \pi - \operatorname {asin}{\left (C_{1} x e^{- x^{2}} \right )}, \ y{\left (x \right )} = \operatorname {asin}{\left (C_{1} x e^{- x^{2}} \right )}\right ] \]