Ok so im really stuck on this question

An isosceles triangle has a base measuring 18 inches and sides measuring 15 inches. Write a function of a single variable representing the area of any rectangle with base along the base of the triangle and inscribed inside the triangle. Then find the dimensions of the rectangle having the largest possible area.

Hints:Think about what you need to do to write the equation. remember you are finding the area of the RECTANGLE but have to use the lengths of the triangle to do it! Find the equation of the LINE through the point (x, y) like you did last week. Find the intercpets using the pythogorean Theorem and then find the slope once you have two points.

ok so i used the pythogorean theorem and got 12 for the height

which is also the y intercept and the x intercept is 9

i used the midpoint formula and got this equation

y=(4/3)x +12

please im stuck

thanks in advance