Finding an angle in a figure with a regular octagon and regular pentagon I've recreated the diagram using Adobe Illustrator.


The pink polygon is a regular octagon and the grey is a regular pentagon.

I've tried to solve this for a while now but get nowhere. It seems like all I do is create more random angles that don't contribute to the solution. I've tried extending lines but that doesn't seem to help me at all.
Most other problems I've been given are relatively easy.
Assuming the common sides to be unit and setting the origin at the bottom left vertex, the angle $x$ is determined by its apex at $(0,1+\sqrt2)$ and the points $(1/\sqrt2,1+1/\sqrt2)$ and $(\cos2\pi/5,\sin2\pi/5)$.

The tangent of $x$ is given by the ratio of the cross-product of the two legs over their dot product.

$$x=\arctan\frac{\frac1{\sqrt2}\left(\frac{\sqrt{10+2\sqrt5}}4-1-\sqrt2\right)+\frac1{\sqrt2}\frac{\sqrt5-1}4}{\frac1{\sqrt2}\frac{\sqrt5-1}4-\frac1{\sqrt2}\left(\frac{\sqrt{10+2\sqrt5}}4-1-\sqrt2\right)}.$$
Hint:

The sum of the internal angles of a convex polygon with $n$ sides (the angles between two consecutive sides) is equal to $\; (n-2)\pi$ (in radians).