Integral of f(|x|)

401 Views Asked by At

How would you calculate the definite integral of $f(|x|)$?

In my case, $f(x)=x^2-x-2$, and when I tried to calculate the integral of $\int_{-3}^3{f(|x|)}dx$ using $2\cdot(\int_{2}^3{f(x)}dx -\int_{0}^2{f(x)}dx)$, I got the incorrect answer.

The correct way shown was $2\cdot\int_{0}^3{f(x)}dx$. I thought that this would cause a miscalculation as the negative area wasn't taken into account.

Can someone also explain why the actual answer is negative? I was under the impression that all definite integrals are positive.

1

There are 1 best solutions below

0
On

I'm OP answering as I have found a solution.

I was getting confused between the area under the curve (where you would have to subtract negative values of $f(x)$ in order to find the total area) and the definite integral.

In fact, the area under the curve from $x=a$ to $x=b$ is defined as $\int_{a}^b{|f(x)|}dx$ and is only positive values, as the modulus function restricts $f(x)$ to $f(x)\geq0$. I was under the assumption that $\int_{a}^b{f(x)} dx = \int_{a}^b{|f(x)|}dx$. On the other hand, the definite integral of a function simply 'tallies' the distances from $f(x)$ to the x-axis, and can take positive and negative values. Therefore, $\int_{a}^b{f(x)}dx$ CAN be negative, contrary to what I thought.

Thus, $\int_{a}^b{f(|x|)}dx$ where $a<0$ and $b>0$ is equal to $\int_{0}^{|a|}{f(x)}dx + \int_{0}^b{f(x)}dx$, and when $a=-b$, the integral is equal to $2\cdot\int_{0}^b{f(x)}dx$.

Thanks for the comments everyone.