Let $F$ be a field. Is it true that if $[F(\sqrt{D}) : F] = 2$, then $D \in F$?

In Dummit & Foote, problem 14.2.17(c), the authors hand us a quadratic extension of the form $$F(\sqrt D)$$. Now, while I am pretty sure you need that $$D \in F$$ to do this particular problem, I can't help but wonder if assuming this is even necessary. In other words, if the degree of the extension $$F(\sqrt D)/F$$ is $$2$$, then must $$D$$ belong to $$F$$?

My thoughts so far are as follows: If $$D \not\in F$$, then $$[F(D) : F] > 1$$. This puts $$\sqrt D \in F(D)$$, otherwise $$4 \le [F(\sqrt D) : F(D)][F(D):F] = [F(\sqrt D): F] = 2.$$ This tells us that $$F(D) = F(\sqrt D)$$. My next observation was that if $$\sqrt D$$ has minimal polynomial $$x^2 + ax + b$$, we can write $$\sqrt D$$ in terms of $$D$$ and elements of $$F$$ and use this to find the minimal polynomial of $$D$$ over $$F$$: $$\sqrt D = -(D + b)/a, \ m_{D, F}(x) = x^2 + (2ab - a)x + b^2.$$ Notice here that $$a \neq 0$$, or else $$D \in F$$!

• I'm confused. If $D \not \in F$ then what does $F(\sqrt{D} )$ mean? – Ethan Bolker Mar 9 at 22:57
• @Ethan You don't know what $\,\Bbb Q(\sqrt{1+\sqrt 3})\,$ means? – Bill Dubuque Mar 9 at 23:04
• @BillDubuque Now I'm no longer confused. Thanks. – Ethan Bolker Mar 10 at 1:10

This is false. Consider the case of $$F=\Bbb{Q}$$, $$D=(1+\sqrt2)^2=3+2\sqrt2.$$
We have $$\sqrt{D}=\pm(1+\sqrt2)$$, so $$\Bbb{Q}(\sqrt D)=\Bbb{Q}(D)=\Bbb{Q}(\sqrt2)$$.
If $$[F(\sqrt D):F]=2$$ the extension is Galois with group $$\{1,\sigma\}$$ and $$\sigma(\sqrt D)=a+b\sqrt D,\qquad a,b\in F.$$ Since $$\sigma^2=1$$ we must have $$\sqrt D=\sigma^2(\sqrt D)=a+ab+b^2\sqrt D$$, i.e. $$a(b+1)=0\qquad\text{and}\qquad b^2=1.$$ If $$a=0$$ and $$b=-1$$ it readily follows that $$D\in F$$.
On the other hand, if $$a\neq0$$ and $$b=-1$$ we have $$F\ni{\rm N}(\sqrt D)=\sqrt D\cdot\sigma(\sqrt D)=a\sqrt D-D$$ from which $$D={\rm N}(\sqrt D)-a\sqrt D\notin F$$. Jyrki Lahtonen's answer shows an instance of the latter situation happening.
• If $\operatorname{char} F = 2$, then $a+b\sqrt D\mapsto a-b\sqrt D$ is the trivial automorphism. – FredH Mar 10 at 9:40
• Ah! @JyrkiLahtonen is right; I mentioned near the end of my question that in the minimal polynomial of $\sqrt D$, $a \neq 0$. – fauxefox Mar 11 at 1:10