12.10.12 problem 12

Internal problem ID [1816]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 5 linear second order equations. Section 5.7 Variation of Parameters. Page 262
Problem number : 12
Date solved : Saturday, March 29, 2025 at 11:40:18 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.003 (sec). Leaf size: 25
ode:=x^2*diff(diff(y(x),x),x)-3*x*diff(y(x),x)+3*y(x) = 2*x^4*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (c_1 \,x^{2}-4 x \sin \left (x \right )-4 \cos \left (x \right )+2 c_2 \right ) x}{2} \]
Mathematica. Time used: 0.044 (sec). Leaf size: 25
ode=x^2*D[y[x],{x,2}]-3*x*D[y[x],x]+3*y[x]==2*x^4*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \left (c_2 x^2-2 x \sin (x)-2 \cos (x)+c_1\right ) \]
Sympy. Time used: 0.556 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x**4*sin(x) + x**2*Derivative(y(x), (x, 2)) - 3*x*Derivative(y(x), x) + 3*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (C_{1} + C_{2} x^{2} - 2 x \sin {\left (x \right )} - 2 \cos {\left (x \right )}\right ) \]