40.11.8 problem 33

Internal problem ID [6742]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 16. Linear equations with constant coefficients (Short methods). Supplemetary problems. Page 107
Problem number : 33
Date solved : Wednesday, March 05, 2025 at 02:42:20 AM
CAS classification : [[_3rd_order, _linear, _nonhomogeneous]]

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

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