# Calculating integrals of area between two functions, involving absolute values

1. Jan 3, 2009

### Ulagatin

Hi all,

I'm currently preparing for pre-tertiary mathematics, studying from Apostol's "One-Variable Calculus". I have just begun to work on the theory of integration of trigonometric functions, but I found that with the last set of exercises (on finding area between two functions, over some interval) I wasn't able to complete them (the issue was with absolute value functions).

Any assistance would be greatly appreciated.

1. The problem statement, all variables and given/known data

Take one, for example, with these functions (over the interval [-1, 1]):

$$f(x) = |x|$$
$$g(x) = x^2-1$$

I recognise that over this interval, $$f(x) > g(x) for all x$$, so the answer should be equal to the integral of the difference f(x) - g(x) with respect to x over the previously said interval.

How do I tackle this from here? My graphics calculator software tells me the area is equal to 2.33..., but I'm not sure how to arrive at this value.

2. Relevant equations

$$\int_{a}^{b} [f(x) - g(x)] dx$$

3. The attempt at a solution

To show that I can work these integrals, I first show another example which may assist to solve the original example.

$$f(x) = x(x^2 - 1)$$
$$g(x) = x$$

The interval we must evaluate this integral on is as follows: $$[-1, 2^{1/2}]$$.

Over the interval [0, 1], f(x) > g(x). Over the interval $$[0, 2^{1/2}]$$, g(x) > f(x).

So to formalise this now, we have the following:

$$\int_{-1}^{0} [x(x^2 - 1) - x] dx + \int_{0}^{2^{1/2}} [(x - x^3 - x)] dx$$

$$= -\int_{0}^{-1} [x^3 - x - x] dx + \int_{0}^{2^{1/2}} [-x^3 + 2x] dx$$
$$= -\int_{0}^{-1} [x^3 - 2x] dx + \int_{0}^{2^{1/2}} [-x^3 + 2x] dx$$
$$= -\left[ \frac{x^4}{4} - {x^2} \right]_{0}^{-1} + \int_{0}^{2^{1/2}} [-x^3 + 2x] dx$$
$$= [-\frac{-1^4}{4} + -1^2] + \int_{0}^{2^{1/2}} [-x^3 + 2x] dx$$
$$= [-\frac{1}{4} + 1] + \int_{0}^{2^{1/2}} [-x^3 + 2x] dx$$
$$= \frac{3}{4} + \int_{0}^{2^{1/2}} [-x^3 + 2x] dx$$
$$= \frac{3}{4} + \left[ \frac{-x^4}{4} + {x^2} \right]_{0}^{2^{1/2}}$$
$$= \frac{3}{4} + [-\frac {(2^{1/2})^4}{4} + (2^{1/2})^2] = \frac{3}{4} +[-\frac {4}{4} + 2]$$
$$= \frac{3}{4} - 1 + 2 = \frac{3}{4} + 1$$
$$= \frac{3+4}{4} = \frac{7}{4} = 1.75.$$

Now, I believe that, perhaps with the absolute value example, you can substitute values in, similarly to this example I've worked. First, I note that both these functions are monotonically decreasing over the interval [-1, 0] and increasing over [0, 1].

So, I'll try:

$$\int_{-1}^{0} [f(x) - g(x)] dx + \int_{0}^{1} [f(x) - g(x)] dx$$
$$= -\int_{0}^{-1} [|x| - (x^2 - 1)] dx + \int_{0}^{1} [|x| - (x^2 - 1)] dx$$
$$= \left[ \frac{|x^2|}{2} - (\frac{x^3}{3} - x) \right]_{0}^{-1} + \left[ \frac{|x^2|}{2} - (\frac{x^3}{3} - x) \right]_{0}^{1}$$
$$= 0 - [\frac{1}{2} - (\frac{-1^3}{3} +1)] + [\frac{1}{2} - (\frac{1}{3} - 1)]$$
$$= [-\frac{1}{2} + (-\frac{1^3}{3} + 1)] + [\frac{1}{2} - \frac{1}{3} + 1]$$
$$= - \frac{1}{2} - \frac{1}{3} + 1 + \frac{1}{2} - \frac{1}{3} + 1 = \frac{4}{3}$$

Clearly, I'm out by 1. Where have I gone wrong? Any assistance would be simply grand. I tried with the first integral being positive, but I ended with the same result mysteriously enough. I just don't understand!

Cheers,
Davin

2. Jan 3, 2009

### happyg1

Hey,
You have to drop your absolute value bars on the second line of your solution up there. The equation of the line from -1 to 0 is -x and from 0 to 1 it's just x...that changes the sign on your 1/2 aand gets you what you know is correct.
CC

3. Jan 3, 2009

### Gregg

g(x) and f(x) both have symmetry on the y-axis. You can do it like:

$$2\int_{0}^{1} - x^2 + x - 1 \delta x = 2\left[1 \frac{1}{6} \right]$$ which is 2.33

$$\int_{-1}^{1} |x| - (x^2 - 1) \delta x = \left[\frac{|x^2|}{2} - \frac{x^3}{3} + x\right]_{-1}^{1}$$

$$= \left[ \frac{1}{2} - \frac{1}{3} + 1\right] - \left[ -\frac{1}{2} + \frac{1}{3} - 1\right] = 2\frac{1}{3}$$

I think that's right.

Last edited: Jan 3, 2009
4. Jan 3, 2009

### Ulagatin

Absolute Value integrals??

Thank you very much, guys. Nice to hear that you can solve integrals by looking for symmetry! This I wasn't aware of.

Gregg, I tried your first integral and I didn't get the same answer as you. Your second integral I understand perfectly though.

Looking closer, it seems you wrote the first integral out incorrectly. I believe it should be this:

$$2 \int_{0}^{1} |x| - (x^2 - 1) \delta x = 2\left[\frac{|x^2|}{2} - \frac{x^3}{3} + x\right]_{0}^{1}$$
$$= 2\left[\frac{1}{2} - \frac{1}{3} + 1\right]$$
$$= 2\left[1 \frac{1}{6} \right] = 2\frac{1}{3}$$

I truly do appreciate your assistance. This ability to solve using symmetry is quite remarkable, but I suppose it really isn't much of a surprise: symmetry is useful in so many areas in mathematics!

Cheers,
Davin

5. Jan 3, 2009

### Gregg

Re: Absolute Value integrals??

Now I look at it, it can be solved even easier than that. Take the function y = |x|. You know that the area underneath it between -1 and 1 will be 1.

Take the area under the x-axis for $$x^2 - 1 = (x+1)(x-1)$$ gives

$$\int_{-1}^{1} x^2 - 1 \delta x = \left[ \frac{x^3}{3} - x \right]_{-1}^{1}$$

$$\int_{-1}^{1} x^2 - 1 \delta x = \left[ \frac{1^3}{3} - 1 \right]-\left[ \frac{-1^3}{3} + 1 \right]$$

$$\int_{-1}^{1} x^2 - 1 \delta x = \left[ -\frac{2}{3} \right] - \left[ \frac{2}{3} \right] = - \frac{4}{3}$$

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

The reason I find this interesting is because you first answers are out by 1 square unit.

I think for this reason it safest in this situation to use the method above.

The blue curve is $$|x| - (x^2-1)$$ and the red curve is $$x - (x^2-1)$$ (they overlap).
Because x is modulus it has a vertex with the x component of $$\pm \frac{1}{2}$$.

I also find that
$$\int_{-1}^{1} -x^2+x+1 \delta x = \frac{4}{3}$$

I believe this is the reason your answers were out by 1 square unit. The modulus of x was not correctly integrated. But honestly I don't know.

Last edited: Jan 4, 2009
6. Jan 3, 2009

### Ulagatin

Thanks again, Gregg. I personally feel that this case of looking for symmetries is simpler. Then it's a more intuitive approach. But thanks for elaborating further on these ideas.

Cheers,
Davin