76.15.19 problem 20

Internal problem ID [17581]
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 : 20
Date solved : Thursday, March 13, 2025 at 10:14:32 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

With initial conditions

\begin{align*} y \left (0\right )&=1\\ y^{\prime }\left (0\right )&=0 \end{align*}

Maple. Time used: 0.024 (sec). Leaf size: 28
ode:=diff(diff(y(t),t),t)-2*diff(y(t),t)-3*y(t) = 3*t*exp(2*t); 
ic:=y(0) = 1, D(y)(0) = 0; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = {\mathrm e}^{3 t}+\frac {2 \,{\mathrm e}^{-t}}{3}-t \,{\mathrm e}^{2 t}-\frac {2 \,{\mathrm e}^{2 t}}{3} \]
Mathematica. Time used: 0.022 (sec). Leaf size: 34
ode=D[y[t],{t,2}]-2*D[y[t],t]-3*y[t]==3*t*Exp[2*t]; 
ic={y[0]==1,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to -\frac {1}{3} e^{2 t} (3 t+2)+\frac {2 e^{-t}}{3}+e^{3 t} \]
Sympy. Time used: 0.264 (sec). Leaf size: 26
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-3*t*exp(2*t) - 3*y(t) - 2*Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {y(0): 1, Subs(Derivative(y(t), t), t, 0): 0} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \left (- t - \frac {2}{3}\right ) e^{2 t} + e^{3 t} + \frac {2 e^{- t}}{3} \]