85.67.3 problem 3

Internal problem ID [22894]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter 4. Linear differential equations. A Exercises at page 216
Problem number : 3
Date solved : Thursday, October 02, 2025 at 09:16:22 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y+2 y^{\prime }+y^{\prime \prime }&={\mathrm e}^{x}+{\mathrm e}^{-x} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 29
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+y(x) = exp(x)+exp(-x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (x^{2}+\left (2 c_1 +1\right ) x +2 c_2 \right ) {\mathrm e}^{-x}}{2}+\frac {\cosh \left (x \right )}{2} \]
Mathematica. Time used: 0.061 (sec). Leaf size: 34
ode=D[y[x],{x,2}]+2*D[y[x],{x,1}]+y[x]==Exp[x]+Exp[-x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{4} e^{-x} \left (2 x^2+e^{2 x}+4 c_2 x+4 c_1\right ) \end{align*}
Sympy. Time used: 0.158 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - exp(x) + 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - exp(-x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + x \left (C_{2} + \frac {x}{2}\right )\right ) e^{- x} + \frac {e^{x}}{4} \]