18.2.5 problem Problem 15.5(a)

Internal problem ID [3488]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 15, Higher order ordinary differential equations. 15.4 Exercises, page 523
Problem number : Problem 15.5(a)
Date solved : Tuesday, March 04, 2025 at 04:43:15 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} f^{\prime \prime }+8 f^{\prime }+12 f&=12 \,{\mathrm e}^{-4 t} \end{align*}

With initial conditions

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

Maple. Time used: 0.016 (sec). Leaf size: 23
ode:=diff(diff(f(t),t),t)+8*diff(f(t),t)+12*f(t) = 12*exp(-4*t); 
ic:=f(0) = 0, D(f)(0) = 0; 
dsolve([ode,ic],f(t), singsol=all);
 
\[ f = \frac {3 \,{\mathrm e}^{-2 t}}{2}+\frac {3 \,{\mathrm e}^{-6 t}}{2}-3 \,{\mathrm e}^{-4 t} \]
Mathematica. Time used: 0.023 (sec). Leaf size: 23
ode=D[ f[t],{t,2}]+8*D[ f[t],t]+12*f[t]==12*Exp[-4*t]; 
ic={f[0]==0,Derivative[1][f][0]==0}; 
DSolve[{ode,ic},f[t],t,IncludeSingularSolutions->True]
 
\[ f(t)\to \frac {3}{2} e^{-6 t} \left (e^{2 t}-1\right )^2 \]
Sympy. Time used: 0.291 (sec). Leaf size: 26
from sympy import * 
t = symbols("t") 
f = Function("f") 
ode = Eq(12*f(t) + 8*Derivative(f(t), t) + Derivative(f(t), (t, 2)) - 12*exp(-4*t),0) 
ics = {f(0): 0, Subs(Derivative(f(t), t), t, 0): 0} 
dsolve(ode,func=f(t),ics=ics)
 
\[ f{\left (t \right )} = \left (\frac {3}{2} - 3 e^{- 2 t} + \frac {3 e^{- 4 t}}{2}\right ) e^{- 2 t} \]