15.14.14 problem 14

Internal problem ID [3186]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 23, page 106
Problem number : 14
Date solved : Sunday, March 30, 2025 at 01:20:44 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

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