Riemann-Hurwitz over non algebraically closed field I'm trying to understand where is the failure in Riemann-Hurwitz when the field $k$ is not algraically closed. Taking $f:X\to Y$ separable finite morphism between complete non singular curves. For me Riemann-Hurwitz says that
$$ 2-2g_X=\deg(f)(2-2g_Y)-\deg(R) $$
with $R$ the divisor
$$ R=\sum_P v_P(f^* ds/dt) P$$
where $s\in\mathcal{O}_{Y,f(P)}$ and $t\in\mathcal{O}_{X,P}$ are uniformizers.
I think that the problem is with $v_P(f^* ds/dt)$: it is not well defined in general because in $\Omega_{X/k,P}$ the element $dt$ is not a basis in general, because it is true if the residu field in $P$ is $k$ ie $P$ is a rationnal point.
So I'm seeking for a example in a $\Omega_{X/k,P}$ where $gdt=0$ and $g\neq 0$.
Idea: $X=\mathbb{A}^1_\mathbb{Q}=\text{Spec}(\mathbb{Q}[x])$, $P$ the point associated with the ideal $(x^2+1)$ (it is not rationnal). Here $\mathcal{O}_{X,P}=\mathbb{Q}[x]_{(x^1+1)}$ has uniformizer $t=x^2+1$. Problem: I can't find $g\in\mathcal{O}_{X,P}$ with $gdt=0$.
 A: The "failure" of Riemann-Hurwitz in the case when the base field isn't algebraically closed case can be fixed by counting degrees appropriately. Your statement that  $$2g_X-2 = \deg(f)(2g_Y-2) + \deg(R)$$ (where $X\to Y$ is a separable morphism of smooth proper curves over a base field $k$) is true no matter the base field. The problem is that you need to be more careful in your calculation of $\deg R$, because it's not just $\sum_P v_P(f^*ds/dt)$.
Write $R=\sum d_ip_i$. The degree of $R$ is defined to be $\dim_k \Gamma(R,\mathcal{O}_{R})$, which is equal to $\sum_{i} \dim_k \mathcal{O}_{R,p_i}$. When $k$ is algebraically closed, $\dim_k\mathcal{O}_{R,p_i}$ is just $d_i=v_{p_i}(f^*ds/dt)$, but if $k$ is not algebraically closed, it's $d_i \dim_k k(x_i)$. From here, one can make the standard calculation that $d_i = e_{p_i}-1$ and the formula becomes $$2g_X-2 = \deg(f)(2g_Y-2)+\sum [k(p_i):k](e_{p_i}-1).$$
If you're interested in further reading, I like Stacks' treatment, and Richard D. James' comment here may be helpful, where he recommends Rosen's Number Theory in Function Fields (I don't have a copy myself, so I can't vouch for it).
