For the life of me, I haven't been able to grasp convolution for functions with multiple pieces. For example,
$$ h(\lambda) = \left\{ \begin{array}{l l} 2 & \quad \ 0\leq \lambda < 1\\ -1 & \quad \ 1\leq \lambda \leq2 \end{array} \right.$$ $$ f(\lambda) = \left\{ \begin{array}{} 2 & \quad \ 0\leq \lambda < 1\\ 3 & \quad \ 1\leq \lambda < 2 \\ 1 & \quad \ 2 \leq \lambda \leq 3 \end{array} \right.$$
I know that I have to fold one the functions and shift it. So we take $h(t-\lambda)$.
- For $0<t<1$, we have $$\int_0^t(2)(2) d\lambda = 4t$$ we get one integral because this is the only overlap and we take from 0 to t, because that is the region they overlap for $0<t<1$.
- For $1<t<2$, we have $$\int_{0}^{t-1}(-1)(2)+\int_{t-1}^{1}(2)(2)+\int_1^t(2)(3)=4$$ Now for $2<t<3$ I have, $$\int_{t-1}^{2}(-1)(3) + \int_2^t (2)(1)$$ And there is $3<t<4$, I have $$\int_t^3(-1)(1) = -3+t$$
However, I am not sure of my attempt and I would really appreciate it if someone could explain how to convolve such functions and how to handle the integration limits because they are the most confusing. Do we always start from 0?