sketch your triangle in quadrant I of a cartesian grid ...

let be the y-intercept

then is the x-intercept

connect these two intercepts ... there is your triangle.

equation of the connection line is

base of the inscribed triangle is x

height of the inscribed triangle is y

now use your calculus to find the value of x that maximizes the area of the rectangle.