Let $k $ be a not perfect field and $\operatorname{char}(k)=p>0$. Let $a \in k \setminus k^{p}$. Let $Y=\dfrac{X^{p^2}}{X^p+a}$. Prove that $[k(X):k(Y)]=p^2$, and the separable closure of $k(Y)$ in $k(X)$ is $k(X^p)$.
First, I used the polynomial $P=T^{p^2}-yT^p-ya$, but how to prove that $P$ is irreducible? I think in Luroth theorem.
As $X$ is a root of the polynomial $P(T)=T^{p^2}-YT^p-Ya \in k(Y)[T]$, we have $[k(X):k(Y)] \le p^2$. $Y$ is transcendental over $k$ as otherwise $X$ would be algebraic over $k$. This implies that $k[Y]$ is a unique factorization domain.
$Y$ is irreducible in $k[Y]$ and $Y^2$ doesn't divide $Ya$. We can apply Eisenstein's criterion to conclude that $P$ is irreducible over $k[Y]$ and also over $k(Y)$ according to Gauss lemma. Finally $[k(X):k(Y)] = p^2$ and $P$ is the minimal polynomial of $X$ over $k(Y)$.
Denote $K = k(Y)$. The separable closure $K_s$ of $K$ in $k(X)$ is the set of elements of $k(X)$ which are separable over $K$. It is a separable extension of $K$ such that $K \subset K_s \subset k(X)$. In fact $K_s \neq k(X)$ as $X$ is inseparable over $K$ as the derivative of $P$ is equal to zero. Therefore $[K_s : K]$ belongs to $\{1, p \}$ as it divides $p^2$ and is not equal to $p^2$.
In a similar way as above, we can prove that the polynomial $Q(T)=T^p-YT-Ya \in K[T]$ is irreducible over $K$. $X^p$ is a separable root of $Q$ as $Q'(T)=-Y \neq 0$. Therefore we have $k(X^p) \subset K_s$ and finally $K_s=k(X^p)$ as $[k(X^p):k(Y)]=p$.