23.3.287 problem 289

Internal problem ID [6001]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 289
Date solved : Tuesday, September 30, 2025 at 02:19:39 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} -6 y+2 x y^{\prime }+x^{2} y^{\prime \prime }&=2-x \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 19
ode:=-6*y(x)+2*x*diff(y(x),x)+x^2*diff(diff(y(x),x),x) = 2-x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_2 \,x^{2}+\frac {c_1}{x^{3}}+\frac {x}{4}-\frac {1}{3} \]
Mathematica. Time used: 0.011 (sec). Leaf size: 26
ode=-6*y[x] + 2*x*D[y[x],x] + x^2*D[y[x],{x,2}] == 2 - x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {c_1}{x^3}+c_2 x^2+\frac {x}{4}-\frac {1}{3} \end{align*}
Sympy. Time used: 0.157 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), (x, 2)) + 2*x*Derivative(y(x), x) + x - 6*y(x) - 2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}}{x^{3}} + C_{2} x^{2} + \frac {x}{4} - \frac {1}{3} \]