6.10.25 problem 25

Internal problem ID [1829]
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 : 25
Date solved : Tuesday, September 30, 2025 at 05:20:10 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{2} y^{\prime \prime }-x \left (x +4\right ) y^{\prime }+2 \left (x +3\right ) y&=x^{4} {\mathrm e}^{x} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 16
ode:=x^2*diff(diff(y(x),x),x)-x*(x+4)*diff(y(x),x)+2*(x+3)*y(x) = x^4*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = x^{2} \left (\left (x +c_2 \right ) {\mathrm e}^{x}+c_1 \right ) \]
Mathematica. Time used: 0.021 (sec). Leaf size: 21
ode=x^2*D[y[x],{x,2}]-x*(x+4)*D[y[x],x]+2*(x+3)*y[x]==x^4*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x^2 \left (e^x (x-1+c_2)+c_1\right ) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**4*exp(x) + x**2*Derivative(y(x), (x, 2)) - x*(x + 4)*Derivative(y(x), x) + (2*x + 6)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (-x**4*exp(x) + x**2*Derivative(y(x), (x, 2)) + 2*x*y(x) + 6*y(x))/(x*(x + 4)) cannot be solved by the factorable group method