20.4.10 problem Problem 18

Internal problem ID [3645]
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 18
Date solved : Sunday, March 30, 2025 at 01:57:51 AM
CAS classification : [[_homogeneous, `class A`]]

\begin{align*} 2 x y y^{\prime }-x^{2} {\mathrm e}^{-\frac {y^{2}}{x^{2}}}-2 y^{2}&=0 \end{align*}

Maple. Time used: 0.006 (sec). Leaf size: 26
ode:=2*x*y(x)*diff(y(x),x)-x^2*exp(-y(x)^2/x^2)-2*y(x)^2 = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \sqrt {\ln \left (\ln \left (x \right )+c_1 \right )}\, x \\ y &= -\sqrt {\ln \left (\ln \left (x \right )+c_1 \right )}\, x \\ \end{align*}
Mathematica. Time used: 2.059 (sec). Leaf size: 38
ode=2*x*y[x]*D[y[x],x]-(x^2*Exp[-y[x]^2/x^2]+2*y[x]^2)==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -x \sqrt {\log (\log (x)+2 c_1)} \\ y(x)\to x \sqrt {\log (\log (x)+2 c_1)} \\ \end{align*}
Sympy. Time used: 1.327 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*exp(-y(x)**2/x**2) + 2*x*y(x)*Derivative(y(x), x) - 2*y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - x \sqrt {\log {\left (C_{1} + \log {\left (x \right )} \right )}}, \ y{\left (x \right )} = x \sqrt {\log {\left (C_{1} + \log {\left (x \right )} \right )}}\right ] \]