The indefinite integral of $|f(x)|$

calculusindefinite-integralsintegration

Let $x \in \mathbb{R}$. Suppose that the indefinite integral of $f(x)$ is $F(x)$, where $f$ is a "nice" function (something like $x^2+x+1$ or $\sin(x)$ or $\cos(x)$)

My question is,

what is the indefinite integral of

$$|f(x)|$$


I know for that $|x|$, the indefinite integral evaluates to

$$\dfrac{x|x|}{2}$$
or $$\dfrac{x^2\text{sgn}(x)}{2}$$


So I wonder if the integral of $|f(x)|$ evalutes to $F(x) \text{sgn}(f(x))$.

Best Answer

It equals $$ F(x)sgn(f(x)) + c_k$$ Every time $f(x)$ changes sign, you need a new constant $c_k$ to make up for the jump in $F(x)sgn(f(x))$, so that the whole integral remains continuous. For example, if $f(x)=2x-1$, then $F(x)=x-x^2+c$ when $x<1/2$, but $x^2-x+c+1/2$ when $x\geq1/2$.

Related Question