12.2.39 problem 48(b)

Internal problem ID [1575]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Linear first order. Section 2.1 Page 41
Problem number : 48(b)
Date solved : Tuesday, March 04, 2025 at 12:40:20 PM
CAS classification : [[_1st_order, `_with_symmetry_[F(x),G(y)]`]]

\begin{align*} {\mathrm e}^{y^{2}} \left (2 y y^{\prime }+\frac {2}{x}\right )&=\frac {1}{x^{2}} \end{align*}

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