Use laplace transform to solve the ODE $y''(t)+4y(t)=4u(\pi-t)cos(t)$,,,,,,, $y(0)=y'(0)=0$
u is the unit step function (heaviside function)
I use: $u(\pi-t)=1-u(t-pi)$ By inserting this and transforming i get:
$Y(s)(s^2+4)=4 \frac{s}{s^2+1}- 4\frac{s}{s^2+1} \frac{e^{-\pi s}}{s}$
But the answer to the exercise is $Y(s)(s^2+4)=4 \frac{s}{s^2+1}+ 4\frac{s}{s^2+1} e^{-\pi s}$ What am i doing wrong? Or is the answer wrong? I know i am not done yet but i first need to find the correct transformation.
Since the problem with your work is something to do with the RHS of the ODE, I'll focus on computing that side's transform only. $$\begin{align*} \mathcal{L}\left\{4\,\mathcal{U}(\pi-t)\cos t\right\}&=4\int_0^\infty \mathcal{U}(\pi-t)\cos t\,e^{-st}\,\mathrm{d}t\\[1ex] &=4\int_0^\pi \cos t\,e^{-st}\,\mathrm{d}t\\[1ex] &=\frac{4}{1+s^2}\bigg[e^{-st}(\sin t-s\cos t)\bigg]_{t=0}^{t=\pi}\\[1ex] &=\frac{4(se^{-\pi s}+s)}{1+s^2} \end{align*}$$ which agrees with the proposed solution.
Let's check again using the table here. $\#28$ and the relation you refer to tell us that $$\begin{align*}\mathcal{L}\left\{4\mathcal{U}(t-\pi)\cos t\right\}&=4\mathcal{L}\left\{(1-\mathcal{U}(\pi-t)\cos t\right\}\\[1ex] &=4\mathcal{L}\{\cos t\}-\mathcal{L}\left\{4\,\mathcal{U}(\pi-t)\cos t\right\}\\[1ex] \mathcal{L}\left\{4\,\mathcal{U}(\pi-t)\cos t\right\}&=\frac{4s}{s^2+1}-e^{-\pi s}\mathcal{L}\left\{4\cos(t+\pi)\right\}\\[1ex] &=\frac{4s}{s^2+1}+4e^{-\pi s}\mathcal{L}\left\{\cos t\right\}\\[1ex] &=\frac{4(s+se^{-\pi s})}{1+s^2} \end{align*}$$