10.1.2 problem 2

Internal problem ID [1099]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Section 2.1. Page 40
Problem number : 2
Date solved : Saturday, March 29, 2025 at 10:38:53 PM
CAS classification : [[_linear, `class A`]]

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

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