Piecewise Laplace transformation The piecewise function is:
$$
\begin{array}{cc}
   & 
    \begin{array}{cc}
      t & 0\leq t< 1 \\
      2-t & 1\leq x\leq 2 \\
      0 & t>2
    \end{array}
\end{array}
$$
Now putting the piecewise into LaPlace form:
$$\int_0^1te^{-st}dt +2\int_1^2e^{-st}dt-\int_1^2te^{-st}dt+0$$
The first and third integral are the same integration by parts: $u=t,du=dt,dv=e^{-st},v=-\frac{1}{s}e^{-st}$. 
Then the expression becomes:
$$-\frac{t}{s}e^{-st}+\int_0^1\frac{1}{s}e^{-st}dt+2\int_1^2e^{-st}dt-\frac{t}{s}e^{-st}+\int_1^2\frac{1}{s}e^{-st}dt$$
Which after integrating and evaluating equals:
$$-\frac{1}{s}e^{-s}-\frac{1}{s^2}e^{-s}+\frac{1}{s^2}-\frac{2}{s}e^{-2s}+\frac{2}{s}e^{-s}-\frac{2}{s}e^{-s}-\frac{2}{s}e^{-2s}-\frac{1}{s^2}e^{-2s}+\frac{1}{s}e^{-s}+\frac{1}{s^2}e^{-s}$$ 
Are my calculations correct or did I mess up somewhere?
 A: I believe you've made a few small sign slips. Your starting point is correct,
$$\tilde f(s) = \int_0^1 t e^{-st} + \int_1^2 (2-t) e^{-st} \; dt$$
If we're not careful, we'll get far too many terms (like your final answer, which is difficult to figure out whether it's correct), so let's evaluate
\begin{align}
I(t) =\int t e^{-st} \; dt &= -\frac{t}{s} e^{-st} + \frac{1}{s} \int e^{-st} \; dt \\
&= -e^{-st} \left[\frac{t}{s} + \frac{1}{s^2} \right]
\end{align}
where we're dropping the constant of integration since we're only considering definite integrals in $\tilde f(s)$.
Then
\begin{align}
\tilde f(s) &= I(1) - I(0) -\frac{2}{s} \left( e^{-2s} - e^{-s} \right) - I(2) + I(1) \\
&= 2 I(1) - I(0) - I(2) - \frac{2}{s} \left( e^{-2s} - e^{-s} \right) \\
&= -2e^{-s} \left[ \frac{1}{s} + \frac{1}{s^2} \right] + \frac{1}{s^2} +e^{-2s} \left[ \frac{2}{s} + \frac{1}{s^2} \right] - \frac{2}{s} \left(e^{-2s} - e^{-s} \right) \\
&= e^{-s} \left[ -\frac{2}{s} - \frac{2}{s^2} + \frac{2}{s} \right] + \frac{1}{s^2} e^{-2s} + \frac{1}{s^2} \\
&= -\frac{2}{s^2} e^{-s} + \frac{1}{s^2} \left(e^{-2s} + 1 \right) \\
&= \frac{e^{-2s} - 2e^{-s} + 1}{s^2} = \left(\frac{1- e^{-s}}{s} \right)^2
\end{align}
A: You can also use the step function:
$$f(t)=t(u(t)-u(t-1))+(2-t) (u(t-1)-u(t-2))$$
$$f(t)=tu(t)-2(t-1)u(t-1))+(t-2)u(t-2))$$
$$f(s)=\dfrac 1 {s^2}-2\dfrac {e^{-t}}{s^2}+\dfrac {e^{-2t}}{s^2}$$
$$f(s)=\dfrac {(e^{-t}-1)^2} {s^2}$$
