[tex]\mathcal L\{f(t)\}=\displaystyle\int_{t=0}^{t\to\infty}f(t)e^{-st}\,\mathrm dt[/tex]
Given that
[tex]f(t)=\begin{cases}\cos t&\text{for }0\le t<\pi\\0&\text{for }t\ge\pi\end{cases}[/tex]
the Laplace transform of [tex]f(t)[/tex] is given by the definite integral
[tex]\displaystyle\int_{t=0}^{t\to\infty}f(t)e^{-st}\,\mathrm dt=\int_{t=0}^{t=\pi}\cos t\,e^{-st}\,\mathrm dt+\int_{t=\pi}^{t\to\infty}0\,\mathrm dt[/tex]
[tex]=\displaystyle\int_0^\pi\cos t\,e^{-st}\,\mathrm dt[/tex]
[tex]=\dfrac{(1-e^{-\pi s})s}{s^2+1}[/tex]
(which you can find by integrating by parts twice)