6.9.43 problem 39 part(a)

Internal problem ID [1799]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 5 linear second order equations. Section 5.6 Reduction or order. Page 253
Problem number : 39 part(a)
Date solved : Tuesday, September 30, 2025 at 05:19:28 AM
CAS classification : [_rational, [_1st_order, `_with_symmetry_[F(x),G(x)]`], _Riccati]

\begin{align*} x^{2} \left (y^{\prime }+y^{2}\right )-x \left (x +2\right ) y+x +2&=0 \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 20
ode:=x^2*(diff(y(x),x)+y(x)^2)-x*(x+2)*y(x)+x+2 = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {1}{-1+{\mathrm e}^{-x} c_1}+\frac {1}{x} \]
Mathematica. Time used: 0.103 (sec). Leaf size: 49
ode=x^2*(D[y[x],x]+y[x])-x*(x+2)+y[x]+x+2==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{\frac {1}{x}-x} \left (\int _1^x\frac {e^{K[1]-\frac {1}{K[1]}} \left (K[1]^2+K[1]-2\right )}{K[1]^2}dK[1]+c_1\right ) \end{align*}
Sympy. Time used: 0.226 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*(y(x)**2 + Derivative(y(x), x)) - x*(x + 2)*y(x) + x + 2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} - x e^{x} - e^{x}}{x \left (C_{1} - e^{x}\right )} \]