Number of points of Jacobian of hypereeliptic curve of genus 2 I have a question about the exercise I found here on page 11: http://www.maths.bris.ac.uk/~matyd/DE/Stoll.pdf
If we  have a hyperelliptic curve $y^2=f(x)$ of genus $2$ over field $K$ we can prove that any point $P\in J(K)$ can be written in the form $P=[D_P]-[D_\xi]$ where $D_\xi$  is the given canonical divisor and $D_P\in Div_C(K)$ where $D_P$ is unique and effective of degree $2$. 
How can I use it to prove second part of exercise which says that:
$$\#J(F_p)=\frac{\#C(F_{p^2})+\#C(F_p)^2}{2}-p.$$
To me it seems I need to somehow count the number of classes in $Div_C(F_p)$ and get the expression on the right hand side?  Any  tips?
 A: Here is how to go about verifying such formulas. Let $F_q$ denote the $q$th power Frobenius. We compute $\#J(\mathbb{F}_p)$ by taking the alternating sum of the trace of $F_p$ on the cohomology groups $H_{\text{ét}}^i(J, \mathbb{Q}_\ell)$. But we have an isomorphism$$H_{\text{ét}}^i(J, \mathbb{Q}_\ell) = \bigwedge^i H_{\text{ét}}^1(J, \mathbb{Q}_\ell) \cong \bigwedge^i  H_{\text{ét}}^1(C, \mathbb{Q}_\ell).$$Now compute $\#C(\mathbb{F}_p)$ and $\#C(\mathbb{F}_{p^2})$ similarly, where the only difficult values are the traces of $F_p$ and $F_{p^2}$ on $H_{\text{ét}}^1(C, \mathbb{Q}_\ell)$. But since $\dim H_{\text{ét}}^1(C, \mathbb{Q}_\ell) = 4$ in our case — in general, it has dimension $2g(C)$ — and since the eigenvalues of Frobenius appear in pairs via duality, the traces of $F_p$ and $F_{p^2}$ give us full information. After that, it is just linear algebra, seeing what happens on the exterior tensor products, and manipulating formulas to eliminate the traces and replace them with the quantities $\#C(\mathbb{F}_p)$ and $\#C(\mathbb{F}_{p^2})$.
