The largest area of the rectangle inscribed into an acute triangle 
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?
 A: 
Here is a geometric proof. 
Let A and B be the side midpoints. Due to the congruent triangle pairs marked in the graph, the rectangle is half of the triangle. 
If A and B are not the midpoints, AB is either greater or less than half of the base $b$. In either case, the area of the rectangle is less than half of the triangle, as indicated by the 'wasted' portion of the triangle in dark blue.
A: 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.
A: The solution for the general case requires a bit more effort than the right triangle case. We will be using a lot of "Basic Probotionality theorem for triangles"

$$\frac{y}{h} = \frac{b_1 - x_1}{b_1}$$
Similarly, 
$$\frac{y}{h} = \frac{b_2 - x_2}{b_2}$$
Giving us,
$$\frac{x_1}{b_1} = \frac{x_2}{b_2}$$
Using Compedendo dividendo,we get
$$\frac{x_1}{b_1} = \frac{x_2}{b_2} = \frac{x_1 + x_2}{b_1 + b_2} = \frac{x}{b}$$
Now, 
$$\frac{y}{h} = 1 - \frac{x_1}{b_1}$$
Hence, 
$$\frac{y}{h} = 1 - \frac{x}{b}$$
Multiplying with $x$ on both sides we get,
$$ xy = hx - \frac{hx^2}{b}$$
$$ A = hx - \frac{hx^2}{b}$$
$$ \frac{dA}{dx} = h - \frac{2hx}{b}$$
For maxima this has to be equal to zero.
$$ h = \frac{2hx}{b}$$
$$ x = \frac{b}{2}$$
Also, 
$$y = \frac{h}{2}$$
