47.4.31 problem 34

Internal problem ID [9805]
Book : Elementary differential equations. By Earl D. Rainville, Phillip E. Bedient. Macmilliam Publishing Co. NY. 6th edition. 1981.
Section : CHAPTER 16. Nonlinear equations. Section 101. Independent variable missing. EXERCISES Page 324
Problem number : 34
Date solved : Tuesday, September 30, 2025 at 06:42:17 PM
CAS classification : [[_2nd_order, _missing_y]]

\begin{align*} x^{2} y^{\prime \prime }&=y^{\prime } \left (2 x -y^{\prime }\right ) \end{align*}

With initial conditions

\begin{align*} y \left (-1\right )&=5 \\ y^{\prime }\left (-1\right )&=1 \\ \end{align*}
Maple. Time used: 0.082 (sec). Leaf size: 20
ode:=x^2*diff(diff(y(x),x),x) = diff(y(x),x)*(2*x-diff(y(x),x)); 
ic:=[y(-1) = 5, D(y)(-1) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {x^{2}}{2}-2 x +4 \ln \left (2+x \right )+\frac {5}{2} \]
Mathematica. Time used: 11.138 (sec). Leaf size: 45
ode=x^2*D[y[x],{x,2}]==D[y[x],x]*(2*x-D[y[x],x]); 
ic={y[-1]==5,Derivative[1][y][-1]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \int _1^x\frac {K[1]^2}{K[1]+2}dK[1]-\int _1^{-1}\frac {K[1]^2}{K[1]+2}dK[1]+5 \end{align*}
Sympy. Time used: 0.622 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), (x, 2)) - (2*x - Derivative(y(x), x))*Derivative(y(x), x),0) 
ics = {y(-1): 5, Subs(Derivative(y(x), x), x, -1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x^{2}}{2} - 2 x + 4 \log {\left (x + 2 \right )} + \frac {5}{2} \]