28.1.9 problem 9

Internal problem ID [4315]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 2. First-Order and Simple Higher-Order Differential Equations. Page 78
Problem number : 9
Date solved : Sunday, March 30, 2025 at 02:59:07 AM
CAS classification : [[_homogeneous, `class A`], _dAlembert]

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

Maple. Time used: 0.006 (sec). Leaf size: 14
ode:=x*diff(y(x),x)-y(x) = x*cot(y(x)/x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = x \arccos \left (\frac {1}{x c_1}\right ) \]
Mathematica. Time used: 24.202 (sec). Leaf size: 56
ode=x*D[y[x],x]-y[x]==x*Cot[y[x]/x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -x \arccos \left (\frac {e^{-c_1}}{x}\right ) \\ y(x)\to x \arccos \left (\frac {e^{-c_1}}{x}\right ) \\ y(x)\to -\frac {\pi x}{2} \\ y(x)\to \frac {\pi x}{2} \\ \end{align*}
Sympy. Time used: 1.213 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - x/tan(y(x)/x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - x \operatorname {atan}{\left (\sqrt {C_{1} x^{2} - 1} \right )}, \ y{\left (x \right )} = x \operatorname {atan}{\left (\sqrt {C_{1} x^{2} - 1} \right )}\right ] \]