Quiz #1 Tuesday Sept 13th 2005
First we define our two functions.
> | f := x -> x^3 - 4*x;
g := x -> 3*x - 6; |
Then we solve for their intersection points.
> | solve( f(x)=g(x), x); |
Then we draw a picture to see what's going on. Note: f is red and g is green.
> | plot( {f(x), g(x) }, x=-3.5..3); |
So we see that from x=-3 to x=1, f is on top, and from x=1 to x=2, g is on top. So we integrate accordingly.
> | int( f(x) - g(x), x=-3..1) + int( g(x) - f(x), x=1..2); |
Voila!