82.33.26 problem Ex. 26

Internal problem ID [18840]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter VI. Linear equations with constant coefficients. Examples on chapter VI, page 80
Problem number : Ex. 26
Date solved : Thursday, March 13, 2025 at 01:03:08 PM
CAS classification : [[_3rd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.005 (sec). Leaf size: 27
ode:=diff(diff(diff(y(x),x),x),x)-3*diff(diff(y(x),x),x)+4*diff(y(x),x)-2*y(x) = exp(x)+cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \left (c_{2} \cos \left (x \right )+c_3 \sin \left (x \right )+x +c_{1} \right ) {\mathrm e}^{x}+\frac {\cos \left (x \right )}{10}+\frac {3 \sin \left (x \right )}{10} \]
Mathematica. Time used: 0.092 (sec). Leaf size: 40
ode=D[y[x],{x,3}]-3*D[y[x],{x,2}]+4*D[y[x],x]-2*y[x]==Exp[x]+Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^x (x+c_3)+\left (\frac {1}{10}+c_2 e^x\right ) \cos (x)+\left (\frac {3}{10}+c_1 e^x\right ) \sin (x) \]
Sympy. Time used: 0.278 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*y(x) - exp(x) - cos(x) + 4*Derivative(y(x), x) - 3*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_{2} \sin {\left (x \right )} + C_{3} \cos {\left (x \right )} + x\right ) e^{x} + \frac {3 \sin {\left (x \right )}}{10} + \frac {\cos {\left (x \right )}}{10} \]