A triangle of base $b$ and height $h$ has acute base angles. A rectangle is inscribed in the triangle with one side on the base of the triangle. Show that the largest such rectangle has base $b/2$ and height $h/2$, so that its area is one-half the area of the triangle.
So, we have a triangle as it is shown in the picture (Sorry for the awful quality). We have that $bh/2 = A$, where $A$ is the area of the triangle. We have $y/(b-x-z) = h/(b-x-z+x_1)$ from where $y = \frac{h(b-x-z)}{b-x-z+x_1}$ and $y/z = h/(x_2+z)$, from where $y = \frac{zh}{x_2+z}$. So $\frac{zh}{x_2+z} = \frac{h(b-x-z)}{b-x-z+x_1}$. From this I get $zhx = x_2h(b-x)$. Can this be useful? If so, what should be done next?



EDIT: I have misread your problem, so I will modify my solution for the general case!
I think you would benefit greatly from a change in perspective. As this is a calculus problem, you want to think of convenient way to represent the triangle. So let's use a Cartesian plane to our advantage. If we place the base on the $x$ axis we have the following picture:
Notice that for a given $y \, (0 \leq y \leq h)$ the width of the rectangle is given by $x_2 - x_1$, where
$$y = \frac{h}{p} x_1$$ $$y = \frac{h}{b - p} (b - x_2)$$
This means the area of the inscribed rectangle is now $(x_2 - x_1)y$. Let's use the equations above to solve for the width as a function of $y$:
$$x_2 - x_1 = b - \frac{b}{h} y$$
Now we can rewrite the area as a one-variable function of $y$
$$A(y) = y(x_2 - x_1) = by - \frac{b}{h} y^2$$
We can now take derivatives and find our critical points for the area function. But before that, I'd like to showcase a calculus free solution. Note that $A(y)$ represents a downward facing parabola with roots at $y = 0$ and $y = h$. We know that the vertex (where $A(y)$ achieves the maximum) is located at the midpoint of the roots. So now we have the critical values of this system:
$$ y^* = \frac{0 + h}{2} = \frac{h}{2} \implies w^* = b - \frac{b}{h} \frac{h}{2} = \frac{b}{2}$$
Now we can calculate the maximum area: $$A_{\mathrm{max}} = w^* y^* = \frac{bh}{4}$$
Which is indeed half the area of the triangle.
If you prefer calculus, we can calculate the first and second derivatives of $A(y)$:
$$\frac{dA}{dy} = -\frac{2b}{h} y + b$$ $$\frac{d^2A}{dy^2} = -\frac{2b}{h}$$
We can set the first derivative to zero and solve the resulting linear equation:
$$\frac{dA}{dy} = 0 \implies y = \frac{h}{2}$$
Therefore $y^* = h/2$ is the critical value. This critical value is guaranteed to correspond to a maximum of $A(y)$ since the second derivative is negative for all $y$. Now simply calculate $w^*$ and $A_\mathrm{max}$ in the same manner as above.
I hope this helps. Sorry for any confusion from my earlier solution.