Find the maximum area of a right triangle with a constant perimeter P. I have been learning calculus from a tutor and I have been trying to solve a problem that he gave me. The problem is to find the maximum area of a right triangle with a constant perimeter $P$. To start solving this problem I wrote down the different equations for the area and perimeter of a right triangle.
$A=\frac{a*b}{2}$ for area and $P= a+b+h$ for the perimeter.
I decided to first find a side length by substituting $\sqrt{a^2+b^2}$ for $h$  and then solving for $a$ in the perimeter equation.  Here are the steps I took… $$P=a+b+\sqrt {a^2+b^2}$$
$$(P-a-b)^2=(\sqrt{a^2+b^2})^2$$
$$P^2+2ab-2aP-2bP=0$$
$$2a(b-P)=2bP-P^2$$
$$a=(\frac{1}2)(\frac{2bP-P^2}{b-P})$$
Now that I have the equation for $a$, I’m uncertain about how to proceed. I know that I could also solve for side length $b$ and put the two side length equations in for $a$ and $b$ in the area equation and get ...
$$A=\frac{(\frac{1}{2})(\frac{2aP-P^2}{a-P})(\frac{1}{2})(\frac{2bP-P^2}{b-P})}{2}$$
or I could just substitute b in the equation and get…
$$A=\frac{a*(\frac{1}{2})(\frac{2bP-P^2}{b-P})}{2}$$
I also know that once I have an equation for area I need to find its derivative and set it equal to zero and then solve for $P$. What I’m unsure about is which area equation I need and how to find its derivative. My tutor told me that I need to use both the chain rule and product rule in order to find the derivative. I can use both the chain rule and the product rule separately but I’m not sure how to use both on either equation. 
 A: You arrived at an expression $a = f(b,P)$. Note that by hypothesis the perimeter $P$ is constant, so in fact you have $a$ as a function of $b$. Now the area can be written $A = a\cdot b/2 = b \cdot f(b)/2$ which is a function of $b$. In order to finish you should study the variations of this function and find that the maximum point is probably the case where $a=b$.

In the case of a right triangle there is another way to approach the problem, without using calculus. Note that if you denote by $r$ the radius of the incircle then $A = r\cdot P/2$. So in order to maximize the area you should maximize the radius of the incircle. Now, again because the triangle is rectangle, the expression of this radius is quite particular and is equal to $r = P/2-h$ (take a look at the picture here; I've denoted by $h$ the hypothenuse). Therefore maximizing $r$ means minimizing $h$. 
So the problem translates to: minimize $h=\sqrt{a^2+b^2}$ subject to $a+b+h = P$. We have $a+b \leq \sqrt{2(a^2+b^2)}=h\sqrt{2}$. This shows that $P \leq h(\sqrt{2}+1)$ and $h \geq P/(\sqrt{2}+1)$. Thus $h$ is minimal when he have equality in $a+b \leq \sqrt{2(a^2+b^2)}$ which means that $a=b$. 
A: You have $$A=\frac{ab}{2}$$ and you have found that
$$a=\frac12\left(\frac{2bP-P^2}{b-P}\right).$$
You can use the second equation to substitute for $a$ in the first equation:
$$A=\frac{\frac12\left(\frac{2bP-P^2}{b-P}\right)b}{2}
= \frac14\left(\frac{2bP-P^2}{b-P}\right)b.$$
You can now express the area $A$ as a function of a single variable, $b$.
Maximize over all values of $b$.

You could of course perform symmetric substitutions both for $a$ and for $b$
as you were considering, but the best solution strategy to follow here is
to try to reduce the number of unknowns in your expression for area;
so having gotten rid of $a$ by making one substitution, it is not
productive to re-introduce it via another substitution, even if that
would make things more "even-handed".
(In fact, "even-handed" is exactly what you're trying to get away from:
you want to eliminate one variable and leave the other present!)
A: First of all, you do not want to express $A$ as a function of both $a$ and $b$. Since $P$ is constant, you need to find a relationship between $a$ and $b$ (what you found is correct), then replace it in to $A$. Then express $A$ as a function dependent only on either $a$ or $b$. For example:
$$A = \frac{1}{4}\left(\frac{(2bP-P^2)b}{b-P}\right)$$
Taking the derivative with respect to $b$ to obtain:
$$ \frac{\partial A}{\partial b} = \frac{P(P^2 - 4bP + 2b^2)}{4(b - P)^2}$$
Finally equate it with 0 to obtain:
$$ P^2 - 4bP + 2b^2 = 0 $$
Solve for $b$ with the quadratic formula. Be careful with some of the conditions on value of $b$.
A: i assume that $h=c$ and we get $$a=\frac{1}{2}\frac{2Pb-P^2}{b-P}$$ and our area is given by
$$\frac{ab}{2}=\frac{1}{4}\cdot \frac{2Pb^2-bP^2}{b-P}$$
diffferentiate this with respect to $b$ we obtain
$$f'(b)=\frac{1}{4}\frac{P(P^2-4Pb+2b^2)}{(P-b)^2}$$
