We have an example of the discrete version of Dido's problem.
Let $n\in N$ and $n \geq 3$.
A polygon exists with $n$ sides and corners P. The corners are given by:
$P_k$ = ($r_k \cos \sigma_k$, $r_k \sin \sigma_k$) with
$r_0$=$r_n$, $\sigma_0=0$, $\sigma_k$= $\alpha_1$ +...+$\alpha_k$, $k=1,...,n$ , $\alpha_j$ $\in$ ($0,\pi$), $j=1,...,n$ and $\sigma_n = 2\pi$.
See image https://postimg.cc/dhKtgwK3.
We wrote the perimeter l and the area A as a function of the variables $r_n$ and $\alpha_n$.
len = $ \Sigma \sqrt {r_k^2+r_{k+1}^2-2r_k r_{k+1} \cos(\alpha_k)} $
and
A = $\Sigma \sqrt {P_n (P_n-r_k)(P_n-r_{k+1})(P_n - \sqrt {r_k^2 + r_{k+1}^2 -r_k r_{k+1} \cos(\alpha_k)}} $
with $P_k= r_k/2 +r_{k+1}/2 + \sqrt {r_k^2 + r_{k+1}^2 -r_k r_{k+1} \cos(\alpha_k)}/2 $.
The maximum area with a constant perimeter L needs to be found with the Lagrange equations.
We have for our Lagrange equation:
$$L(r_k,\alpha_k,\lambda,\mu)= \Sigma \nabla A_k + \lambda \nabla g + \mu \nabla h =0, $$
with $g = \Sigma (\sqrt {r_k^2+r_{k+1}^2-2r_k r_{k+1} \cos(\alpha_k)} - len_k) $
and $h = \Sigma (\sqrt {P_n (P_n-r_k)(P_n-r_{k+1})(P_n - \sqrt {r_k^2 + r_{k+1}^2 -r_k r_{k+1} \cos(\alpha_k)}} - A_k) $.
Now we need to solve the system of equations to find that $r_1 = ... = r_n$ and $\alpha_1 = ... = \alpha_n$ is the solution (for maximal area A given perimeter L. I cannot find this solution from the equations. Can anyone please help me?
Considering another formulation
for $p_k = (x_k, y_k)$ and such that $p_n = p_1$
we have
$$ A = \frac 12\left((x_2-x_1)(y_2+y_1)+(x_3-x_2)(y_3+y_2)+\cdots + (x_1-x_{n-1})(y_1+y_{n-1})\right)\\ P = \sum_{k=1}^{n-1} \lVert p_{k+1}-p_k\rVert $$
so the Lagrangian reads
$$ L(p,\lambda) = A+\lambda(P-P_0) $$
then we have
$$ L_{x_k} = \frac 12(y_k-y_{k+2})+\lambda\left(\frac{x_k-x_{k-1}}{\lVert p_k-p_{k-1}\rVert}+\frac{x_k-x_{k+1}}{\lVert p_k-p_{k+1}\rVert}\right)=0\\ L_{y_k} = \frac 12(x_{k+1}-x_{k-1})+\lambda\left(\frac{y_k-y_{k-1}}{\lVert p_k-p_{k-1}\rVert}+\frac{y_k-y_{k+1}}{\lVert p_k-p_{k+1}\rVert}\right)=0\\ L_{\lambda}=\sum_{k=1}^{n-1} \lVert p_{k+1}-p_k\rVert - P_0 = 0 $$
Making some numerical experiments for $n = 6$ with $P_0 = 5$ we obtained
$$ \left[ \begin{array}{cc} x_k & y_k \\ 0.311083 & 0.401729 \\ 0.256912 & -0.596802 \\ -0.709488 & -0.853846 \\ -1.25258 & -0.0141751 \\ -0.621837 & 0.761813 \\ \end{array} \right] $$