Solution (source code)

= Solution

The <polynomial> $x^2-2$ is an <irreducible polynomial> over $\mathbb Q$, so $[\mathbb Q(\sqrt2):\mathbb Q]=2$. This intermediate field is real, so it does not contain $i$. Hence $x^2+1$ has no root in it and adjoining $i$ has degree two. The <tower law> gives
$$
\boxed{[\mathbb Q(\sqrt2,i):\mathbb Q]=4.}
$$
A <basis> is $1,\sqrt2,i,i\sqrt2$. Square-bracket adjoining notation in this algebraic example gives the same field as round-bracket adjoining notation.