Areas between curves

We know how to calculate the area between a curve and the horizontal (x) axis of a graph. We have learnt a number of very sophisticated techniques which allow us to get an analytic answer.

It is a fairly simple extension to study not the area between a curve and the horizontal axis, but between two curves. You can see here the link between the two:

betweencurves

We can see in the figure below how we can approximate the area by a sum of rectangles. In this case we have used the left point approximation. Each rectangle here has \Delta x=0.02 and the heights are f(x_i)-g(x_i) where the x_i are the left points of each rectangle, in this case =0.02(i-1). So x_1=0, x_2=0.02, etc.

RS

We started off studying integration by taking the limit of a Riemann sum. We can do exactly the same thing here, taking the simplest possible Riemann sum, with rectangular regions which stretch between the two curves (see the diagrams on page 448 in Stewart) and then taking the limit to find an expression in terms of integrals. You will not be surprised by the final answer.
If we have two functions f(x) and g(x) where, in some region x\in [a,b] f(x)\ge g(x), we can write the area between them as the Riemann sum:

 

\text{Area between curves f(x) and g(x)}\approx\sum_{i=1}^n\Delta x\left(f(x_i^\star)-g(x_i^\star)\right)

 

where x_i^\star are the positions in the rectangles that go into making up the area. This can be chosen as the left point, right point or mid-point, or any other carefully chosen point.

Taking the limit of this sum gives a difference in integrals, or alternatively, the integral of the difference in the values of the functions:

 

A=\int_a^b\left[f(x)-g(x)\right]dx

 

This is clearly the same as the area under f(x) minus the area under g(x) because

 

\int_a^b f(x)-g(x)dx=\int_a^b f(x)dx-\int_a^b g(x) dx.

 

Sometimes you will be asked to find the enclosed area between two curves. This means that you need not just to find the integral, but also to find the upper and lower limits of the integral (a and b in the notation \int_a^bf(x)dx). The limits will be given by the intersection points of the curves. Here is a simple example:

Find the area between the curves f(x)=-x^2+6 and g(x)=x^2+3. First of all we need to find the intersection points. These two curves intersect when:

 

-x^2+6=x^2+3

 

The solutions of this equation are x=\pm\sqrt{\frac{3}{2}}, so what we have to calculate is the area shown in:

updown

The intersection points of the two functions are given by x=\pm\sqrt{\frac{3}{2}}

The area between the two curves is thus:

 

A=\int_{-\sqrt{\frac{3}{2}}}^{\sqrt{\frac{3}{2}}}\left(-x^2+6\right)-\left(x^2+3\right)dx

 

=\int_{-\sqrt{\frac{3}{2}}}^{\sqrt{\frac{3}{2}}}\left(-2x^2+3\right)dx=\left.-\frac{2}{3}x^3+3x\right|_{-\sqrt{\frac{3}{2}}}^{\sqrt{\frac{3}{2}}}

 

We can evaluate this and it gives A=2\sqrt{6}. Note that if you are doing everything correctly, then the area between the curves should always be positive. A negative definite integral makes sense, but a negative area between two curves does not.

Here is an example where you have to find the area between two curves and you are given the region of integration. The curves f(x)=x and g(x)=-x^2-3 do not intersect, but we can still ask what the area between them in the region between, let’s say -4 and 3 is. This is shown here:

nonint

These two curves never intersect but we can ask for the area between them in the range -4 to 3. Think of this as having four curves. The two functions, and two lines which go vertically along the line x=-4 and x=3. There is an area enclosed between these four lines.

The area is simply:

 

\int_{-4}^3 \left(x-\left(-x^2-3\right)\right) dx=\left.\frac{x^2}{2}+\frac{x^3}{3}+3x\right|_{-4}^3=\frac{287}{6}

 

Sometimes you won’t know exactly the intersection points, but you can calculate them using Newton’s method.

What is the area between the curves: f(x)=\sin x and g(x)=x^2-2? First we have to find the intersection points, and this is done using Newton’s method. The answer is that they intersect at x\approx -1.06 and x\approx 1.73. This is shown here:

sinsquare

In order to use Newton’s method in this context we have to write down the equation for which we want to find the zeros. We know that the intersection points are at f(x)=g(x) and thus \sin x=x^2-2. We can write this as: \sin x-x^2+2=0. We thus want to find the zeros of p(x)=\sin x-x^2+2. First sketch this. In fact it looks like:

px

The intersection points of f(x) and g(x) are given by the zeros of this function. There are clearly two of them.

In order to use Newton’s method we have to start with an approximate value. In this case we can start with x=-1 and we will zoom in to the left intersection point as we iterate the method. We can also use the point x=1 and we will zoom into the right point. The figure below shows the iteration procedure to get the right intersection point.

pxNewt

This shows three iterations of Newton’s method starting at x=1 (with the red line) to find the intersection point of the function p(x) with the x-axis. The same thing can be done for finding the left intersection point, but starting with the initial guess of x=-1 for Newton’s method.

Thus the area between the curves is:

 

\int_{-1.06}^{1.73}\sin(x)-(x^2-2)=\left.-\cos x-\frac{x^3}{3}+2x\right|_{-1.06}^{1.73}\approx 4.10

 

Integrating with horizontal strips
We are used to thinking always of some function being dependent on x, but we can actually write it the other way around, i.e. x=f(y). x and y are just labels and so, as long as the function is single valued, we can write a function however we want. For instance, the lines y=x-1 and x=\frac{y^2-6}{2} (which would not be single valued if we wrote the curve as y(x)) look like:

yfunc
If we want to find the area between these two lines using x coordinates we will have to do so in two steps, in y coordinates we can do it in a single integration.

If we want to perform the integral in x variables we would have to do:

 

Area=\int_{-3}^{-1}\sqrt{2x+6}-(-\sqrt{2x+6})dx+\int_{-1}^5\sqrt{2x+6}-(x-1)dx

 

Alternatively, we can perform the integral in y variables as:

 

\int_{-2}^4(y+1)-(\frac{1}{2}y^2-3)dy

 

The two will give the same answer but the latter calculation is clearly easier.

Make sure that you understand the above calculation!

Let’s look at a slightly more complicated region. If we have the curves y=\sin 2x and y=\cos x and ask for the region between the two curves in the range 0\le x\le\frac{\pi}{2} we will find that there are actually two contributions to this:

sincos

You would have to be careful to do this in two parts, as you always want to do the greater function minus the lesser function, and these two swap at the left intersection point.
Recap:

There are several situations that we have to consider:

  1. We are given two functions,f(x) and g(x) and are asked to find the area between them from a to b. If the functions do not intersect in this region then find which function is larger. If f(x)\ge g(x) in the region from x=a to x=b calculate: \int_a^b f(x)-g(x)dx. If g(x)\ge f(x) in the region then calculate \int_a^b g(x)-f(x)dx. Remember the area should always be positive, so this is a good check.
  2. We are given two functions f(x) and g(x) which intersect at two points and we are asked to integrate the area between them. First calculate the intersection points, either by solving the equations simultaneously or by using Newton’s method then perform the above integral, making sure that we come out with a positive answer.
  3. We are given two functions f(x) and g(x) where we don’t have one function greater than the other in the whole region. We have to find out which one is greater in each region and treat each region separately.
  4. We are given a function or functions which are multivalued in x. See if they are single-valued in y. If they are, then see if the problem will be easier to solve when we write the functions as f(y) and g(y) rather than as functions of x.

Important point: If you are confused as to how best to perform the integral, think first of approximating the area between the curves as a Riemann sum then convert this to an integral, or integrals by taking the limit of the Riemann sum that the number of rectangles goes to \infty.

 

How clear is this post?