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?

  • $\begingroup$ 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. $\endgroup$
    – aleden
    Commented Dec 5, 2017 at 2:29

2 Answers 2


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{.} $$

  • 3
    $\begingroup$ 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. $\endgroup$
    – Confounded
    Commented Jul 2, 2021 at 8:28
  • $\begingroup$ @Confounded : Your comment does not address improving the Answer to this Question, so is improperly posed. However, you are using a site for asking and answering questions about math, so perhaps you should pose your Question. $\endgroup$ Commented Jul 2, 2021 at 16:24

There are a couple ways you could approach this that come to mind.

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.

For the first two integrals, you could also look at the graphs and calculate the area underneath them using simple geometry, but the first method is a little more rigorous and, judging by the answer and comment that have appeared while I've been typing this answer, the more popular way to go.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .