Convolution of a function with itself

Simply apply the definition. So $$\phi * \phi (x) = \int_{-\infty}^{+\infty} \phi(x-y)\phi(y) \ dy$$ The integrand is $\neq 0$ only in the case that $y, x-y \in [0,1]$, i.e. $$0 \leq y \leq 1$$ $$x-1 \leq y \leq x$$

In the case that $x \leq 0$ or $x \geq 2$, the integrand must be $0$, so $\phi * \phi (x) = 0$.

In the case that $0 \leq x \leq 1$ you have

$$\phi * \phi (x) = \int_{0}^{x} \ dy = x$$

In the case that $1 \leq x \leq 2$ you have

$$\phi * \phi (x) = \int_{x-1}^{1} \ dy = 2-x$$

So

$$\phi * \phi (x) = \begin{cases} x & \text{ if } 0 \leq x \leq 1\\ 2-x & \text{ if } 1 \leq x \leq 2\\ 0 & \text{ otherwise} \end{cases} $$


I feel hopeless for midterm tomorrow, so I just added my answer to the question of "Future Professor:" $$\phi(x) = \begin{cases} 1 & \text{ if } 0 \leq x \leq 1\\0 & \text{otherwise} \end{cases} $$ The answer of this convolution should be: $$\phi_{[0,1]}*\phi_{[0,1]}(x) = \begin{cases} 0 & x\leq 0\\x & 0 \leq x \leq 1 \\ 2-x & 1 \leq x \leq 2 \\0 & x\geq 2 \end{cases}$$ To see why, we write convolution in the form: $$\phi_{[0,1]}*\phi_{[0,1]}(x) = \int_{\mathbb{R}} \phi_{[0,1]}*\phi_{[0,1]}(x-y)dy = \int_{0}^{1}\phi_{[0,1]}(x-y)dy$$ This is the definition of Convolution, you should know it by now "sir"

For $x \leq 0,\; y \in [0,1]$, we have $\phi_{[0,1]}(x-y) = 0$, so the integral equals 0.

For $x,y \in[0,1]$, we have $\phi_{[0,1]}(x-y) = 1$ when $0 \leq y \leq x$, so the integral equals x.

For $x \in [1,2], y \in [0,1]$, we have $\phi_{[0,1]}(x-y) = 1$ when $x-1 \leq y \leq 1$, so the integral equals $2-x$.

For $x \geq 2$, $y \in [0,1]$, we have $\phi_{[0,1]}(x-y) = 0$, so the integral equals 0.

P/S: This answer is from a suffered and desperate Applied Math student in Haunted Building.