Find the solution to the differential equation, using the Laplace Transform.
$y'-y=2\cos 5t$, with initial condition $y(0)=0$.
My attempt: First I take the Laplace Transform of each term.
$\mathscr{L}\{y'\}-\mathscr{L}\{y\}=2\mathscr{L}\{\cos 5t\}\\ sY(s)-y(0)-Y(s)=2\cdot \dfrac{s^2}{s^2+25}\\ Y(s)(s-1)=\dfrac{2s^2}{s^2+25}\\ Y(s)=\dfrac{2s^2}{s^2+25}\cdot \dfrac{1}{s-1}=\dfrac{2s^2}{(s^2+25)(s-1)}$
Applying partial fraction decomposition:
$\dfrac{2s^2}{(s^2+25)(s-1)}=\dfrac{A}{s-1}+\dfrac{Bs+C}{s^2+25}\\ \implies \dfrac{2s^2}{(s^2+25)(s-1)}=\dfrac{(s^2+25)A+(s-1)(Bs+C)}{(s-1)(s^2+25)}\\ \implies 2s^2=(s^2+25)A+(s-1)(Bs+C)$
Letting $s=1, \\2=26A\implies A=\dfrac{1}{13}\\$
Expanding the partial fraction,
$2s^2=As^2+25A+Bs^2+Cs-Bs-C\\ \implies (2)s^2=(A+B)s^2+(C-B)s+(25A-C)\\ \text{Equating coefficients get me:}\\ A+B=2\quad \text{(1)}\\ C-B=0\quad \text{(2)}\\ 25A-C=0\quad \text{(3)}$
Substituting $A=\dfrac{1}{13}$ into $\text{(1)}:\\ \dfrac{1}{13} + B=2\\ \implies B=2-\dfrac{1}{13} \\B=\dfrac{26}{13}-\dfrac{1}{13} \\B=\dfrac{25}{13}$
Substituting $B=\dfrac{25}{13}$ into $\text{(2)}:\\ C-\dfrac{25}{13}=0\\ C=\dfrac{25}{13}$
To make sure I didn't mess up any of the arithmetic, I substitute these values for $A,B,C$ into $\dfrac{A}{(s-1)}+\dfrac{Bs+C}{(s^2+25)}.$ After substituting the values in, I should get $2s^2$.
Subbing the values in:
$\dfrac{\frac{1}{13}}{s-1}+\dfrac{\frac{25}{13}s+\frac{25}{13}}{s^2+25}\\ =\frac{1}{13}s^2+\frac{25}{13}+\left (\frac{25}{13}s+\frac{25}{13}\right)(s-1)\\= \frac{1}{13}s^2+\frac{25}{13}+\frac{25}{13}s^2-\frac{25}{13}s+\frac{25}{13}s-\frac{25}{13}\\ =\frac{1}{13}s^2+\frac{25}{13}s^2=\frac{26}{13}s^2=2s^2$.
So the partial fraction decomposition is good.
I now proceed to take the Inverse Laplace Transform:
$\mathscr{L}^{-1}\{Y(s)\}=\mathscr{L}^{-1}\left\{\dfrac{\frac{1}{13}}{s-1}\right\}+\mathscr{L}^{-1}\left\{\dfrac{\frac{25}{13}s}{s^2+25}\right\}+\mathscr{L}^{-1}\left\{\dfrac{\frac{25}{13}}{s^2+25}\right\}\\ \implies y(t)=\frac{1}{13}\mathscr{L}^{-1}\left\{\dfrac{1}{s-1}\right\}+\frac{25}{13}\mathscr{L}^{-1}\left\{\dfrac{s}{s^2+25}\right\}+\frac{25}{13}\mathscr{L}^{-1}\left\{\dfrac{1}{s^2+25}\right\}\\ \implies y(t)=\frac{1}{13}e^t+\frac{25}{13}\cos 5t+\frac{25}{13}\cdot \frac{1}{5}\sin 5t\\ \implies y(t)=\frac{1}{13}e^t+\frac{25}{13}\cos 5t+\frac{5}{13}\sin 5t$
...and so I thought that's the solution, but when I substitute $y(t)$ into the original differential equation, I'm not getting $2\cos 5t$, so I suppose I messed up somewhere. If someone can tell me where I went wrong (if I went wrong), it would be greatly appreciated. Thanks.
You have a mistake in the Laplace transform of the cosine:
$$\begin{align} \int_0^\infty \cos (\omega t)e^{-st}\,dt &= \frac{1}{2} \int_0^\infty e^{(i\omega-s)t} + e^{-(i\omega+s)t}\,dt\\ &= \frac{1}{2} \left[\frac{e^{(i\omega-s)t}}{i\omega-s} - \frac{e^{-(i\omega+s)t}}{i\omega+s}\right]_0^\infty\\ &= \frac{1}{2}\left[\frac{1}{i\omega+s} - \frac{1}{i\omega-s}\right]\\ &= \frac{(i\omega-s)-(i\omega+s)}{2(i\omega+s)(i\omega-s)}\\ &= \frac{-2s}{2(-\omega^2-s^2)}\\ &= \frac{s}{\omega^2+s^2}, \end{align}$$
so $2\mathscr{L}\{\cos 5t\} = \dfrac{2s}{s^2+25}$, not $\dfrac{2s^2}{s^2+25}$, you have a factor $s$ too much. I expect that after correcting that, it will work out.