Valuation of the different for totally ramified extensions I'm trying the following two exercises from Andrew Sutherland's MIT Number Theory 1 problem sets.
Fix an odd prime $p$.

*

*Let $L/\mathbb Q_p$ be a totally ramified extension of degree $p$ with uniformizer $\pi$ and different $\mathcal D$. Show that $v_\pi(\mathcal D) = 2p-2$.


*Same as previous, but degree is $p^2$. Show that $v_\pi(\mathcal D) = 3p^2 - p - 2$.
Let's start with 1. Here's what I know. Since $L/\mathbb Q_p$ is totally ramified of degree $p$, it is wildly ramified, and $\mathcal O_L = \mathbb Z_p[\pi]$ where $\pi$ is the uniformizer and the minimal polynomial of $\pi$ is an Eisenstein polynomial, say $f(T) = T^p+a_1T^{p-1}+\cdots+a_p$. Then
$$v_\pi(\mathcal D) = v_\pi(f'(\pi)) = v_\pi(p\pi^{p-1}+(p-1)a_{1}\pi^{p-2}+\cdots+a_p).$$
The valuations of each term are distinct, so $v_\pi(f'(\pi))$ is the max of $p\pi^{p-1}$, $(p-1)a_1\pi^{p-2}$, etc. The issue is, each $a_i$ is divisible by $\pi$ and in $\mathbb Z_p$, so is divisible by $p$. Hence $v_\pi((p-i)a_i\pi^{p-i}) = v_\pi(a_i)v_\pi(\pi^{p-i}) = v_p(a_i)+p-i$ and $v_\pi(p\pi^{p-1}) = 2p-1$. But $2p-1>2p-2$ which should be the answer. What have I done wrong?
I also see why this can't be the case. Indeed, $v_\pi(\mathcal D) = \sum_{i\geq 0}(\#G_i-1)$, and if $G = \operatorname{Gal}(L/\mathbb Q_p)$. Since $|L:\mathbb Q_p|=p$ and $L$ is wildly ramified, we must have $\#G_0 = \#G_1 = p$, and I this forces $\#G_i = 1$ for $i\geq 2$ (I don't know how to justify this), so according to this formula, we have
$$v_\pi(\mathcal D) = (\#G_0-1) + (\#G_1-1) = (p-1)+(p-1) = 2p-2$$
which gives the correct answer. How do I justify $G_2$ trivial and reconcile this correct answer with the wrong approach above?
The problem persists for degree $p^2$. With the same approach as above, the minimal polynomial of $\pi$ would be $f(T) = T^{p^2} + a_1T^{p^2-1} + \cdots + a_{p^2}$, so
$$f'(\pi) = p^2\pi^{p^2-1} + (p^2 - 1)a_1T^{p^2-2}+\cdots$$
and I run into similar issues as above with the valuation. However, using the "higher ramification formula", the answer must be $\#G_0 = \#G_1 = p^2$, and $\#G_i = p$ for $i=2,\dots,p+2$, because
$$\sum_{i\geq 0}(\#G_i - 1) = 2(p^2-1) + p(p-1) = 3p^2 - p-2$$
but I don't know how to compute these cardinalities.
Overall, I have two questions. First, why is my approach to compute the valuation of $f'(\pi)$ directly not giving the right answer?
Second, how do I compute $\#G_i$ to get the answer using the "higher ramification series"? Or would one calculate this "post hoc" only after having computed $v_\pi(\mathcal D)$?
Any help would be greatly appreciated!
 A: You are close. Here are a few things that should help. First, the valuation of the different is the minimum of the terms $v_{\pi}(a_i) + (p-i)$; not the maximum.
Second, you need the extension $L/\mathbb{Q}_p$ to be a totally ramified Galois extension. The two results you mention are not necessarily true if the extension is merely totally ramified. For example, consider the extension of $\mathbb{Q}_p$ defined by the Eisenstein polynomial $x^p+px+p$; the valuation of the different is $p$.
Third, for a totally ramified extension of $\mathbb{Q}_p$ of degree $n$ with uniformizer $\pi$ and different $D$, it's important to remember that $v_{\pi}(D)$ is bounded below by $n-1$ and above by $v_{\pi}(n)+(n-1)$; you can prove this by analyzing $v_{\pi}(f'(\pi))$ for Eisenstein polynomials $f(x)$. The upper bound is helpful in establishing the two results you mention. If $n=p$, the upper bound is $2p-1$. If $n=p^2$, the upper bound is $3p^2-1$.
Fourth, let $G$ be the Galois group of $L/\mathbb{Q}_p$ and $G_i$ the $i$-th ramification subgroup of $G$. It is helpful to remember that the integers where $G_i \neq G_{i+1}$ are congruent mod $p$ and, in these cases, $\#(G_i/G_{i+1}) = p$. See Serre's book on Local Fields for proofs, if desired.
To prove item 1, you are correct that $\#G = \#G_0 = \#G_1 = p$, since the extension is totally ramified. If it were the case that $\#G_2 = p$, then $v_{\pi}(D) = \sum_{i\geq0} (\#G_i-1) \geq 3(p-1) = 3p-3$. This is a contradiction since $p$ is odd and the upper bound for $v_{\pi}(D)$ is $2p-1$; by my third comment above. Thus $\#G_i = 1$ for $i\geq 2$, establishing the result.
Proving item 2 is similar in spirit. As before, $\#G = \#G_0 = \#G_1 = p^2$. We reach a contradiction if $\#G_2 = p^2$. To see this, notice that we will have $\#G_i\geq p$ for $3\leq i\leq p+2$ (by my fourth comment above). Therefore $v_{\pi}(D) = \sum_{i\geq0} (\#G_i-1) \geq 3(p^2-1)+p(p-1) = 4p^2-p-3$, which is larger than the upper bound of $3p^2-1$ since $p$ is odd.
It follows that $\#G_2 = p$, and thus $\#G_i = p$ for $2\leq i\leq p+1$ (again by my fourth comment above). If it were the case that $\#G_{p+2} = p$, this would then imply that $\#G_i = p$ for $2\leq i \leq  2p+1$. Therefore $v_{\pi}(D) = \sum_{i\geq0} (\#G_i-1) \geq 2(p^2-1)+2p(p-1) = 4p^2-2p-2$, which is again larger than the upper bound of $3p^2-1$ since $p$ is odd. Thus $\#G_i = 1$ for $i\geq p+2$, and this establishes the result.
