Need help to understand the integral rules used solving the convolution of two functions

I am teaching myself how convolution works, there's a question which looks like this - find the convolution of the following two functions $$f$$ and $$g$$. I understand the problem intuitively that the resulting function should be essentially the product of $$f$$ sweeping over $$g$$, and since the functions are quite simple, I can find key points like when $$x = 0, 1, 2, 3$$ and interpolate the graph of the resulting function easily.

While reading through the "solution" of this problem in my textbook, for the intersection of $$0 \le x \lt 1$$, the author wrote this: for $$0\leq x<1$$, $$\int_{-\infty}^{\infty} g(t)\cdot f(x-t)dt=\int_{0}^x 2t\cdot dt=\frac{x^2}{2}\cdot 2.$$ which I'm having trouble to understand. How exactly did he replace the $$\infty$$ and $$-\infty$$ with $$0$$ and $$x$$, and how exactly did he turn the whole $$g(t) \cdot f(x-t)$$ into $$2t$$?

Hint. Note that $$f(x-t)=2$$ when $$0\leq x-t\leq 1$$, i.e. $$x-1\leq t\leq x$$, otherwise it is zero. Hence $$\int_{-\infty}^{\infty} g(t)f(x-t)dt=\int_{x-1}^x g(t)2 dt.$$ Now if $$x\in[0,1)$$ then what is $$g(t)$$ for $$t\in [x-1,0]$$? And for $$t\in [0,x]$$?

• So let me think out loud - if $x \in [0,1)$ then $g(t) = t$ for the positive part $t \in [0,x)$, but $0$ for the negative part $t \in [x-1, 0)$, and we can write that in two parts because $0$ must be inside $[x-1, x]$. So it makes sense to break $\int_{x-1}^{x} g(t) 2dt$ into two parts - $\int_{x-1}^{0} g(t) 2dt$ and $\int_{0}^{x} g(t) 2dt$, where the first part is simply $0$, no matter what $x$ we choose. Hence our original integral is now $\int_{0}^{x} g(t) 2dt$ which is actually $\int_{0}^{x} t\cdot 2dt$ due to $g(t) = t$ for the positive part. Is my reasoning correct? :D – maranic Sep 8 at 13:13
• @maranic It's perfect! – Robert Z Sep 8 at 13:15
• It was quite tough to wrap my head around this, because we are dealing with 2 variables here. :D – maranic Sep 8 at 13:22

Observe that integrand $$g(t)f(x-t)$$ (where $$x$$ is fixed and $$t$$ is ranging over $$\mathbb R$$) takes value $$0$$ for every $$t\notin[0,x]$$.

This justifies to replace $$\int_{-\infty}^{\infty}\cdots$$ by $$\int_0^x\cdots$$.

Further for any fixed $$x\in[0,1)$$ it is true that $$g(t)f(x-t)=t2$$ on interval $$[0,x]$$.

I'm assuming

$$f(x)=\begin{cases} 2 & x\in [0,1] \\ 0 & else \end{cases}$$

And

$$g(x)=\begin{cases} x & x\in [0,1] \\ 2-x & x\in [1,2)\\ 1 & x\in [2,3] \\0 & else \end{cases}$$

Adding this together, we see $$\int_{-\infty}^{\infty} g(t)f(x-t)\textrm{d}t=2\int_{1-x}^x g(t)\textrm{d}t,$$ since for these values of $$t,$$ $$f(x-t)=2$$ and for all other values of $$t$$, $$f(x-t)$$ is $$0$$.

Now, $$g(t)=0$$ for $$t\leq 0$$ so $$2\int_{1-x}^x g(t)\textrm{d}t=2\int_0^x g(t)\textrm{d}t=2\int_0^x t\textrm{d}t,$$ simply by plugging into the definition of $$g$$.

• You're correct. – WoolierThanThou Sep 8 at 12:34