6.5.24 problem 21

Internal problem ID [1648]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Transformation of Nonlinear Equations into Separable Equations. Section 2.4 Page 68
Problem number : 21
Date solved : Tuesday, September 30, 2025 at 04:41:23 AM
CAS classification : [[_homogeneous, `class A`]]

\begin{align*} y^{\prime }&=\frac {2 y^{2}+x^{2} {\mathrm e}^{-\frac {y^{2}}{x^{2}}}}{2 x y} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 26
ode:=diff(y(x),x) = 1/2*(2*y(x)^2+x^2*exp(-y(x)^2/x^2))/x/y(x); 
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: 1.137 (sec). Leaf size: 38
ode=D[y[x],x]==(2*y[x]^2+x^2*Exp[- (y[x]/x)^2 ])/(2*x*y[x]); 
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: 0.781 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x**2*exp(-y(x)**2/x**2) + 2*y(x)**2)/(2*x*y(x)),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 ] \]