Relating ramification index of a map of curves to degree of vanishing I am little confused about explicitly computing ramification index and relating it to degree of vanishing a polynomial. In particular I have the following example (when trying to prove the genus formula explicitly):
Say I have a degree $d$ smooth curve in $\mathbb{P}^2$ called $C$ and suppose that $[0:1:0] \not\in C$. I define a map $\phi: C \rightarrow \mathbb{P}^1$ by $[X:Y:Z] \rightarrow [X:Z]$. The ramification index of $e_{\phi}(P)$ is defined to be $ord_P(\phi^*t_{\phi(P)})$. I want to say that the ramification index at $P = [X_0:Y_0:Z_0]$ is the degree of vanishing of the polynomial $F(X_0,Y,Z_0)$ at $P$. That is to say that, in particular, $e_{\phi}(P) >1$ if and only if $\frac{\partial F}{\partial Y}(X_0,Y_0,Z_0) = 0$. 
So my approach was to take the function $\mathbb{P}^1 \rightarrow k, [X:Y] \mapsto X- X_0$ as the uniformizer at $\phi(P)$ so we are computing $ord_P(X-X_0)$ but I can't quite rigorously say why this is exactly the order of vanishing of $\frac{\partial F}{\partial Y}(X_0,Y,Z_0)$. 
If anyone could proceed along this line or maybe just say why it's wrong, I would be super appreciative!
 A: Well, since ramification is a purely local phenomenon (since you compute it in the stalks of the respective schemes), it suffices to consider the affine analogue of your question. Namely, let $f(x,y)$ be the affinization of your curve $C$ (which, without loss of generality, I assume is monic in $y$) and replace $\mathbb{P}^1$ with $\mathbb{A}^1$.
You then are looking at the composition of the embedding of $V(f)$ into $\mathbb{A}^2$, followed by the projection of $\mathbb{A}^2$ onto $\mathbb{A}^1$. In terms of the algebra maps you're looking at the $k$-algebra map $k[t]\to k[x,y]/(f)$ defined by $t\to x$. 
Now, it looks like you are taking a $k$-point $p=(x-x_0,y-y_0)\in V(f)(k)$, and are asking what the ramification of our defined map is at $p$. Well, the image of this point $p$ under our map is the point $(t-x_0)$, and so we should restrict our attention to the natural induced map on the stalks, given by $k[t]_{(t-x_0)}\to k[x,y]/(f)_{(x-x_0,y-y_0)}$. The image of the uniformizer $t-x_0$, is just the element $x-x_0$. So, we're really after the order of $x-x_0$ in $k[x,y]/(f)_{(x-x_0,y-y_0)}$. 
But, since our curve is smooth, we know that $k[x,y]/(f)$ is a Dedekind domain, and so $k[x,y]/(f)$ over $k[t]$ is a simple extension of Dedekind domains, with generating polynomial $f$. So, the factorization of the ideal $(x-x_0)k[x,y]/(f)$ can be achieved by factoring $f$ in $k[x,y]/(x-x_0)$, or in other words, factoring $f(x_0,y)$. So, factor $f(x_0,y)$ as
$$f(x_0,y)=c\prod_{i=0}^{m}(y-y_i)^{e_i}$$
Then, the Dedekind-Kummer theorem tells you that $(x-x_0)k[x,y]/(f)$ factors precisely as 
$$(x-x_0)k[x,y]/(f)=\prod_{i=0}^m(x-x_0,y-y_i)^{e_i}$$
and so, in particular 
$$(x-x_0)(k[x,y]/(f))_{(x-x_0,y-y_0)}=(x-x_0,y-y_0)^{e_0}(k[x,y]/(f))_{(x-x_0,y-y_0)}$$
which says precisely that $\text{ord}_{(x_0,y_0)}(x-x_0)=e_0$. 
So, you see that the ramification is related to the order of vanishing of $f(x_0,y)$. The reason why you knew it had to be a univariate polynomial for which the order of vanishing corresponds to the ramificaiton, is that order of vanishing doesn't make sense (a priori) for polynomials in more than one-variable!
EDIT: Here is a more geometrically satisfying way to understand what is happening. To 'see' the picture, let's assume that $k=\overline{k}$, and assume that $f$ is monic in $y$. Since unramifiedness is a fiber local property, one can check unramifiedness only on fibers.
So, what is the geometric picture of what's happening here. Well, $V(f)$ is cutting out some curve inside of $\mathbb{A}^2$, and we're essentially projecting this curve onto the $x$-axis, by the projection map $\pi$. Now, intuitively, a curve is ramified at a point above $x_0\in\mathbb{A}^1$ precisely when the fibers of the curves 'ramify', or come together. And, intuitively, this happens precisely when there are less than the expected number of points (which 
So, how do we check this 'coming together' property? Well, since we're only curious about points above $x_0$, we may as well restrict our attention from all of $V(f)$ to just the fiber over $x_0$. Scheme theoretically, this corresponds to the following fibered diagram
$$\begin{matrix}\pi^{-1}(x_0) & \to & V(f)\\ \downarrow & & \downarrow\\ \text{spec}(k[x]/(x-x_0)) & \to & \mathbb{A}^1\end{matrix}$$
But, this tells us that 
$$\pi^{-1}(x_0)=\text{Spec}(k[x,y]/(f)\otimes_{k[x]}k[x]/(x-x_0)=\text{Spec}(k[y]/(f(x_0,y))$$
So, let's factor $\displaystyle f(x_0,y)=\prod_{i=0}^m (y-y_i)^{e_i}$, where $(x_0,y_i)$ are precisely the points lying over $x_0$ and $m$ is the degree. But, you see that this has precisely the right number of points when all the $e_i$ are $1$, or equivalently when $f(x_0,y)$ and $f_y(x_0,y)$ are coprime (i.e. $f(x_0,y)$ is separable).
Of course, we needn't actually restrict to the case of alg. closed. Then, what happens is that the fiber is still $k[y]/(f(x_0,y))$, but now $f(x_0,y)$ only factors as $\displaystyle \prod_{i=0}^{\ell}g_i(y)^{e_i}$ for some irreducible polynomials $g_i(y)$. But, the only (finite type) unramified morphisms to the spectrum of a field are finite disjoint unions of spectra of unramified extensions. But, this happens with $\text{Spec}(k[y]/(f(x_0,y))$ if and only if $e_i=1$ for all $i$.
