We will use the criterion of Lemma 29.45.5 to check this. In both cases the ring map is integral. Thus it suffices to show that given a field $k$ and a ring map $\varphi : A \to k$ the $k$-algebra $B \otimes _ A k$ has a unique prime ideal whose residue field is equal to $k$ in case (1) and purely inseparable over $k$ in case (2). See Lemma 29.10.2.
In case (1) set $\lambda = 0$ if $\varphi (x) = 0$ and set $\lambda = \varphi (y)/\varphi (x)$ if not. Then $B = k[t]/(t^2 - \lambda ^2, t^3 - \lambda ^2)$. Thus the result is clear.
In case (2) if the characteristic of $k$ is $p$, then we obtain $\varphi (y) = 0$ and $B = k[t]/(t^ p - \varphi (x))$ which is a local Artinian $k$-algebra whose residue field is either $k$ or a degree $p$ purely inseparable extension of $k$. If the characteristic of $k$ is not $p$, then setting $\lambda = \varphi (y)/p$ we see $B = k[t]/(t - \lambda ) = k$ and we conclude as well.