Maximise a rectangle inside a triangle

An isosceles triangle of width and height 4m has a rectangle of height $\displaystyle h$ and width $\displaystyle w$ inside it such that the top corners are always flush to the sides of the triangle. What is the maximum area for the rectangle.

I know the area of the triangle is $\displaystyle 8$ and have a function for the area of the rectangle in terms of $\displaystyle w$ and $\displaystyle h$

Gives me $\displaystyle A(w,h) = 8 - f(w,h)$

The only help in need is another relationship between w and h so I can have the area in terms of one variable either $\displaystyle w$ or $\displaystyle h$. Then I can make $\displaystyle A'=0$ , solve that and I will be finished.