81.12.18 problem 16-19

Internal problem ID [21671]
Book : The Differential Equations Problem Solver. VOL. I. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 16. Variation of Parameters. Page 375.
Problem number : 16-19
Date solved : Thursday, October 02, 2025 at 07:59:42 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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