Consider the following function: $$f(x)=\begin{cases} 7-x, &\: 0 \leqslant x \leqslant 7 \\ x-7, &\: 7 \lt x \leqslant 14 \end{cases}.$$ Find the exact value of $\int_0^{14}f(x)\,\mathrm dx$.
I answered 0 because I separated them into two integrals, and I got in both of the integrals 24.5. Therefore, i subtracted them and the answer was 0.
What's the right way to answer this question ?