# Area under the graph of the function

If I'm not crazy, area under the graph of the function $f$ between $x=a$ and $x=b$ is given by formula: $\displaystyle \int_a^b|f(x)|\mbox{d}x$. But I tried to count it for every polynomial and I got the wrong result. Is it difficult? My approach was that:

Let $f$ be any polynomial and $F'=f$. By integration by parts: $$\int_a^b |f(x)|\mbox{d}x=\int_a^b f(x)\cdot \mbox{sgn}(f(x))\mbox{d}x= \\=F(x)\cdot\mbox{sgn}(f(x))\Big|_a^b - \int_a^b F(x)\cdot \mbox{sgn}'(f(x)) \mbox{d}x= F(x)\cdot\mbox{sgn}(f(x))\Big|_a^b$$ because $\mbox{sgn}'(x)=0$ for all $x\in \mathbb{R}$.

But let $f(x)=x^2-5x+4$ and $a=0, \ b=5$, then $\int_a^b|f(x)|\mbox{d}x=\frac{49}{6}$ by WolframAlpha and with my method $F(x)\cdot\mbox{sgn}(f(x))\Big|_a^b=-\frac{5}{6}$.

sgn is not even continuous, even less differetntiable at $x=0$ – Hagen von Eitzen Sep 19 '12 at 15:04
I like this question. To the OP : note that substitution might also fail because $f(x)$ might not be one-to-one where it needs to be for the substitution. – mick Sep 19 '12 at 15:10
Now I understand, thank you. So, is it possible to deduce some nice formula for $\int_a^b |f(x)|\mbox{d}x$ as I was trying? Or to count it I have to count all definite integrals separately with adequate signs? – xan Sep 19 '12 at 15:28
You should split the interval according to the sign of $f$. – Siminore Sep 19 '12 at 16:31