64.11.20 problem 20

Internal problem ID [13391]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.3. The method of undetermined coefficients. Exercises page 151
Problem number : 20
Date solved : Wednesday, March 05, 2025 at 09:51:44 PM
CAS classification : [[_3rd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.008 (sec). Leaf size: 34
ode:=diff(diff(diff(y(x),x),x),x)-4*diff(diff(y(x),x),x)+5*diff(y(x),x)-2*y(x) = 3*x^2*exp(x)-7*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {{\mathrm e}^{x} \left (x^{4}+4 x^{3}-4 \,{\mathrm e}^{x} c_{2} -4 c_{3} x -2 x^{2}-4 c_{1} \right )}{4} \]
Mathematica. Time used: 0.061 (sec). Leaf size: 73
ode=D[y[x],{x,3}]-4*D[y[x],{x,2}]+5*D[y[x],x]-2*y[x]==3*x^2*Exp[x]-7*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{4} e^x \left (4 e^x \int _1^xe^{-K[1]} \left (3 K[1]^2-7\right )dK[1]-x^4-4 x^3+14 x^2+4 (7+c_2) x+4 \left (c_3 e^x+c_1\right )\right ) \]
Sympy. Time used: 0.308 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-3*x**2*exp(x) - 2*y(x) + 7*exp(x) + 5*Derivative(y(x), x) - 4*Derivative(y(x), (x, 2)) + Derivative(y(x), (x, 3)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + C_{3} e^{x} + x \left (C_{2} - \frac {x^{3}}{4} - x^{2} + \frac {x}{2}\right )\right ) e^{x} \]