Exercise on conditions for a ring to be normal The following is an exercise taken from my Commutative Algebra class: 

Let $R$ be a DVR and $a\neq0\in R$. Call $A=R[X,Z]/(Z^2+aX)$. Prove that $A$ is an integral domain and compute its dimension. Find necessary and sufficient conditions on $a$ so that $A$ is normal and if $A$ is not normal compute its normalization.

Call $\pi\in R$ the unique irreducible element and let $a=u\pi^n$ with $u\in R^\ast$. We proved that $A$ is normal iff $n=1$. We also proved that the localization $A[a^{-1}]=A[\pi^{-1}]$ is normal. To compute normalization in case $n>1$ we used the following argument: let $n=2h+1$, $h>0$ and consider the following maps
$$ A=\frac{R[X,Z]}{(Z^2+aX)}\to B=\frac{R[X,Y]}{(Y^2+u\pi X)}\to \frac{R[X,Z]}{(Z^2+aX)}[\pi^{-1}]  $$
described by $X\mapsto X$, $Z\mapsto \pi^hY$ and $X\mapsto X, Y\mapsto \pi^{-h}Z$. We claimed the two maps are injective by flatness (?) and that $B$ is integral over $A$ since it is generated as an $A$-module by the class of $Y$ which is of course integral over $A$ and this shows that $B$ is the normalization of $A$. I just can't see why the maps must be injective: what inclusion are we tensoring? Is $B$ a localization of $A$?
The only reason I could find is that the composition (maybe) is the localization map $A\to A[\pi^{-1}]$ and is thus injective and this explains why the first map should be injective, but what about the second one? 
And why did we treat just the case $n$ odd? 
 A: I will without loss of generality assume that $u = -1$ after making the change of variable $X \mapsto -uX$. Let $K := \operatorname{Frac}(R) \simeq R[\pi^{-1}]$ be the fraction field. Set $$ A_{n} := R[X,Z]/(Z^{2} - \pi^{n}X) $$ for any nonnegative integer $n \ge 0$. We have that $A_{0}$ is normal as well since the inclusion $R[Z] \to A_{0}$ is an isomorphism. Let $s_{n} : A_{n} \to A_{n}[\pi^{-1}]$ be the localization morphism. For any positive integer $n \ge 2$, let $$ \varphi_{n} : A_{n} \to A_{n-2} $$ be the $R[X]$-algebra homomorphism sending $Z \mapsto \pi Z$, and let $$ \varphi_{n}[\pi^{-1}] : A_{n}[\pi^{-1}] \to A_{n-2}[\pi^{-1}] $$ be morphism induced by inverting $\pi$, so that there is a commutative diagram $\require{AMScd}$
\begin{CD}
A_{n} @>{\varphi_{n}}>> A_{n-2} \\
@V{s_{n}}VV @VV{s_{n-2}}V\\
A_{n}[\pi^{-1}] @>>{\varphi_{n}[\pi^{-1}]}> A_{n-2}[\pi^{-1}]
\end{CD} of $R[X]$-algebras. The inclusion $R[Z] \to A_{n}$ induces an $R$-algebra isomorphism $K[Z] \simeq A_{n}[\pi^{-1}]$, hence each $\varphi_{n}[\pi^{-1}]$ is an isomorphism of $K$-algebras; thus each $\varphi_{n}$ is injective since $\varphi_{n}[\pi^{-1}]$ is an isomorphism and $s_{n}$ is injective. Since $\varphi_{n}$ is an $R[X]$-algebra homomorphism and each $A_{n}$ is finite over $R[X]$, we have that $\varphi_{n}$ is a finite map. Moreover $\operatorname{Frac}(A_{n}) \to \operatorname{Frac}(A_{n-2})$ is an isomorphism (corresponding to the field extension $K(Z) \to K(Z)$ sending $Z \mapsto \pi Z$).
Thus the normalization of $A_{2h}$ is the composition $\varphi_{2} \dotsb \varphi_{2h-2} \varphi_{2h}$, and the normalization of $A_{2h+1}$ is the composition $\varphi_{3} \dotsb \varphi_{2h-1} \varphi_{2h+1}$.
