29.7.27 problem 202

Internal problem ID [4802]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 7
Problem number : 202
Date solved : Sunday, March 30, 2025 at 03:58:34 AM
CAS classification : [_separable]

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

Maple. Time used: 0.005 (sec). Leaf size: 22
ode:=x*diff(y(x),x) = (-2*x^2+1)*cot(y(x))^2; 
dsolve(ode,y(x), singsol=all);
 
\[ x^{2}-\ln \left (x \right )+\tan \left (y\right )+\frac {\pi }{2}-y+c_1 = 0 \]
Mathematica. Time used: 0.534 (sec). Leaf size: 55
ode=x D[y[x],x]==(1-2 x^2)Cot[y[x]]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \text {InverseFunction}\left [\frac {1}{2} (\tan (\text {$\#$1})-\arctan (\tan (\text {$\#$1})))\&\right ]\left [-\frac {x^2}{2}+\frac {\log (x)}{2}+c_1\right ] \\ y(x)\to -\frac {\pi }{2} \\ y(x)\to \frac {\pi }{2} \\ \end{align*}
Sympy. Time used: 7.190 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - (1 - 2*x**2)/tan(y(x))**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ x^{2} - y{\left (x \right )} - \log {\left (x \right )} + \frac {\sin {\left (y{\left (x \right )} \right )}}{\cos {\left (y{\left (x \right )} \right )}} = C_{1} \]