TITLE: How can the Laplace transform be used to solve piecewise functions?
QUESTION [5 upvotes]: For example, suppose we have the following two problems that we'd like to find the Laplace transform of:

$f(t) = \begin{cases}
1, & t \lt 2 \\
0, & t \geq 2
\end{cases}$
$f(t) = \begin{cases}
1-0.5t, & t \lt 2 \\
5, & t \geq 2
\end{cases}$

Is there a general method to solve these sorts of problems?  How can I approach them and make solving them more intuitive?
Thanks for the help!

REPLY [6 votes]: The definition of the Laplace transform is given as 
$F(s)= \mathcal{L} \left\{f\right\}(s)
  =\int_{0}^{\infty} \mathrm{e}^{-st} f(t)\,\mathrm{d}t, \qquad s\in\mathbb{C}.$
So if we take example 1), we get 
\begin{align*}F(s) = \mathcal{L} \left\{f\right\}(s)
  =\int_{0}^{\infty} \mathrm{e}^{-st} f(t)\,\mathrm{d}t &= 
\int_{0}^{2} \mathrm{e}^{-st} f(t)\,\mathrm{d}t+
\int_{2}^{\infty} \mathrm{e}^{-st} f(t)\,\mathrm{d}t
\\ &= \int_{0}^{2} \mathrm{e}^{-st} \cdot 1\,\mathrm{d}t+
\int_{2}^{\infty} \mathrm{e}^{-st} \cdot 0\,\mathrm{d}t
\\ &=\int_{0}^{2} \mathrm{e}^{-st} \,\mathrm{d}t
\\ &= \Bigl[-\frac{1}{s} e^{-st} \Bigr]_0^ 2 = -\frac{1}{s} e^{-2s} +\frac{1}{s}
\end{align*}
So the general approach is to split the integral at that points, at which $f$ changes.

REPLY [3 votes]: Here is the first one
$$ \int_{0}^{\infty}f(t)e^{-st}dt = \int_{0}^{2}1.e^{-st}dt+ \int_{2}^{\infty}0.e^{-st}dt $$
You can do the other function with the same technique.