10.10.2 problem 2

Internal problem ID [1334]
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 : 2
Date solved : Saturday, March 29, 2025 at 10:52:29 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.003 (sec). Leaf size: 24
ode:=diff(diff(y(t),t),t)-diff(y(t),t)-2*y(t) = 2*exp(-t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = \frac {\left (3 c_2 \,{\mathrm e}^{3 t}+3 c_1 -2 t \right ) {\mathrm e}^{-t}}{3} \]
Mathematica. Time used: 0.03 (sec). Leaf size: 32
ode=D[y[t],{t,2}]-D[y[t],t]-2*y[t] == 2*Exp[-t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {1}{9} e^{-t} \left (-6 t+9 c_2 e^{3 t}-2+9 c_1\right ) \]
Sympy. Time used: 0.218 (sec). Leaf size: 19
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-2*y(t) - 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 )} = C_{2} e^{2 t} + \left (C_{1} - \frac {2 t}{3}\right ) e^{- t} \]