Heron's formula for the area A of a triangle with sides of length $a, b, c>0$ is $A=\sqrt{s(s-a)(s-b)(s-c)}$, where $s=\frac{a+b+c}{2}$. Use the method of Lagrange multipliers to show that for a given fixed perimeter $p=2s$ of the triangle, the area is maximized when the triangle is equilateral.
I set up the function with $A(a, b, c)=\sqrt{s(s-a)(s-b)(s-c)}$ but what should be the constraint here and how to apply the method of Lagrange multipliers to do this problem?
We can consider maximizing the area of the squared function instead since this will preserve order. This will avoid dealing with the square root function in the partial derivatives $$\begin{aligned}f(a,b,c) = s(s-a)(s-b)(s-c) &= \frac{1}{16}(a+b+c)(b+c-a)(a+c-b)(a+b-c)\\ &=\frac{1}{16} [-a^4+2a^2b^2+2a^2c^2-b^4+2b^2c^2-c^4] \end{aligned}$$
And let our constraint function simply be $g(a,b,c) = 2s = a+b+c$.
We want to determine $(a,b,c)$ where $\nabla f = \lambda \nabla g$, so we evaluate the partials to get the gradients. Then, we write the relationship for Lagrange multipliers with these: $$\frac{1}{4}\begin{bmatrix}-a^3+ab^2+ac^2 \\ a^2b-b^3+bc^2\\a^2c+b^2c-c^3\end{bmatrix} = \lambda\begin{bmatrix}1\\1\\1\end{bmatrix}$$
In the case where these three expressions on the left-hand side are equal to each other and $a,b,c$ are all positive, the only solution is where $a=b=c$, that is where the triangle is equilateral.
To elaborate slightly on why the sides must be equal, notice that for $$a(-a^2+b^2+c^2) - b(-b^2+a^2+c^2) =0 \implies (b-a)(a+b-c)(a+b+c) =0$$ and you have similar expressions for the other pairs.
Edit: I am showing the algebra steps. I just apply difference of squares over and over. $$\begin{aligned} &(a+b+c)(b+c-a)(a+c-b)(a+b-c)\\ &= ((a+b)+c)((a+b)-c)(c-(a-b))(c+(a-b))\\ &=((a+b)^2-c^2)(c^2-(a-b)^2)\\ &= (a+b)^2c^2 -(a+b)^2(a-b)^2 -c^4 +c^2(a-b)^2\\ &= c^2((a+b)^2+(a-b)^2) -(a+b)^2(a-b)^2 -c^4 \\ &=c^2(2a^2+2b^2)-(a+b)^2(a-b)^2 -c^4\\ &=c^2(2a^2+2b^2)-(a^2-b^2)^2 -c^4\\ &=-a^4+2a^2b^2+2a^2c^2-b^4+2b^2c^2-c^4 \end{aligned}$$