# Calculate the convolution of two functions

I've been given a problem, to calculate the convolution of the functions $h$ and $x$ where:

$$h(t) = \begin{cases}t &\text{if 0<t<2T}\\ 0& \text{otherwise}\end{cases}$$ $$x(t) = \begin{cases} 1 & \text{if 0<t<T}\\ 0 &\text{otherwise.}\end{cases}$$ ($T$ is a parameter).

How can I do that? A detailed explanation/solution is preferred. Thanks!

• Have you tried applying the definition of convolution? – Rahul Aug 7 '16 at 20:18
• The convolution $h*x$ of $h$ and $x$ is defined by $(h*x)(t)=\int_{-\infty}^\infty h(z)x(t-z)dz$. (It is commuative, and so also equal to $(x*h)(t)=\int_{-\infty}^\infty h(t-z)x(z)dz$.) – smcc Aug 7 '16 at 20:40
• In order to compute $f:=h*x$, you can derivate it using the expression $f'=h'*x$, but beware $h'$ is the characteristic function of interval [0,2a] plus 2T times a Dirac in t=2T. Then, once the convolution has been done, you integrate the result. – Jean Marie Aug 7 '16 at 22:10
• I tried to use the definition of convolution but I have no Idea how to substitute both of the functions in the equation. Could someone post an answer? – Sagiftw Aug 8 '16 at 5:55

The computation of this convolution $g:=x*h$ is quite tedious since both $x$ and $h$ are defined piecewise. Formally $g$ is defined by $$g(t):=\int_{-\infty}^\infty x(t-\tau)h(\tau)\>d\tau\qquad(-\infty<t<\infty)\ .$$ Now $x(t-\tau)\ne0$ (in fact $=1$) only if $0<t-\tau<T$, or $t-T<\tau<t$. It follows that we may write $$g(t)=\int_{t-T}^t h(\tau)\>d\tau\qquad(-\infty<t<\infty)\ .$$ We now have to distinguish cases according to how the interval of integration $[t-T, t]$ intersects the interval $[0,2T]$ where $h$ has an "interesting definition". From a figure we deduce that we have to distinguish the following five cases: \eqalign{g(t)&=\int_{t-T}^t 0\>d\tau=0\qquad(t<0)\ ,\cr g(t)&=\int_{0}^t \tau\>d\tau=\ldots\qquad(0<t<T)\ ,\cr g(t)&=\int_{t-T}^t \tau\>d\tau=\ldots\qquad(T<t<2T)\ ,\cr g(t)&=\int_{t-T}^{2T} \tau\>d\tau=\ldots\qquad(2T<t<3T)\ ,\cr g(t)&=\int_{t-T}^t 0\>d\tau=0\qquad(t>3T)\ .\cr} I leave it to you to compute the three nonzero integrals. In the end you should obtain a function $t\mapsto g(t)$ which is continuous on all of ${\mathbb R}$.