12.5.7 problem 3

Internal problem ID [1631]
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 : 3
Date solved : Saturday, March 29, 2025 at 11:08:51 PM
CAS classification : [_Bernoulli]

\begin{align*} x^{2} y^{\prime }+2 y&=2 \,{\mathrm e}^{\frac {1}{x}} \sqrt {y} \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 25
ode:=x^2*diff(y(x),x)+2*y(x) = 2*exp(1/x)*y(x)^(1/2); 
dsolve(ode,y(x), singsol=all);
 
\[ \frac {{\mathrm e}^{\frac {1}{x}} \left (-c_1 x +1\right )+\sqrt {y}\, x}{x} = 0 \]
Mathematica. Time used: 0.171 (sec). Leaf size: 39
ode=D[y[x],x]+2*y[x]==2*Exp[1/x]*y[x]^(1/2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{4} e^{-2 x} \left (\int _1^x2 e^{K[1]+\frac {1}{K[1]}}dK[1]+2 c_1\right ){}^2 \]
Sympy. Time used: 0.396 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) - 2*sqrt(y(x))*exp(1/x) + 2*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1}^{2} - \frac {2 C_{1}}{x} + \frac {1}{x^{2}}\right ) e^{\frac {2}{x}} \]