15.11.18 problem 18

Internal problem ID [3128]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 19, page 86
Problem number : 18
Date solved : Sunday, March 30, 2025 at 01:19:05 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+4 y^{\prime }+4 y&=x^{3} {\mathrm e}^{2 x} \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 36
ode:=diff(diff(y(x),x),x)+4*diff(y(x),x)+4*y(x) = x^3*exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (8 x^{3}-12 x^{2}+9 x -3\right ) {\mathrm e}^{2 x}}{128}+\left (c_1 x +c_2 \right ) {\mathrm e}^{-2 x} \]
Mathematica. Time used: 0.025 (sec). Leaf size: 43
ode=D[y[x],{x,2}]+4*D[y[x],x]+4*y[x]==x^3*Exp[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{128} e^{2 x} \left (8 x^3-12 x^2+9 x-3\right )+e^{-2 x} (c_2 x+c_1) \]
Sympy. Time used: 0.326 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**3*exp(2*x) + 4*y(x) + 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + C_{2} x\right ) e^{- 2 x} + \frac {\left (8 x^{3} - 12 x^{2} + 9 x - 3\right ) e^{2 x}}{128} \]