Finding all primes above $x-a_i$ in the function field $y^2=(x-a_1)\cdots (x-a_n)$ This is a problem from Rosen's "Number Theory in Function Fields". Let $K=F(x,y)$ be a function field, such that $y^2=(x-a_1)\cdots (x-a_n)$, and all the elements $a_i$ are distinct. In $F(x)$ we have a prime $P_i$ for every $a_i$- its place is $O_{P_i}=F[x]_{<x-a_i>}$, and in it it is the (maximal) ideal generated by $x-a_i$. The prbolem is to prove that there is only one prime $\mathfrak{P}_i$ lying above $P_i$ in $K$, and that the ramification index of it is $2$. 
Now, I know that by general theory, we can get the set of primes lying above $P_i$ as follows: we take $R$ to be the integral closure of $O_{P_i}$ inside $K$. This is a Dedekind domain, and in particular it has unique factorization into primes ideals. We write $RP_i=p_1^{e_1}\cdots p_g^{e_g}$. Then, for every $j$, the localization $R_{p_j}$ is a dvr, with maximal ideal $p_j R_{p_j}$. This is a place lying above $P_i$, and all places are obtained this way. Moreover the ramification index is $e_j$. 
The problem is, how to find the integral closure in this case? Clearly, $y$ is integral over $O_{P_i}$, and moreover we can divide by any polynomial in $x$ only, which is not divisible by $x-a_i$ in the integral closure. But how can we find all the integral elements? 
 A: This is not much different from finding algebraic integers in a quadratic extension of $\Bbb{Q}$. In general it is a bit more taxing, but quadratic extensions can be handled. The arsenal of geometric tools would settle this quickly, but we can also do everything from first principles.
General basic theory of field extensions tells us that $\{1,y\}$ is a basis of $K$ over $F(x)$, so an arbitrary element $z\in K$ can be written in the form
$$
z=f_0(x)+yf_1(x)
$$
for some $f_0,f_1\in F(x)$. If $f_1\neq0$ then $z\notin F(x)$. We have
$$
(z-f_0)^2=y^2f_1^2=(x-a_1)(x-a_2)\cdots (x-a_n)f_1^2,
$$ 
so the minimal polynomial $m(T)$ of $z$ over $f(x)$ is
$$
\begin{aligned}
m(T)&=(T-f_0)^2-(x-a_1)(x-a_2)\cdots (x-a_n)f_1^2\\
&=T^2-2f_0T+[f_0^2-(x-a_1)\cdots (x-a_n)f_1^2].
\end{aligned}
$$
The element $z$ is integral over $O_{P_i}$ if and only if the coefficients of this minimal polynomial are in the ring $O_{P_i}$.
Assume that the characteristic is $\neq2$. Then the coefficient of the linear term, $2f_0\in O_{P_i}$ iff $f_0\in O_{P_i}$. With that settled we see that the linear term is in $O_{P_i}$ if and only if the product $(x-a_1)\cdots (x-a_n)f_1^2\in O_{P_i}$. A moments reflection reveals that this condition is equivalent to requiring $f_1$ to be in $O_{P_i}$. The reason is that if $f_1$ has a pole of order $\ge1$ at $P_i$, then $f_1^2$ has a pole of order $\ge2$. The other factor $(x-a_1)\cdots(x-a_n)$ cannot cancel that because it has $a_1$ as a simple zero only.

We have shown that the integral closure of $O_{P_i}$ is the ring 
  $$R_i=O_{P_i}[y]=\{f_0+f_1y\mid f_0,f_1\in O_{P_i}\}.$$

The next step is to show that an element of $R_i$ is a unit if and only if $f_0$
is a unit of $O_{P_i}$. This follows from 
$$
\frac1{f_0+y f_1}=\frac{f_0-yf_1}{f_0^2-(x-a_1)\cdots (x-a_n)f_1^2}.
$$
If $f_0$ is a unit, so is the denominator in the last form , call it $Q$ (the other term is a non-unit). More generally the two terms of $Q$ have zero orders of opposite parities at $P_i$, at least twice the minimum of zero orders of $f_0,f_1$. This quickly implies that an eventual zero at $P_i$ cannot be cancelled in both $f_0/Q$ and $-f_1/Q$. The claim follows.
This implies that the ideal $yR_i$ consists of exactly the non-units of $R_i$. Here we need that $a_i$ is a simple zero of the product $(x-a_1)\cdots (x-a_n)$ implying that 
$$x-a_i=\frac{y^2}{(x-a_1)\cdots(x-a_{i-1})(x-a_{i+1})\cdots (x-a_n)}\in y R_1.\qquad(*)$$
So we know that the ring $R_i$ is local, and $y$ is a generator of the unique maximal ideal $M_i$. The claims then follow from the definitions. Equation $(*)$ implies that $x-a_i\in M_i^2$ giving us the ramification.
