It's been a while so I'm not sure if you've already figured it out, but it may nonetheless help someone else out in that case.
We want to show that $$
\operatorname{rk}_L \Omega_{L/K} = \operatorname{tr.deg}_K L + \operatorname{rk}_L \Gamma_{L/K/k},
$$
where $k$ is perfect, $K$ is an extension of $k$ with $\operatorname{char}(K) = p$ and $L = K(\alpha)$ with $\alpha^p = a \in K$ but $\alpha \notin K$.
It is clear that $\operatorname{tr. deg}_K L = 0$, so we have to show that $$
\operatorname{rk}_L \Omega_{L/K} = \operatorname{rk}_L \Gamma_{L/K/k}.
$$
Note that $L = K(\alpha)$, so $\Omega_{L/K} = L d\alpha$ hence has rank one. Thus we have to show $\operatorname{rk}_L \Gamma_{L/K/k} = 1$.
Writing $L = K[X]/(X^p -a)$, we consider the second fundamental exact sequence (*)
$$
\mathfrak m/\mathfrak m^2 \xrightarrow{\delta} \Omega_{K[X]/k} \otimes_{K[X]} L \xrightarrow{\gamma} \Omega_{L/k} \to 0,
$$
where $\mathfrak m = (X^p - a)$. Here, $\delta$ sends an element $f \bmod \mathfrak m^2$ to $d_{K[X]/k}(f) \otimes 1$ and $\gamma$ sends $d_{K[X]/k}(a) \otimes b$ to $bd_{L/k}(q(a))$, with $q : K[X] \to L$ the standard quotient map.
For the middle term, we have that any derivation of $D \in \operatorname{Der}_k(K, T)$ extends to a derivation in $\operatorname{Der}_k(K[X], T)$ (simply apply the derivation $D$ to the coefficients), so the exact sequence $$
0 \to \Omega_{K/k} \otimes_K K[X] \xrightarrow{p} \Omega_{K[X]/k} \to \Omega_{K[X]/K} \to 0$$ is split (note the map $p$, we need it later). This is theorem 25.1.2) in Matsumura, however he requires $K[X]$ to be $0$-smooth instead. I don't know if this is equivalent to being able to extend every derivation, however $0$-smooth implies the former and is the only thing needed for the proof to work.
As a consequence, we have that $$
\Omega_{K[X]/k} = (\Omega_{K/k} \otimes_K K[X]) \oplus \Omega_{K[X]/K} = (\Omega_{K/k} \otimes_K K[X]) \oplus K[X] dX.
$$
Thus, the middle term $\Omega_{K[X]/k} \otimes_{K[X]} L$ is equal to (**) $$
\Omega_{K[X]/k} \otimes_{K[X]} L = (\Omega_{K/k} \otimes_K L) \oplus L d\alpha.
$$
We are now almost done. As stated in your post, we have $d_{K/k}(a) \neq 0$. So $d_{K[X]/k}(a) = p(d_{K/k} a \otimes 1)$ is nonzero. Letting $f = X^p - a$, we have that $\delta(f) = d_{K[x]/k}(f) \otimes 1 = -(d_{K[X]/k}(a) \otimes 1)$ since $df = pX^{p-1}dX - da$ and $\operatorname{char} K = p$. In particular, this is nonzero.
So, since $\delta(f)$ is nonzero and lands in the first summand of $$\Omega_{K[X]/k} \otimes_{K[X]} L = (\Omega_{K/k} \otimes_K L) \oplus L d\alpha,$$ the kernel of $\Omega_{K/k} \otimes_K L \to \Omega_{L/k}$ is of rank one, i.e. $\operatorname{rk}_L \Gamma_{L/K/k} = 1$. This is what we wanted to show.
You can proceed exactly as in the case of $\mathbb{Z}/n\mathbb{Z}$.
Fix a prime power $q$, and let $\varphi(f)$ be the cardinality of the group of units of $\mathbb{F}_q[X]/(f)$, where $f$ is a nonzero polynomial of $\mathbb{F}_q[X]$. Because of the Chinese Remainder Theorem, $$\varphi(f_1f_2)=\varphi(f_1)\varphi(f_2) \mbox { whenever }gcd(f_1,f_2)=1.$$ Hence, it is enough to compute $\varphi(\pi^r)$, where $\pi$ is irreducible and $r\geq 1$. But a polynomial is NOT coprime to $\pi^r$ if and only if it is NOT coprime to $\pi$, since $\pi$ is irreducible. Now an element of $\mathbb{F}_q[X]/(\pi^r)$ maybe represented by a unique polynomial of degree $\leq \deg(\pi^r)-1=\deg(\pi)r-1$. So we have to count the number of multiples of $\pi$ of degree $\leq \deg(\pi)r-1$. There are exactly the polynomials of the form $\pi g,$ where $\deg(g)\leq \deg(\pi)(r-1)-1$, so there are exactly $q^{\deg(\pi)(r-1)}$ such polynomials.
All in all, $$\displaystyle \varphi(\pi^r)=q^{\deg(\pi)r}-q^{\deg(\pi)(r-1)},$$
and $$\varphi(f)=\prod_{\pi\mid f}(q^{\deg(\pi)r_\pi}-q^{\deg(\pi)(r_\pi-1)})=\prod_{\pi\mid f}(q^{\deg(\pi)(r_\pi-1)}(q^{\deg(\pi)}-1)),$$
where $\pi$ runs through the irreducible monic divisors of $f$ and $r_\pi$ is the power of $\pi$ in the decomposition of $f$ into irreducible factors.
In your example, $f=X^3+1=(X+1)^3\in\mathbb{F}_3[X]$, so $\varphi(f)=3^3-3^2=18$.
Best Answer
Let $p(x) = c_n x^n + \cdots + c_1 x + c_0$. Then: $$ p(x) = p(x) - p(a) = c_n (x^n - a^n) + \cdots + c_1 (x - a) $$ But over any ring $x - a \mid x^k - a^k$.