In one of the questions that I'm solving, I have got an integral like this $$k(w) = \int_{w-1}^{w}f(x)dx$$ where the function $f(x)$ is defined in this way $$f(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}$$
The support of $w$ is $[0,3]$. I know that the final solution will be a piecewise function like this $$k(w)= \begin{cases} g_1(w),& \text{if } 0\leq w \leq 1\\ g_2(w),& \text{if } 1\leq w \leq 2\\ g_3(w),& \text{if } 2\leq w \leq 3\\ 0, & \text{otherwise} \end{cases}$$.
Give me some idea about solving this type of integrals.
Note: This integral is an intermediate step in the proof of three variables Irwine Hall distribution. Check the first answer for this post here