28.1.10 problem 10

Internal problem ID [4316]
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 : 10
Date solved : Tuesday, March 04, 2025 at 06:20:44 PM
CAS classification : [[_homogeneous, `class A`], _dAlembert]

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

Maple. Time used: 0.007 (sec). Leaf size: 12
ode:=x*cos(y(x)/x)^2-y(x)+x*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = -\arctan \left (\ln \left (x \right )+c_{1} \right ) x \]
Mathematica. Time used: 0.457 (sec). Leaf size: 37
ode=(x*Cos[y[x]/x]^2-y[x])+x*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to x \arctan (-\log (x)+2 c_1) \\ y(x)\to -\frac {\pi x}{2} \\ y(x)\to \frac {\pi x}{2} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*cos(y(x)/x)**2 + x*Derivative(y(x), x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : cannot determine truth value of Relational