Solution (source code)

= Solution

Introduce a constant <Lagrange multiplier> $\mu$ for this <isoperimetric constraint> and make $A-\mu(C-B)$ stationary. Its integrand is $(1-\mu)y-\mu y'^2$, so the <Euler-Lagrange equation> gives
$$
1-\mu+2\mu y''=0.
$$
The endpoint conditions therefore force a parabola $y=Kx(1-x)$. Its area and budget are
$$
A=\frac K6,\qquad C=\frac K6+\frac{K^2}{3}=B.
$$
Solving the quadratic and choosing positive area gives
$$
\boxed{K=\frac{\sqrt{1+48B}-1}{4},\qquad y_{\mathrm{opt}}(x)=\frac{\sqrt{1+48B}-1}{4}x(1-x),\qquad A_{\max}=\frac{\sqrt{1+48B}-1}{24}.}
$$
This requires $B>0$; no positive-area barrier is possible for a nonpositive budget. The corresponding multiplier is $\mu=1/(1+4K)>0$.

To verify a global maximum rather than just stationarity, use the <sharp area-cost bound for a barrier with fixed endpoints>. For $w=x(1-x)$, <integration by parts> gives $2A=\int_0^1y'w'dx$, and $\int_0^1w'^2dx=1/3$. The <Cauchy-Schwarz inequality> implies
$$
\int_0^1y'^2dx\geq12A^2,\qquad B\geq A+12A^2.
$$
For $A>0$ the last expression increases strictly, yielding exactly the boxed upper bound. Equality requires $y'$ proportional to $w'$, hence $y=Kw$ after imposing the endpoints. Thus the displayed optimum is unique and lies above the baseline throughout the interior.