Quiz #1 Tuesday Sept 13th 2005

First we define our two functions.

> f := x -> x^3 - 4*x;
g := x -> 3*x - 6;

f := proc (x) options operator, arrow; x^3-4*x end proc

g := proc (x) options operator, arrow; 3*x-6 end proc

Then we solve for their intersection points.

> solve( f(x)=g(x), x);

1, 2, -3

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);

[Plot]

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);

131/4

Voila!