74.5.4 problem 4

Internal problem ID [15897]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Exercises 2.3, page 49
Problem number : 4
Date solved : Monday, March 31, 2025 at 02:12:16 PM
CAS classification : [[_linear, `class A`]]

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

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