90.20.20 problem 17 (1)

Internal problem ID [25315]
Book : Ordinary Differential Equations. By William Adkins and Mark G Davidson. Springer. NY. 2010. ISBN 978-1-4614-3617-1
Section : Chapter 5. Second Order Linear Differential Equations. Exercises at page 337
Problem number : 17 (1)
Date solved : Thursday, October 02, 2025 at 11:59:56 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} \left (t -1\right ) y^{\prime \prime }-t y^{\prime }+y&=2 t \,{\mathrm e}^{-t} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 16
ode:=(t-1)*diff(diff(y(t),t),t)-t*diff(y(t),t)+y(t) = 2*t*exp(-t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = t c_2 +{\mathrm e}^{t} c_1 +{\mathrm e}^{-t} \]
Mathematica. Time used: 0.507 (sec). Leaf size: 22
ode=(t-1)*D[y[t],{t,2}]-t*D[y[t],t]+y[t]==2*t*Exp[-t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to e^{-t}+c_1 e^t-c_2 t \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-t*Derivative(y(t), t) - 2*t*exp(-t) + (t - 1)*Derivative(y(t), (t, 2)) + y(t),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(t), t) - Derivative(y(t), (t, 2)) + 2*exp(-t) - y(t