74.18.36 problem 42

Internal problem ID [16522]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 4. Higher Order Equations. Chapter 4 review exercises, page 219
Problem number : 42
Date solved : Monday, March 31, 2025 at 02:55:27 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

With initial conditions

\begin{align*} y \left (0\right )&=2\\ y^{\prime }\left (0\right )&=0 \end{align*}

Maple. Time used: 0.039 (sec). Leaf size: 20
ode:=diff(diff(y(t),t),t)-4*y(t) = t; 
ic:=y(0) = 2, D(y)(0) = 0; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = \frac {17 \,{\mathrm e}^{2 t}}{16}+\frac {15 \,{\mathrm e}^{-2 t}}{16}-\frac {t}{4} \]
Mathematica. Time used: 0.013 (sec). Leaf size: 16
ode=D[y[t],{t,2}]-4*y[t]==0; 
ic={y[0]==2,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to e^{-2 t}+e^{2 t} \]
Sympy. Time used: 0.100 (sec). Leaf size: 22
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-t - 4*y(t) + Derivative(y(t), (t, 2)),0) 
ics = {y(0): 2, Subs(Derivative(y(t), t), t, 0): 0} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = - \frac {t}{4} + \frac {17 e^{2 t}}{16} + \frac {15 e^{- 2 t}}{16} \]