85.33.38 problem 38

Internal problem ID [22661]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter two. First order and simple higher order ordinary differential equations. A Exercises at page 65
Problem number : 38
Date solved : Thursday, October 02, 2025 at 09:03:09 PM
CAS classification : [[_homogeneous, `class A`], _dAlembert]

\begin{align*} x y^{\prime }-y&=x \cos \left (\frac {y}{x}\right ) \end{align*}
Maple. Time used: 0.008 (sec). Leaf size: 43
ode:=x*diff(y(x),x)-y(x) = x*cos(y(x)/x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \arctan \left (\frac {c_1^{2} x^{2}-1}{c_1^{2} x^{2}+1}, \frac {2 x c_1}{c_1^{2} x^{2}+1}\right ) x \]
Mathematica. Time used: 0.158 (sec). Leaf size: 39
ode=x*D[y[x],{x,1}]-y[x]==x*Cos[ y[x]/x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to 2 x \arctan \left (\tanh \left (\frac {1}{2} (\log (x)+c_1)\right )\right )\\ y(x)&\to -\frac {\pi x}{2}\\ y(x)&\to \frac {\pi x}{2} \end{align*}
Sympy. Time used: 0.885 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*cos(y(x)/x) + x*Derivative(y(x), x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 2 x \operatorname {atan}{\left (\frac {C_{1} + x}{- C_{1} + x} \right )} \]