Laplace transform with the Heaviside unit step function I want to find the laplace transform for the function:
$$f(t) = \left\{\begin{array}tt,\quad t\lt 2 \\ t^2 , \quad t\geq 2 \end{array} \right.$$
So I thought that the proper setup was:
$$\mathcal{L}(f(t)) = t - (t)u(t-2) + (t^2)u(t-2)$$
$$\mathcal{F}(s) = \frac{1}{s^2}- \frac{e^{-2s}}{s^2}  +\frac{2e^{-2s}}{s^3}$$
$$= \frac{s-se^{-2s} + 2e^{-2s}}{s^3}$$
But it would seem I don't know how to setup the heaviside unit step function properly.
Why is the above wrong?
 A: You don't need to use the language of the Heaviside function.  Just compute the integral directly:
$$\int_0^{\infty} dt \, f(t) e^{-s t} = \int_0^2 dt\, t\, e^{-s t} + \int_2^{\infty} dt \, t^2\, e^{-s t} $$
The first integral may be evaluated easily by differentiating a simpler integral with respect to $s$:
$$\int_0^2 dt\, t\, e^{-s t} = -\frac{d}{ds} \int_0^2 dt\, e^{-s t} = -\frac{d}{ds} \frac{1-e^{-2 s}}{s} = \frac{1-e^{-2 s}}{s^2} - 2 \frac{e^{-2 s}}{s}$$
We can use a similar trick for the other integral:
$$\begin{align}\int_2^{\infty} dt \, t^2\, e^{-s t} &= \frac{d^2}{ds^2} \int_2^{\infty} dt \, e^{-s t}\\ &= \frac{d^2}{ds^2}\frac{e^{-2 s}}{s}\\ &= \frac{d}{ds} \left (-2 \frac{e^{-2 s}}{s} - \frac{e^{-2 s}}{s^2} \right ) \\ &= -2 \left (-2 \frac{e^{-2 s}}{s} - \frac{e^{-2 s}}{s^2} \right ) - 4\frac{e^{-2 s}}{s^2} - 4 \frac{e^{-2 s}}{s^3} \\ &= \left (\frac{4}{s}-\frac{2}{s^2}-\frac{2}{s^3} \right ) e^{-2 s} \end{align}$$
The LT is then the sum of the two integrals:
$$F(s) = \frac{1-e^{-2 s}}{s^2} + 2 \left (\frac1{s}-\frac1{s^2}-\frac1{s^3} \right ) e^{-2 s} $$
