76.15.6 problem 6

Internal problem ID [17576]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 4. Second order linear equations. Section 4.5 (Nonhomogeneous Equations, Method of Undetermined Coefficients). Problems at page 260
Problem number : 6
Date solved : Monday, March 31, 2025 at 04:18:05 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.005 (sec). Leaf size: 17
ode:=diff(diff(y(t),t),t)+2*diff(y(t),t)+y(t) = 2*exp(-t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = {\mathrm e}^{-t} \left (t c_1 +t^{2}+c_2 \right ) \]
Mathematica. Time used: 0.02 (sec). Leaf size: 21
ode=D[y[t],{t,2}]+2*D[y[t],t]+y[t]==2*Exp[-t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to e^{-t} \left (t^2+c_2 t+c_1\right ) \]
Sympy. Time used: 0.196 (sec). Leaf size: 12
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(y(t) + 2*Derivative(y(t), t) + Derivative(y(t), (t, 2)) - 2*exp(-t),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \left (C_{1} + t \left (C_{2} + t\right )\right ) e^{- t} \]