89.33.31 problem 34

Internal problem ID [25015]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 17. Special Equations of order Two. Exercises at page 251
Problem number : 34
Date solved : Thursday, October 02, 2025 at 11:47:14 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.039 (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: 0.271 (sec). Leaf size: 23
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 \frac {1}{2} \left (x^2-4 x+8 \log (x+2)+5\right ) \end{align*}
Sympy. Time used: 0.616 (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} \]