I have the problem asking me to solve the initial value problem using the method of Laplace Transforms given $$ y''+y=f(t); \ \ \ \ \ y(0) = 0, y'(0)=1 $$ where $$ f(t)=\begin{cases} 0,& 0<t<1 \\ 1,& 1< t < 2 \\ 0,& 2 < t \end{cases} $$
I took the Laplace of both sides $$ L(y'') + L(y)=L(f)$$ I didn't bother to include the 2 other parts of the right side of the equation since they are both multiplied by 0.
The result came out to be: $$ (s^2Y(s)-(s)(0)-(1)) + Y(s) = \frac{e^{-s}-e^{-2s}}{s} $$ then $$ Y(s)(s^2+1)= \frac{e^{-s}-e^{-2s}}{s}+1$$ then $$ Y(s)= \frac{e^{-s}-e^{-2s}}{s(s^2+1)}+\frac{1}{s^2+1} $$
From here, I believe I need to take the inverse Laplace to get my final answer. While I know that the 2nd term will come out to be sin(t) once I take the inverse Laplace, I'm unsure of how to go about the first one. Any help would be greatly appreciated!
You do partial fractions: $$ \frac{e^{-s}-e^{-2s}}{s(s^2+1)}=\frac{e^{-s}-e^{-2s}}{s}-\frac{se^{-s}-se^{-2s}}{s^2+1} =\frac{e^{-s}}s-\frac{e^{-2s}}{s}-\frac{se^{-s}}{s^2+1}+\frac{se^{-2s}}{s^2+1}. $$ The inverse Laplace transform is then, with $H(t)$ the Heaviside function, $$\tag1 H(t-1)-H(t-2)-\cos(t-1)H(t-1)+\cos(t-2)H(t-2). $$ Note that your $f$ can be written as $f(t)=H(t-1)-H(t-2)$.