http://students.washington.edu/marusich/trianglemax.jpg
\mbox{Note that the area of the rectangle is zero when } x = 0 \mbox{ and when } x = 6 \mbox{. Also, just by looking, we see that the area ought to increase, then}
\mbox{eventually hit a maximum and decrease, on the } x \mbox{-interval } [0, 6] \mbox{. This sort of thing is useful to observe before getting started, because it either}
\mbox{helps confirm what we calculate or makes us stop and think when we see something strange (like if we calculated that one of the endpoints}
\mbox{were the maximum). Anyway...}
\mbox{A} = ab
\cos\theta = \frac{x}{a}
a = \frac{x}{\cos\theta}
\sin\theta = \frac{b}{6-x}
b = (6-x)\sin\theta
\mbox{A} = ab = \frac{x}{\cos\theta}(6-x)\sin\theta
= x(6-x)\frac{\sin\theta}{\cos\theta} = x(6-x)\tan\theta
\mbox{but}
\tan\theta = \frac{4}{6} = \frac{2}{3}
\mbox{so we just have:}
\mbox{A}(x) = \frac{2}{3}x(6-x) = 4x-\frac{2}{3}x^2
\mbox{A'}(x) = 4-\frac{4}{3}x
\mbox{A}(x) \mbox{ has a max or min either at the endpoints of the } x \mbox{-interval } [0, 6] \mbox{ or when A'}(x) = 0 \mbox{ (or at any other critical point, but since this function is just}
\mbox{a parabola, it has no asymptotes, kinks, jumps, holes or anything like that). The max should definitely not occur at the endpoints in this}
\mbox{case (remember our initial observation), or we've done something wrong.}
\mbox{A'}(x) = 4-\frac{4}{3}x = 0
\frac{4}{3}x = 4
x = 3
\mbox{if }x > 3 \mbox{ then A'}(x) < 0
\mbox{verify: A'}(10000000000) = 4 - \frac{4}{3}(10000000000)<0
\mbox{if }x < 3 \mbox{ then A'}(x) > 0
\mbox{verify: A'}(0) = 4-\frac{4}{3}(0) = 4 > 0
http://students.washington.edu/marusich/derivative.jpg
\mbox{So A}(x) \mbox{ has a global maximum at } x = 3 \mbox{. The endpoints of our particular interval } [0, 6] \mbox{ will not be maxima because A}(x) \mbox{ is increasing}
\mbox{for all } x < 3 \mbox{ and decreasing for all } x > 3 \mbox{, which means that A}(3) > \mbox{A}(x) \mbox{ for all }x \neq 3 \mbox{. You could verify this by simply comparing}
\mbox{A}(0) \mbox{ and A}(6) \mbox{ to A}(3) \mbox{.}
\mbox{So the maximum area is:}
\mbox{ A}(3) = 4(3)-\frac{2}{3}(3)^2 = 6
\mbox{ (Still another reason this result makes sense is because the point }(3, 6) \mbox{ lies in quadrant I, which makes sense because A}(x)\mbox{ was an inverted}
\mbox{parabola with its maximum obviously somewhere in quandrant I.) }
Converted to latex. It's the first time I've used it. Hurray for easier-to-read math! Oh, and looking back, I guess you only wanted the relation for the rectanglular area...Oh well. Here's the whole thing. :P