29.12.11 problem 330

Internal problem ID [4930]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 12
Problem number : 330
Date solved : Tuesday, March 04, 2025 at 07:30:59 PM
CAS classification : [[_homogeneous, `class D`], _Riccati]

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

Maple. Time used: 0.007 (sec). Leaf size: 21
ode:=2*x^2*diff(y(x),x) = 2*x*y(x)+(1-x*cot(x))*(x^2-y(x)^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = -\tanh \left (\frac {\ln \left (\sin \left (x \right )\right )}{2}-\frac {\ln \left (x \right )}{2}+\frac {c_{1}}{2}\right ) x \]
Mathematica. Time used: 1.117 (sec). Leaf size: 44
ode=2 x^2 D[y[x],x]==2 x y[x]+(1-x Cot[x])(x^2-y[x]^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {x \left (x-e^{2 c_1} \sin (x)\right )}{x+e^{2 c_1} \sin (x)} \\ y(x)\to -x \\ y(x)\to x \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x**2*Derivative(y(x), x) - 2*x*y(x) - (x**2 - y(x)**2)*(-x/tan(x) + 1),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out