68.11.4 problem 16

Internal problem ID [17541]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 4. Higher Order Equations. Exercises 4.3, page 156
Problem number : 16
Date solved : Thursday, October 02, 2025 at 02:25:14 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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