20.4.12 problem Problem 20

Internal problem ID [3647]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.8, Change of Variables. page 79
Problem number : Problem 20
Date solved : Tuesday, March 04, 2025 at 04:59:23 PM
CAS classification : [[_homogeneous, `class A`], _rational, _dAlembert]

\begin{align*} y y^{\prime }&=\sqrt {x^{2}+y^{2}}-x \end{align*}

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