I'm trying to use convolution to solve this problem: $$y''+y= \begin{cases} 1, & \text0<t<\pi \\ 0, & \text{t > }\pi \end{cases}$$ $$y(0)=0$$ $$y'(0)=0$$
First I made the RHS into a unit step function: $$y''+y=u(t)-u(t-\pi)+tu(t-\pi)$$ Then I took the Laplace of every term: $$s^2Y-sy(0)-y'(0)+Y={1\over s}-{e^{-\pi s}\over s}+{e^{-\pi s}\over s^2}+{\pi e^{-\pi s}\over s^2+1}$$ Isolated Y $$Y={1\over s}\cdot{1\over s^2+1}-{e^{-\pi s}\over s}\cdot{1\over s^2+1}+{e^{-\pi s}\over s^2}\cdot{1\over s^2+1}+{\pi e^{-\pi s}\over s}\cdot{1\over s^2+1}$$ Then for each term I chose a $G(s)$ and an $F(s)$. I think I made a mistake with this part.
1st term: $$G(s)={1\over s} \Rightarrow g(t)=1$$ $$F(s)={1\over s^2+1} \Rightarrow f(t)=\sin t$$ 2nd term: $$F(s)={e^{-\pi s}\over s} \Rightarrow f(t)=u(t-\pi)$$ $$G(s)={1\over s^2+1} \Rightarrow g(t)=\sin t$$ 3rd term: $$F(s)={e^{-\pi s}\over s^2} \Rightarrow f(t)=(t-\pi)u(t-\pi)$$ $$G(s)={1\over s^2+1} \Rightarrow g(t)=\sin t$$ 4th term: $$F(s)={\pi e^{-\pi s}\over s} \Rightarrow f(t)=\pi u(t-\pi)$$ $$G(s)={1\over s^2+1} \Rightarrow g(t)=\sin t$$
I put all of them through the convolution integral $$(f*g)(t)=\int_0^tf(v)g(t-v)dv$$ I did a ton of work to solve all of them, and I had to use the trig identity $sin(t-v)=sint\;cosv-cost\;sinv$ for for three of the terms.
I ended up with this: $$y=t+\sin t-\pi + \pi^2(1+\cos t)$$
Does this seem like a reasonable value? My friend told me that there should be a unit step function in the result, but he can't find what I did wrong. I apologize if there isn't enough work shown, there is just so much of it. If it's necessary I can add it in.
Rewriting the problem in terms of $u(t)$, it becomes
$$y''+y=u(t)-u(t-\pi)$$ Then $$s^2Y-s\require{cancel}\cancel{y(0)}-\require{cancel}\cancel{y'(0)}+Y={1\over s}-{e^{-\pi s}\over s}$$ $$Y={1\over s}\left({1\over s^2+1}-{e^{-\pi s}\over s^2+1}\right)$$ Now applying the following property of the LT:
yields
$$\begin{align} y&=\int_0^t\left(\sin(x)-\sin(x-\pi)u(x-\pi)\right)dx\\ &=\int_0^t\sin(x)dx-u(t-\pi)\int_{\pi}^t\sin(x-\pi)dx\\ &=\int_0^t\sin(x)dx-u(t-\pi)\int_{\pi}^t-\sin(x)dx\\ &=-\cos(t)+1-u(t-\pi)\left(\cos(t)+1\right) \end{align}$$