Exercises

Find the area between the two curves

  1. Find the area between the curves, sin(x) and cos(x)
    two intersection points in range x=0..3*Pi/2

    Use fsolve to find the specific points of intersection for which we are interested.
    area between the curves cos(x) ans sin(x) is 2.828427125

  2. Find the area between these two curves.

    area between the curves is shaded.  There are two parts (three intersection points).

    In this case, eq1 is a 3rd degree polynomial and eq2 is a second degree polynomial. A 3rd degree polynomial may intersect a line or 2nd degree polynomial in 0, 1, 2, or 3 points.

    Use the solve command (or fsolve if necessary) to find the points of intersection.
    area between the curves is 2.828427125

    Notice that computing the area in two steps or integrating the absolute value of the difference between the lower and upper limit both compute the same area between the two curves.