[proofplan]
We establish both equalities. The first, $\mathbb{Q}_p^{\mathrm{ab}} = \bigcup_{n \geq 1} \mathbb{Q}_p(\zeta_n)$, follows immediately from the [Local Kronecker-Weber](/theorems/???) theorem: every finite abelian extension of $\mathbb{Q}_p$ is contained in some $\mathbb{Q}_p(\zeta_m)$, so the maximal abelian extension is the union of all cyclotomic extensions. The second, $\mathbb{Q}_p^{\mathrm{ur}} = \bigcup_{(n,p)=1} \mathbb{Q}_p(\zeta_n)$, is proved by showing that every finite unramified extension of $\mathbb{Q}_p$ is generated by a root of unity of order coprime to $p$, and conversely that $\mathbb{Q}_p(\zeta_n)/\mathbb{Q}_p$ is unramified when $(n, p) = 1$.
[/proofplan]
[step:Prove $\mathbb{Q}_p^{\mathrm{ab}} = \bigcup_{n \geq 1} \mathbb{Q}_p(\zeta_n)$ using Local Kronecker-Weber]
Let $L/\mathbb{Q}_p$ be any finite abelian extension. By the [Local Kronecker-Weber](/theorems/???) theorem, there exists $m \geq 1$ such that $L \subseteq \mathbb{Q}_p(\zeta_m)$. Since $\mathbb{Q}_p(\zeta_m) \subseteq \bigcup_{n \geq 1} \mathbb{Q}_p(\zeta_n)$, every finite abelian extension of $\mathbb{Q}_p$ is contained in $\bigcup_{n \geq 1} \mathbb{Q}_p(\zeta_n)$.
Conversely, each $\mathbb{Q}_p(\zeta_n)$ is an abelian extension of $\mathbb{Q}_p$: the Galois group $\operatorname{Gal}(\mathbb{Q}_p(\zeta_n)/\mathbb{Q}_p)$ is a subgroup of $(\mathbb{Z}/n\mathbb{Z})^\times$ (via the cyclotomic character $\sigma \mapsto a$ where $\sigma(\zeta_n) = \zeta_n^a$), which is abelian. Therefore $\mathbb{Q}_p(\zeta_n) \subseteq \mathbb{Q}_p^{\mathrm{ab}}$ for every $n$, and $\bigcup_{n \geq 1} \mathbb{Q}_p(\zeta_n) \subseteq \mathbb{Q}_p^{\mathrm{ab}}$.
Combining both inclusions:
\begin{align*}
\mathbb{Q}_p^{\mathrm{ab}} = \bigcup_{n \geq 1} \mathbb{Q}_p(\zeta_n).
\end{align*}
[/step]
[step:Show $\mathbb{Q}_p(\zeta_n)/\mathbb{Q}_p$ is unramified when $(n, p) = 1$]
Let $n \geq 1$ with $(n, p) = 1$. The $n$-th cyclotomic polynomial $\Phi_n(t)$ divides $t^n - 1$. Since $(n, p) = 1$, the polynomial $t^n - 1$ has no repeated roots in $\overline{\mathbb{F}_p}$ (its derivative $nt^{n-1}$ has $n \neq 0$ in $\mathbb{F}_p$, and shares no root with $t^n - 1$ since $0$ is not a root of $t^n - 1$). Therefore $\Phi_n(t) \bmod p$ is separable over $\mathbb{F}_p$.
The extension $\mathbb{Q}_p(\zeta_n)$ is generated over $\mathbb{Q}_p$ by a root of $\Phi_n(t) \in \mathbb{Z}_p[t]$, which is a monic polynomial with $p$-adic integer coefficients whose reduction modulo $p$ is separable. This implies $\mathbb{Q}_p(\zeta_n)/\mathbb{Q}_p$ is unramified: the residue field extension $k_{\mathbb{Q}_p(\zeta_n)}/\mathbb{F}_p$ is generated by the image $\bar{\zeta}_n$ of $\zeta_n$ modulo $\mathfrak{m}$, and $\bar{\zeta}_n$ is a primitive $n$-th root of unity in $\overline{\mathbb{F}_p}$ (since $\Phi_n$ remains separable modulo $p$). The residue degree equals the degree of the extension: $f = [\mathbb{Q}_p(\zeta_n) : \mathbb{Q}_p]$ and $e = 1$.
[guided]
The argument rests on the criterion for an extension of local fields to be unramified: $L/K$ is unramified if and only if it is generated by a root of a polynomial $f(t) \in \mathcal{O}_K[t]$ whose reduction $\bar{f}(t) \in k_K[t]$ is separable.
For $\mathbb{Q}_p(\zeta_n)$ with $(n, p) = 1$: the minimal polynomial of $\zeta_n$ over $\mathbb{Q}_p$ divides $\Phi_n(t)$, and $\Phi_n(t)$ divides $t^n - 1$. Since $p \nmid n$, the derivative $(t^n - 1)' = nt^{n-1}$ does not vanish at any $n$-th root of unity modulo $p$ (because $n \neq 0$ in $\mathbb{F}_p$ and $\zeta^{n-1} \neq 0$ for $\zeta \neq 0$). Therefore $t^n - 1$ is separable mod $p$, and so is its factor $\Phi_n(t)$. This ensures $\mathbb{Q}_p(\zeta_n)/\mathbb{Q}_p$ is unramified.
What fails when $p \mid n$? If $n = p^a m$ with $a \geq 1$, then $t^{p^a} - 1 = (t - 1)^{p^a}$ in $\mathbb{F}_p[t]$, so $\Phi_{p^a}(t) = \frac{t^{p^a} - 1}{t^{p^{a-1}} - 1}$ reduces to $\frac{(t-1)^{p^a}}{(t-1)^{p^{a-1}}} = (t-1)^{p^a - p^{a-1}}$ modulo $p$. This means $\Phi_{p^a}$ is totally ramified (indeed, $p^a - p^{a-1} = \varphi(p^a)$ is the degree and the extension $\mathbb{Q}_p(\zeta_{p^a})/\mathbb{Q}_p$ is totally ramified).
[/guided]
[/step]
[step:Show every finite unramified extension of $\mathbb{Q}_p$ is of the form $\mathbb{Q}_p(\zeta_n)$ with $(n, p) = 1$]
Let $L/\mathbb{Q}_p$ be a finite unramified extension of degree $d$. The residue field extension is $\mathbb{F}_{p^d}/\mathbb{F}_p$. The multiplicative group $\mathbb{F}_{p^d}^\times$ is cyclic of order $p^d - 1$, generated by a primitive $(p^d - 1)$-th root of unity $\bar{\alpha}$.
By Hensel's Lemma (applicable since the polynomial $t^{p^d - 1} - 1$ has $\bar{\alpha}$ as a simple root modulo $p$, as $(p^d - 1, p) = 1$), $\bar{\alpha}$ lifts to a root $\alpha \in \mathcal{O}_L$ of $t^{p^d - 1} - 1$. The element $\alpha$ is a primitive $(p^d - 1)$-th root of unity in $L$ (since its reduction $\bar{\alpha}$ has exact order $p^d - 1$, and the order of $\alpha$ in $L^\times$ is a multiple of the order of $\bar{\alpha}$ in $k_L^\times$; but $\alpha^{p^d - 1} = 1$, so $\operatorname{ord}(\alpha) \mid p^d - 1$, giving $\operatorname{ord}(\alpha) = p^d - 1$).
Therefore $\alpha = \zeta_{p^d - 1}$ (a primitive $(p^d - 1)$-th root of unity), and $L = \mathbb{Q}_p(\alpha) = \mathbb{Q}_p(\zeta_{p^d - 1})$. Since $p^d - 1$ is coprime to $p$ (as $p \nmid p^d - 1$), setting $n = p^d - 1$ gives $L = \mathbb{Q}_p(\zeta_n)$ with $(n, p) = 1$.
[guided]
This step shows that the unramified extensions of $\mathbb{Q}_p$ are "generated by the residue field": every unramified extension is obtained by lifting generators of the residue field extension via Hensel's Lemma.
The finite field $\mathbb{F}_{p^d}$ has a cyclic multiplicative group of order $p^d - 1$, generated by a primitive root $\bar{\alpha}$. Hensel's Lemma lifts $\bar{\alpha}$ to a root of unity $\alpha \in L$. The resulting extension $\mathbb{Q}_p(\alpha)$ has residue field $\mathbb{F}_p(\bar{\alpha}) = \mathbb{F}_{p^d}$, which has degree $d$ over $\mathbb{F}_p$. Since $\mathbb{Q}_p(\alpha)/\mathbb{Q}_p$ is unramified (shown in the previous step, since $(p^d - 1, p) = 1$) with residue degree $d$, we have $[\mathbb{Q}_p(\alpha) : \mathbb{Q}_p] = d = [L : \mathbb{Q}_p]$. Since $\mathbb{Q}_p(\alpha) \subseteq L$, we conclude $L = \mathbb{Q}_p(\alpha) = \mathbb{Q}_p(\zeta_{p^d - 1})$.
This argument generalises: for any local field $K$ with residue field $\mathbb{F}_q$, the unique unramified extension of degree $d$ is $K(\zeta_{q^d - 1})$.
[/guided]
[/step]
[step:Conclude $\mathbb{Q}_p^{\mathrm{ur}} = \bigcup_{(n,p)=1} \mathbb{Q}_p(\zeta_n)$]
By the previous two steps:
- If $(n, p) = 1$, then $\mathbb{Q}_p(\zeta_n)/\mathbb{Q}_p$ is unramified, so $\mathbb{Q}_p(\zeta_n) \subseteq \mathbb{Q}_p^{\mathrm{ur}}$. Taking the union: $\bigcup_{(n,p)=1} \mathbb{Q}_p(\zeta_n) \subseteq \mathbb{Q}_p^{\mathrm{ur}}$.
- Every finite unramified extension $L/\mathbb{Q}_p$ of degree $d$ satisfies $L = \mathbb{Q}_p(\zeta_{p^d - 1})$ with $(p^d - 1, p) = 1$. Therefore $L \subseteq \bigcup_{(n,p)=1} \mathbb{Q}_p(\zeta_n)$.
Since $\mathbb{Q}_p^{\mathrm{ur}} = \bigcup_{L/\mathbb{Q}_p \text{ finite unramified}} L$ (by definition of the maximal unramified extension), both inclusions give
\begin{align*}
\mathbb{Q}_p^{\mathrm{ur}} = \bigcup_{\substack{n \geq 1 \\ (n, p) = 1}} \mathbb{Q}_p(\zeta_n).
\end{align*}
[/step]