$ABCDEFGH$ has squares $ACEG$ and $BDFH$ inscribed in it. These squares form a smaller octagon as shown.

A regular octagonLet the the area of octagon $ABCDEFGH$ be $A_L$ and the area of the smaller octagon be $A_S$ . Then for some integers $a$ and $b$ , where $b$ is square-free, $\large \dfrac{A_S}{A_L}=a-\sqrt{b}.$ Find $a+b$ .

The answer is 4.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

Let the side length of octagon $ABCDEFGH$ be $x$ . Then $A_L=2x^2 (1+\sqrt2)$ .

Consider $\triangle ABH$ : Let the length of line $BH$ be $y$ - this is the length of a side of the squares $ACEG$ and $BDFH$ . Using the cosine rule, we have $y^2=x^2+x^2-2x^2 \cos135° \Rightarrow y^2= 2x^2(1 + \sqrt2/2)$ .

Now let the side length of the smaller octagon be $z$ . Then $z(1+\sqrt2)=y$ and $A_S=2z^2 (1+\sqrt2)$ .

$\Rightarrow \dfrac{A_S}{A_L}=\dfrac{2z^2 (1+\sqrt2)}{2x^2 (1+\sqrt2)}=\dfrac{z^2}{x^2}=\dfrac{y^2}{x^2 (1+\sqrt2)^2}=\dfrac{2x^2(1 + \sqrt2/2)}{x^2 (1+\sqrt2)^2}$ $=\dfrac{2(1 + \sqrt2/2)}{(1+\sqrt2)^2} =\dfrac{2+\sqrt2}{3+2\sqrt2} = 2- \sqrt2$

Thus $a=b=2$ , and the required answer is $\large \color{#20A900}{\boxed{4}}$ .