20.7.15 problem Problem 40

Internal problem ID [3730]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 8, Linear differential equations of order n. Section 8.3, The Method of Undetermined Coefficients. page 525
Problem number : Problem 40
Date solved : Sunday, March 30, 2025 at 02:06:44 AM
CAS classification : [[_3rd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.005 (sec). Leaf size: 28
ode:=diff(diff(diff(y(x),x),x),x)+diff(diff(y(x),x),x)+diff(y(x),x)+y(x) = 4*x*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (2 x -3\right ) {\mathrm e}^{x}}{2}+c_1 \cos \left (x \right )+c_2 \sin \left (x \right )+c_3 \,{\mathrm e}^{-x} \]
Mathematica. Time used: 0.006 (sec). Leaf size: 36
ode=D[y[x],{x,3}]+D[y[x],{x,2}]+D[y[x],x]+y[x]==4*x*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^x x-\frac {3 e^x}{2}+c_3 e^{-x}+c_1 \cos (x)+c_2 \sin (x) \]
Sympy. Time used: 0.182 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*x*exp(x) + y(x) + Derivative(y(x), x) + Derivative(y(x), (x, 2)) + Derivative(y(x), (x, 3)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- x} + C_{2} \sin {\left (x \right )} + C_{3} \cos {\left (x \right )} + \left (x - \frac {3}{2}\right ) e^{x} \]