As I said before, a number field K with r real conjugates and s pairs of proper complex ones has r + s – 1 independent units, in the sense that if (u1^a1)(u2^a2)…(u(r+s-1)^a(r+s-1)) = 1 where the a(i)’s are integers, then all a(i)’s are zero. While this doesn’t apply to every set of r + s – 1 units, it does apply to some set of that size but not to any set of r + s units.
What I’m more concerned with in this post is the number of roots of unity in K, as a function of n = [K:Q]. First, note that every number field has at least two roots of unity, 1 and -1. Also note that R only has these two roots of unity, so if K is a subfield of R, it has no additional roots of unity. Since every K for which r > 0 can be regarded as a subfield of R, it follows that if K has more than two roots of unity, n = 2s.
Now, let L be the subfield of K generated by roots of unity. L has degree m over Q, where m < n. In fact m divides n, since K is a vector space over L, so that K is additively the same as L^l = Q^lm for some l and lm = n. If L has k roots of unity, then the multiplicative group of roots of unity can be denoted as C(k), which is just a way of writing Z/kZ in multiplicative notation.
Since C(k) has an element corresponding to 1 in Z/kZ, call it z(k), L is in fact the subfield of K generated by z(k); this is because every other root of unity in K is a power of z(k). The conjugates of z(k) are other kth roots of unity. Furthermore, z(k) is not a root of unity of any order less than k, or else there are fewer than k roots of unity in K. The name for such a root is a primitive kth root of unity. It’s not difficult to see that z(k)^c is a primitive kth root of unity iff c and k are coprime. So the number of conjugates of z(k) is at most phi(k), defined to be the number of positive integers less than k that are coprime to k, or, equivalently, the number of equivalence classes mod k that are coprime to k. In fact the two are equal, but that requires a technical field theoretic proof I don’t want to get into.
So if K has exactly k roots of unity, then phi(k) must be a divisor of [K:Q]. Also, k can never be odd, because we can always pair off roots of unity with their negatives. After all, if z^m = 1, then (-z)^2m = 1, and z = -z iff z = 0.
The converse, mind you, isn’t always true. phi(6) = 2, but Q(SQRT(n)) doesn’t have 6 roots of unity unless n = -3. In fact there are only two roots of unity in Q(SQRT(n)) unless n = -1 or -3, where it’s understood that if n = mb^2 then we only ever write Q(SQRT(m)). Moreover, in Q(SQRT(n1), SQRT(n2)) the number k must satisfy phi(k) = 1, 2, or 4.
If k1 and k2 are coprime then an equivalence class mod k1k2 is determined by its equivalence class mod k1 and its class mod k2, and is coprime iff it’s coprime to k1 and k2, so that phi(k1k2) = phi(k1)phi(k2). That implies that phi(k) is the product of phi(p^m) over all p^m dividing k such that p^(m+1) does not divide k; and phi(p^m) is just the number of positive integers less than p^m coprime to p, which is (p-1)p^(m-1).
In other words, if phi(k) divides 4, then every prime p dividing k must be one more than a divisor of 4 – i.e. be 2, 3, or 5 – and also the exponents of 2, 3, and 5 are at most 3, 1, and 1 respectively. It’s not especially hard to then compute that k has to be 1, 2, 3, 4, 5, 6, 8, 10, or 12, where the odd values are not possible from a previous result.
If k = 2, then the only roots of unity are -1 and 1, which is the general case. If k = 4, then K contains i = SQRT(-1) and some other square root. If k = 6, then K contains SQRT(-3) and some other square root. If k = 8, then K = Q(SQRT(-1), SQRT(2)) which is generated by primitive 8th roots of unity. If k = 12, then K = Q(SQRT(-1), SQRT(3)) which is generated by primitive 12th roots of unity. If k = 10, then K can’t be written as Q(SQRT(n1), SQRT(n2)); the only proof I can think of requires Galois theory, in which case the proof is that the field of 10th roots of unity’s Galois group is C(4) while Q(SQRT(n1), SQRT(n2))’s Galois group is always C(2) * C(2). In particular, Q(SQRT(n1), SQRT(n2)) has no roots of unity apart from 1 and -1 whenever n1 and n2 are both different from -1 and -3.