22.3.3 problem 6.38

Internal problem ID [4516]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 6. The Laplace Transform and Its Applications. Problems at page 291
Problem number : 6.38
Date solved : Tuesday, September 30, 2025 at 07:33:47 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Using Laplace method With initial conditions

\begin{align*} y \left (0\right )&=6 \\ y^{\prime }\left (0\right )&=2 \\ \end{align*}
Maple. Time used: 0.110 (sec). Leaf size: 24
ode:=diff(diff(y(t),t),t)-diff(y(t),t)-2*y(t) = 2*t^2+1; 
ic:=[y(0) = 6, D(y)(0) = 2]; 
dsolve([ode,op(ic)],y(t),method='laplace');
 
\[ y = t +3 \,{\mathrm e}^{2 t}+5 \,{\mathrm e}^{-t}-2-t^{2} \]
Mathematica. Time used: 0.01 (sec). Leaf size: 27
ode=D[y[t],{t,2}]-D[y[t],t]-2*y[t]==2*t^2+1; 
ic={y[0]==6,Derivative[1][y][0] == 2}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to -t^2+t+5 e^{-t}+3 e^{2 t}-2 \end{align*}
Sympy. Time used: 0.114 (sec). Leaf size: 20
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-2*t**2 - 2*y(t) - Derivative(y(t), t) + Derivative(y(t), (t, 2)) - 1,0) 
ics = {y(0): 6, Subs(Derivative(y(t), t), t, 0): 2} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = - t^{2} + t + 3 e^{2 t} - 2 + 5 e^{- t} \]