29.8.6 problem 6

Internal problem ID [7348]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 13. Miscellaneous problems. page 466
Problem number : 6
Date solved : Tuesday, September 30, 2025 at 04:29:23 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+2 y^{\prime }+2 y&=10 \,{\mathrm e}^{x}+6 \,{\mathrm e}^{-x} \cos \left (x \right ) \end{align*}
Maple. Time used: 0.009 (sec). Leaf size: 30
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+2*y(x) = 10*exp(x)+6*exp(-x)*cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (2 \,{\mathrm e}^{2 x}+\left (c_1 +3\right ) \cos \left (x \right )+\left (c_2 +3 x \right ) \sin \left (x \right )\right ) {\mathrm e}^{-x} \]
Mathematica. Time used: 0.1 (sec). Leaf size: 80
ode=D[y[x],{x,2}]+2*D[y[x],x]+2*y[x]==10*Exp[x]+6*Exp[-x]*Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-x} \left (\cos (x) \int _1^x-2 \left (3 \cos (K[2])+5 e^{2 K[2]}\right ) \sin (K[2])dK[2]+\sin (x) \int _1^x2 \cos (K[1]) \left (3 \cos (K[1])+5 e^{2 K[1]}\right )dK[1]+c_2 \cos (x)+c_1 \sin (x)\right ) \end{align*}
Sympy. Time used: 0.194 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) - 10*exp(x) + 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 6*exp(-x)*cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{2} \cos {\left (x \right )} + \left (C_{1} + 3 x\right ) \sin {\left (x \right )}\right ) e^{- x} + 2 e^{x} \]