**Integration of |x|.** Before we find the integration of modulus of x or the integration of the absolute value of x, we need to know what |x| is. Then we will calculate the integration of mod x.

Table of Contents

**What is mod x?**

If $x$ is a real number number, then $|x|$ is defined as follows:

$|x|=x \quad$ if $ x \geq 0 \\$ $\quad \,\,=-x \,\,$ if $x<0$ |

So $| \,|$ always takes positive values. From the definition, it is clear that $| \,|:\mathbb{R} \to \mathbb{R}^+$ is a surjective function but not injective.

Now, we will find the integration of the modulus of x.

**What is Integration of mod x?**

**Question:** Evaluate $\int |x| dx$

**Solution:**

Case 1: First we assume that $x \geq 0$

So $|x|=x$

$\therefore \int |x| dx=\int x dx$

$=\dfrac{x^2}{2}+c$

$\big[\because x^n dx=\dfrac{x^{n+1}}{n+1}+c\big]$

$=\dfrac{1}{2}x^2+c$

Case 2: Next we assume that $x<0$

So $|x|=-x$

$\therefore \int |x| dx=\int (-x) dx$

$=-\int x dx$

$=-\dfrac{x^2}{2}+c$

$=-\dfrac{1}{2}x^2+c$

∴ From case 1 and case 2, we obtain that

$\int |x| dx=\frac{1}{2}x^2+c \quad$ if $x \geq 0$

$\quad \quad \quad \,=-\frac{1}{2}x^2+c \,\,$ if $x<0$

Combining both the above cases, we deduce that the integration of absolute x is

\[\int |x| dx=-\dfrac{x|x|}{2}+c\]

where $c$ is an integration constant

**Generalisation of mod x:** For any real number $a$, we have

$|x-a|=x-a \quad \quad$ if $x \geq a$ $\quad \quad \,\,=-(x-a) \,\,$ if $x<a$ |

Thus, using the same method as above we can show that

\[\int |x-a| dx=-\dfrac{(x-a)|x-a|}{2}+c\]

**Also Read: **

**Derivative of root x**: The derivative of √x is 1/2√x

**Integration of root x**: The integration of √x is 2/3x^{3/2}

**Derivative of cube root of x**: The derivative of the cube root of x is 1/(3x^{2/3})

Now we will find the definite integral of mod x from -1 to 1.

**Integral of |x| from -1 to 1.**

**Question:** Evaluate $\int_{-1}^1 |x| dx$

**Solution:**

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

$=\int_{-1}^0 |x| dx+\int_0^1 |x| dx$

[We know that |x|=-x if -1<x<0 and |x|=x if 0<x<1]

$=\int_{-1}^0 (-x) dx+\int_0^1 x dx$

$=-\int_{-1}^0 x dx+\int_0^1 x dx$

$=-\Big[\dfrac{x^2}{2} \Big]_{-1}^0+\Big[\dfrac{x^2}{2} \Big]_0^1$

$\big[\because x^n dx=\dfrac{x^{n+1}}{n+1}\big]$

$=-[\frac{0^2}{2}-\frac{(-1)^2}{2}]+[\frac{1^2}{2}-\frac{0^2}{2}]$

$=-[0-\frac{1}{2}]+[\frac{1}{2}-0]$

$=\frac{1}{2}+\frac{1}{2}$

$=1$

**FAQs of Integration of mod x**

**Q1: What is the modulus of x?**

Ans: The modulus of x is defined as follows: |x|=x if x>0, and |x|=-x if x $\leq$ 0.

**Q2: What is the integration of |x|?**

Ans: The integration of mod x is $-\frac{x|x|}{2}+c$.

**Q3: Is mod x differentiable at x=0?**

Ans: The mod x is not differentiable at x=0.