10.10.3 problem 3

Internal problem ID [1335]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Chapter 3, Second order linear equations, section 3.6, Variation of Parameters. page 190
Problem number : 3
Date solved : Saturday, March 29, 2025 at 10:52:31 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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