28.1.41 problem 42

Internal problem ID [4347]
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 : 42
Date solved : Tuesday, March 04, 2025 at 06:27:17 PM
CAS classification : [[_homogeneous, `class G`], _dAlembert]

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

Maple. Time used: 0.079 (sec). Leaf size: 47
ode:=x-(x^2+y(x)^2)^(1/2)+(y(x)-(x^2+y(x)^2)^(1/2))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ \frac {\left (x +y \left (x \right )\right ) \sqrt {x^{2}+y \left (x \right )^{2}}+\left (-c_{1} x^{2}+1\right ) y \left (x \right )^{2}+x y \left (x \right )+x^{2}}{x^{2} y \left (x \right )^{2}} = 0 \]
Mathematica. Time used: 0.659 (sec). Leaf size: 34
ode=(x-Sqrt[x^2+y[x]^2])+(y[x]-Sqrt[x^2+y[x]^2])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {e^{c_1} \left (2 x+e^{c_1}\right )}{2 \left (x+e^{c_1}\right )} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 20.272 (sec). Leaf size: 73
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x - sqrt(x**2 + y(x)**2) + (-sqrt(x**2 + y(x)**2) + y(x))*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- \int \limits ^{\frac {x}{y{\left (x \right )}}} \frac {u_{1}}{u_{1}^{2} - u_{1} \sqrt {u_{1}^{2} + 1} - \sqrt {u_{1}^{2} + 1} + 1}\, du_{1} + \int \limits ^{\frac {x}{y{\left (x \right )}}} \frac {\sqrt {u_{1}^{2} + 1}}{u_{1}^{2} - u_{1} \sqrt {u_{1}^{2} + 1} - \sqrt {u_{1}^{2} + 1} + 1}\, du_{1}} \]