66.16.29 problem 30

Internal problem ID [16212]
Book : DIFFERENTIAL EQUATIONS by Paul Blanchard, Robert L. Devaney, Glen R. Hall. 4th edition. Brooks/Cole. Boston, USA. 2012
Section : Chapter 4. Forcing and Resonance. Section 4.1 page 399
Problem number : 30
Date solved : Thursday, October 02, 2025 at 10:43:40 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+2 y&=-{\mathrm e}^{t} \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=0 \\ y^{\prime }\left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.068 (sec). Leaf size: 28
ode:=diff(diff(y(t),t),t)+2*y(t) = -exp(t); 
ic:=[y(0) = 0, D(y)(0) = 0]; 
dsolve([ode,op(ic)],y(t), singsol=all);
 
\[ y = \frac {\sqrt {2}\, \sin \left (\sqrt {2}\, t \right )}{6}+\frac {\cos \left (\sqrt {2}\, t \right )}{3}-\frac {{\mathrm e}^{t}}{3} \]
Mathematica. Time used: 0.013 (sec). Leaf size: 39
ode=D[y[t],{t,2}]+2*y[t]==-Exp[t]; 
ic={y[0]==0,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to \frac {1}{6} \left (-2 e^t+\sqrt {2} \sin \left (\sqrt {2} t\right )+2 \cos \left (\sqrt {2} t\right )\right ) \end{align*}
Sympy. Time used: 0.052 (sec). Leaf size: 32
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(2*y(t) + exp(t) + Derivative(y(t), (t, 2)),0) 
ics = {y(0): 0, Subs(Derivative(y(t), t), t, 0): 0} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = - \frac {e^{t}}{3} + \frac {\sqrt {2} \sin {\left (\sqrt {2} t \right )}}{6} + \frac {\cos {\left (\sqrt {2} t \right )}}{3} \]