Eight semicircles lie inside a regular octagon with side length $4$, diameters on the octagon's sides. What is the area inside the octagon but outside all the semicircles?
With $n=8$ sides, side $s=4$, radius $r=2$, and interior angle $\theta=135^\circ=\frac{3\pi}4$: the octagon's area is $\dfrac{ns^2}4\cot\dfrac\pi n=32\cot22.5^\circ=32(1+\sqrt2)=32+32\sqrt2$ (using the exact value $\cot22.5^\circ=1+\sqrt2$).
Adjacent semicircles overlap near each vertex (the two centers are a fixed distance $d=2r\sin(\theta/2)$ apart, both radius $r$); this lens area works out to $r^2(\pi-\theta-\sin\theta)$ per vertex, so the total overlap over all $n$ vertices is $nr^2(\pi-\theta-\sin\theta)$.
The union of the $n$ semicircles is therefore $n\cdot\frac12\pi r^2 - nr^2(\pi-\theta-\sin\theta)=nr^2\left(\theta+\sin\theta-\frac\pi2\right)$.
Shaded area $=$ octagon area $-$ union $=(32+32\sqrt2)-8(4)\left(\frac{3\pi}4+\sin135^\circ-\frac\pi2\right)$.