Solving linear ODEs using the Laplace transform

Problem: Solve the ODE $\;f''+4f=\cos(3t)\;$ with initial conditions $\;f(0)=0,\;f'(0)=1$

Self-contained HTML rendered with MathJax (LaTeX)

Solution

Transform the ODE

Taking Laplace transforms and using $\mathcal{L}\{f''\}=s^2F(s)-sf(0)-f'(0)$: \[ s^2F(s)-sf(0)-f'(0)+4F(s)=\mathcal{L}\{\cos(3t)\}=\frac{s}{s^2+3^2}. \]

Apply the initial conditions

With $f(0)=0$ and $f'(0)=1$: \[ s^2F(s)-1+4F(s)=\frac{s}{s^2+9}. \]

Solve for $F(s)$

\[ F(s)=\frac{1}{s^2+4}+\frac{s}{(s^2+4)(s^2+9)}. \]

Partial fraction decomposition

\[ F(s)=\frac{1}{s^2+4}+\frac{1}{5}\Bigg(\frac{s}{s^2+4}-\frac{s}{s^2+9}\Bigg). \]

Inverse transform to find solution

Using $\mathcal{L}^{-1}\{\tfrac{s}{s^2+a^2}\}=\cos(at)$ and $\mathcal{L}^{-1}\{\tfrac{1}{s^2+a^2}\}=\tfrac{1}{a}\sin(at)$: \[ f(t)=\tfrac{1}{2}\sin(2t)+\tfrac{1}{5}\cos(2t)-\tfrac{1}{5}\cos(3t). \]



For more details, please contact me here.