4.1.3 problem 3

Internal problem ID [1100]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Section 2.1. Page 40
Problem number : 3
Date solved : Tuesday, September 30, 2025 at 04:21:46 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} y+y^{\prime }&=1+t \,{\mathrm e}^{-t} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 19
ode:=y(t)+diff(y(t),t) = 1+t/exp(t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = 1+\frac {{\mathrm e}^{-t} \left (t^{2}+2 c_1 \right )}{2} \]
Mathematica. Time used: 0.037 (sec). Leaf size: 27
ode=y[t]+D[y[t],t] == 1+t/Exp[t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to \frac {1}{2} e^{-t} \left (t^2+2 e^t+2 c_1\right ) \end{align*}
Sympy. Time used: 0.098 (sec). Leaf size: 14
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-t*exp(-t) + y(t) + Derivative(y(t), t) - 1,0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \left (C_{1} + \frac {t^{2}}{2}\right ) e^{- t} + 1 \]