Maximise a rectangle inside a triangle

An isosceles triangle of width and height 4m has a rectangle of height and width 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 and have a function for the area of the rectangle in terms of and

Gives me

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