# Definite integral of absolute value function?

In my math textbook I had to compute definite integral which have a absolute value function like these below:

$$\int_{-2}^{3} |x| dx$$

$$\int_{-2}^{3} |x-1| dx$$

$$\int_{-2\pi}^{2\pi} |sin x| dx$$

Should I use additive integration rule to compute them? Or should I assume that absolute value is always positive? Or both? Any suggestion?

• I would split the integrals into the definite integrals over the positive and negative parts and then use the definition of absolute value to compute them. Also note that the last integrand is even so it is not even necessary to do so. Dec 5, 2017 at 2:29

You should use the fact that $|x|$ is one linear function for $x \in (-\infty, 0]$ and a different linear function for $x \in [0,\infty)$ to break the interval of integration into subintervals that are easier. For instance, $$\int_{-2}^{3} \; |x| \,\mathrm{d}x = \int_{-2}^{0} \; -x \,\mathrm{d}x + \int_{0}^{3} \; x \,\mathrm{d}x \text{.}$$
• This method of integrating $|f(x)|$ seems to reply on knowing or being able to find the zeros of the function, but what do we do when we can't find such zero? For example, if $f(x)$ is a 5th degree polynomial with coefficients only given as parameters, i.e. $\int_a^b \sum_{k=0}^5 c_k x^k$. Thank you. Jul 2, 2021 at 8:28
One is to split each integral into multiple, smaller integrals, such as $$\int_{-2}^{0} -x\, dx \quad \text{and}\quad\int_{0}^{3} x\, dx$$ for your first integral. That should make them pretty simple to evaluate.