Project Euler Problem 897

Let G(n) denote the largest possible area of an n-gona polygon with n sides contained in the region (x, y) in Bbb R^2: x

Project Euler Problem 897

Solution

Answer: 1.599826042

Let the polygon vertices be

$$P_i=(x_i,x_i^4),\qquad -1=x_0<x_1<\cdots<x_{n-1}=1.$$

A standard convexity argument shows that every vertex of the maximal polygon lies on the boundary curve $y=x^4$, and the optimal polygon uses the two endpoints $(\pm1,1)$.

For such a polygon, the area is

$$A =2-\sum_{i=0}^{n-2}\frac{(x_{i+1}-x_i)(x_i^4+x_{i+1}^4)}2.$$

So maximizing the polygon area is equivalent to minimizing the trapezoidal approximation error for $\int_{-1}^1 x^4,dx$.

Using calculus on the discrete functional gives the stationarity condition

$$x_{i-1}^4-4x_{i-1}x_i^3+4x_ix_{i+1}^3-x_{i+1}^4=0 \qquad (1\le i\le n-2).$$

Solving this nonlinear system numerically for $n=101$ (with high precision optimization/Newton iteration) gives

$$G(101)=1.599824142983\ldots$$

which rounds to nine digits after the decimal point as

Answer: 1.599824143