Area of a rectangle inside a triangle with given coordinates

Given a triangle with vertices at points $$(0, -a), (0, a), (b, 0)$$, where $$a > 0$$, find the maximal area and the dimensions (base and height) of a rectangle that can be contained within the triangle.

I tried to find a function, differentiate it, and find the maximum. I think I kind of did it right, but since I'm not sure I want to ask for some advice.

I set up $$x$$ as the length of the base and $$y$$ as the height, but since $$y$$ is being divided by the $$x$$ axis in two parts, the function of the area is:

$$\mbox{Area}=x2y$$

and to find y with the triangle, I saw that we can do a little similar triangle to the bigger triangle on the positive side so

$$\frac ab = y/{b-x}$$

then

$$y=a-{ax}/{b}$$

plugin that into de area equation gives

$$\mbox{Area}=2x(a-{ax}/b)$$

so the derivative is

$$A'=2a-4{ax/b}$$

solving for A'=0 gives $$x=b/2$$ so finding the dimensions and the area won't be hard once you get the proper x, but I'm kinda doubtful because I didn't set any constraint for the base "x"

Completing the square:

Maximize $$A:= 2x(-(a/b)x+a)$$, where $$0 \le x \le b$$.

$$A= 2x((-a/b)x+a)=$$

$$-2(a/b)x^2 +2xa=$$

$$-2(a/b)(x^2-bx)=$$

$$-2(a/b)[(x-b/2)^2-(b/2)^2]=$$

$$-2(a/b)(x-b/2)^2 + 2(a/b)(b/2)^2.$$

Maximal area occurs for

$$x=b/2$$ (why?) : $$A_{max}= (ab)/2.$$

Let $$A(0,b),$$ $$B(b,0),$$ $$C(0,-a)$$ and $$KLMN$$ be our rectangle, $$KL=x$$, where $$K\in BC$$ and $$N\in AB$$.

Thus, since $$\Delta ABC\sim\Delta NBK$$, we obtain: $$\frac{NK}{2a}=\frac{b-x}{b}$$ or $$NK=\frac{2a(b-x)}{b}.$$ Id est, by AM-GM $$S_{KLMN}=\frac{2a(b-x)x}{b}\leq\frac{2a\left(\frac{b-x+x}{2}\right)^2}{b}=\frac{ab}{2}.$$ The equality occurs for $$b-x=x,$$ which says that we got a maximal value.

Now, we see that in the optimal case $$KL=\frac{b}{2}$$ and $$NK=a.$$

• hey thanks!!!! I didn's understand the less or equal part, but I see you got the same results, but your method makes more sense. and also I guess that really gets me out of the doubt that I don't need to specifically set a constraint for x (at least for this problem) – rorod8 Apr 10 at 3:51
• It's AM-GM: For positives $p$ and $q$ we have $pq\leq\left(\frac{p+q}{2}\right)^2.$ It's just $(p-q)^2\geq0.$ – Michael Rozenberg Apr 10 at 3:55