Why is this method of proving that circle encloses the maximum area for a given perimeter turning out to be wrong? I tried to do this in polar coordinates setting the perimeter to $L_0$ and using 'by parts' to break this integral down. 
$$\int_{0}^{2\pi}rd{\theta} = L_0$$ and $$A=\frac{1}{2}\int_{0}^{2\pi}r^2d{\theta}$$.
Integration by parts leads to
$$\frac{1}{2}(L_0r(0) - \int_{0}^{2\pi}\int rd\theta\frac{dr}{d\theta}d{\theta})=\frac{1}{2}L_0r(0)-\frac{1}{4}\int_{0}^{2\pi}r^2d{\theta}$$
So $A = \frac{1}{2}L_0r(0) - \frac{1}{2}A$ and $A = \frac{1}{3}L_0r(0)$. where $r(0)$ is the radius at an arbitrary point. 
I was hoping to find an equation for the area that I could use $r(\theta)$ to maximise (by intuition), instead I got quite possibly the most ridiculous answer. Namely, that the area of all 2d shapes is $\frac{1}{3}L_0r(0)$. Why is this?
 A: Let $r=f(\theta) $ and $g(\theta) =\int_{0}^{\theta}f(t)\,dt$ then $L=g(2\pi)$ and we have $$2A=\int_{0}^{2\pi}f(\theta) f(\theta) \, d\theta=f(2\pi)L-\int_{0}^{2\pi}f'(\theta)g(\theta)\,d\theta$$ Now you have tried to express the second integral as $(1/2)\int_{0}^{2\pi}f^{2}(\theta)\,d\theta$ which is clearly wrong. The problem is that the equation $$r\, d\theta\frac{dr} {d\theta} =r\, dr$$ is valid but the equation in question $$\left(\int r\, d\theta\right) \frac{dr} {d\theta} $$ and the first factor in parentheses is no longer a differential, but it has already been integrated to yield a function $g(\theta) $. The confusion arises only due to the fact that you have not used parentheses. Be careful while using integration by parts. You can also see that the problem is avoided if we use a different function symbol $g$ for anti-derivarive of $f$. 
A: Not "integration" directly but this is a standard problem in "Calculus of Variations": http://mathworld.wolfram.com/CalculusofVariations.html.
https://www.uu.edu/dept/math/SeniorPapers/03-04/Goshi.pdf
