4.1.24 problem 24

Internal problem ID [1121]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Section 2.1. Page 40
Problem number : 24
Date solved : Tuesday, September 30, 2025 at 04:22:22 AM
CAS classification : [_linear]

\begin{align*} \left (1+t \right ) y+t y^{\prime }&=2 t \,{\mathrm e}^{-t} \end{align*}

With initial conditions

\begin{align*} y \left (1\right )&=a \\ \end{align*}
Maple. Time used: 0.047 (sec). Leaf size: 21
ode:=(t+1)*y(t)+t*diff(y(t),t) = 2*t/exp(t); 
ic:=[y(1) = a]; 
dsolve([ode,op(ic)],y(t), singsol=all);
 
\[ y = \frac {\left (t^{2}+{\mathrm e} a -1\right ) {\mathrm e}^{-t}}{t} \]
Mathematica. Time used: 0.049 (sec). Leaf size: 22
ode=(1+t)*y[t]+t*D[y[t],t] == 2*t/Exp[t]; 
ic=y[1]==a; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to \frac {e^{-t} \left (e a+t^2-1\right )}{t} \end{align*}
Sympy. Time used: 0.224 (sec). Leaf size: 15
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(t*Derivative(y(t), t) - 2*t*exp(-t) + (t + 1)*y(t),0) 
ics = {y(1): a} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \left (t + \frac {e a - 1}{t}\right ) e^{- t} \]