14.11.2 problem 2

Internal problem ID [2595]
Book : Differential equations and their applications, 4th ed., M. Braun
Section : Chapter 2. Second order differential equations. Section 2.5. Method of judicious guessing. Excercises page 164
Problem number : 2
Date solved : Sunday, March 30, 2025 at 12:11:06 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.005 (sec). Leaf size: 39
ode:=diff(diff(y(t),t),t)+4*diff(y(t),t)+4*y(t) = t*exp(alpha*t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = \frac {\left (\alpha +2\right )^{3} \left (c_1 t +c_2 \right ) {\mathrm e}^{-2 t}+\left (\alpha t +2 t -2\right ) {\mathrm e}^{\alpha t}}{\left (\alpha +2\right )^{3}} \]
Mathematica. Time used: 0.04 (sec). Leaf size: 37
ode=D[y[t],{t,2}]+4*D[y[t],t]+4*y[t]==t*Exp[\[Alpha]*t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {e^{\alpha t} ((\alpha +2) t-2)}{(\alpha +2)^3}+e^{-2 t} (c_2 t+c_1) \]
Sympy. Time used: 0.274 (sec). Leaf size: 48
from sympy import * 
t = symbols("t") 
Alpha = symbols("Alpha") 
y = Function("y") 
ode = Eq(-t*exp(Alpha*t) + 4*y(t) + 4*Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \frac {t e^{\mathrm {A} t}}{\mathrm {A}^{2} + 4 \mathrm {A} + 4} + \left (C_{1} + C_{2} t\right ) e^{- 2 t} - \frac {2 e^{\mathrm {A} t}}{\mathrm {A}^{3} + 6 \mathrm {A}^{2} + 12 \mathrm {A} + 8} \]