10.1.1 problem 1

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

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

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