Hello, everyone!

I'm still working on this one . . . so I'll just babble . . .

I having trouble controlling the variable.

You see, the rectangle can be "tipped" at a variety of angles.

Code:

* * * P2
* o
P1*---------o-----*P3
*| o o|*
| o |
P8o | |o*
* | | *
*o| | oP4
| o |
*|o o |*
P7*-----o---------*P5
o *
P6 * * *

The area of the octagon would be:

. . $\displaystyle \text{area of: }\:(\text{square }P_1P_3P_5P_7) + \Delta P_1P_2P_3 + \Delta P_3P_4P_5 + \Delta P_5P_6P_7 + \Delta P_7P_8P_1$

Edit: You're right, RubyRed . . . I overlooked the word "maximum".

Yes, the top and bottom triangles are congruent,

. . as are the left and right triangles.

If my diagram is hard to read . . .

Points $\displaystyle P_1, P_3, P_5, P_7$ are the vertices of the square,

. . which is clearly outlined.

Points $\displaystyle P_2, P_4, P_6, P_8$ are the vertices of the rectangle,

. . outlined with o's (harder to see).