13.10.2 problem 2

Internal problem ID [2403]
Book : Differential equations and their applications, 3rd ed., M. Braun
Section : Section 2.4, The method of variation of parameters. Page 154
Problem number : 2
Date solved : Sunday, March 30, 2025 at 12:00:28 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

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