29.6.20 problem 20

Internal problem ID [7305]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 6. SECOND-ORDER LINEAR EQUATIONSWITH CONSTANT COEFFICIENTS AND RIGHT-HAND SIDE NOT ZERO. page 422
Problem number : 20
Date solved : Tuesday, September 30, 2025 at 04:28:00 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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