Laplace transform of the following function find the laplace transform of the function :
$$f(t) =\begin{cases}
t^2,  & 0<t<1 \\
2\cos t+2, & t>1  \\
\end{cases}$$
My attempt:
$$L\{f(t)\}=\int_{0}^{1}e^{-st} \ t^2 \ \text{d}t+\int_{1}^{\infty}e^{-st} \ (2\cos t+2) \ \text{d}t$$
Now,
$$\int_{0}^{1}e^{-st} \ t^2 \ \text{d}t=\frac{-1}{s}e^{-s}-\frac{2}{s}te^{-s}-\frac{2}{s^3}e^{-s}+\frac{2}{s^3}$$
And
$$\int_{1}^{\infty}e^{-st} \ (2\cos t+2) \ \text{d}t$$
But the integration is not stopping.

$$\begin{align} \int_1^{\infty} dt \, e^{-s t} \cos{t} &= \Re{\left [\int_1^{\infty} dt \, e^{-(s-i) t} \right ]}\\ &= \Re{\left [\frac{e^{-(s-i)}}{s-i} \right ]}\\ &= e^{-s} \Re{\left [(\cos{1}+i \sin{1}) \frac{s+i}{s^2+1}\right ]} \\ &= \frac{s \cos{1}-\sin{1}}{s^2+1} e^{-s} \end{align}$$
$$ \int_1^{\infty} dt \, e^{-s t} = \frac{e^{-s}}{s}$$
Multiply by $2$, add, done.
