TITLE: Is this formula for the minimal polynomial of a quadratic integer correct?
QUESTION [5 upvotes]: Given $\{a, b\} \in \mathbb{Z}$ (or $\mathbb{Z}[\frac{1}{2}]$ as appropriate) and $d \in \mathbb{Z}$ with $\mu(d) \neq 0$, the minimal polynomial of $a + b \sqrt{d}$ is $$x^2 - 2ax + (a^2 - db^2),$$ right?
Essentially $x^2$ minus twice the trace times $x$, plus the norm. If I have not made a mistake somewhere.
I don't have any theorems or intuitions to back this up. Just playing around with Wolfram Alpha, tossing it various real and complex quadratic integers.
One of the similar questions, Norms and traces example, seems to confirm what I have come up with, but it doesn't rule out the possibility that I have overlooked some subtlety, or worse, something that should be obvious to me even at my novice level.

REPLY [3 votes]: Alternative hint:  to derive (rather than just verify) the minimal polynomial, let $x = a + b\sqrt{d}\,$, which implies $(x-a)^2=b^2 d\,$, which expands to $\,x^2 - 2ax + a^2 - db^2 = 0\,$. The latter is a polynomial in $\mathbb{Z}[x]$ satisfied by $\,x\,$, and it is the minimal polynomial since $a+b\sqrt{d}$ is irrational when $d$ is not a perfect square, thus cannot satisfy a $1^{st}$ degree polynomial.