Riemann-Roch theorem for non-reduced curves. Ex 18.4 S of Vakil's book. I am working on the proof of the Riemann Roch theorem for non-reduced curves, which is ex 18.4S of Vakil's book. But I am stuck to show the following. 
Suppose $C$ is a reduced projective curve over a field $k$, (which could be reducible and singular), $\mathcal{F}$ is a coherent sheaf on $C$ and $\mathcal{L}$ is a invertible sheaf on $C$. Show that $\chi(\mathcal{L} \otimes \mathcal{F})-\chi(\mathcal{F})$ satisfies
\begin{equation}
\chi(\mathcal{L} \otimes \mathcal{F})-\chi(\mathcal{F})= \sum_i \text{deg}_{C_i} \mathcal{L}~\text{length}_{\mathcal{O}_{\eta_i}}~\mathcal{F}_{\eta_i}
\end{equation}
where the sum is over all the irreducible components $C_i$ of $C$ and $\eta_i$ is the generic point of component $C_i$. 
The hint is that the line bundle could be written as $\mathcal{O}(\sum n_j p_j)$ where $p_j$  are regular points of $C$ that are different from the associate points of $\mathcal{F}$ and then use induction. 
I do not know how to construct exact sequence to prove this.
 A: Let me denote that length with $\ell$.
Since $\chi(\cdot)$ and $\ell(\cdot)$ are additive w.r.t. exact, sequences, we easily see that given an exact sequence
$$0 \to \mathcal F' \to \mathcal F \to \mathcal F'' \to 0,$$
the claim holds for $\mathcal F$ if we know, that it holds for $\mathcal F'$ and $\mathcal F''$.
First, let us reduce to the integral case: Given the irreducible components $C=C_1 \cup \dotsc \cup C_r$ of $C$, we take $I$ to be the ideal of $C_1$ and consider the exact sequence
$$0 \to I \cdot \mathcal F \to \mathcal F \to \mathcal F/I \cdot \mathcal F \to 0$$
The sheaves $I \cdot \mathcal F$ and $\mathcal F/I \cdot \mathcal F$ are supported on $r-1$ and $1$ irreducible components respectively, hence the claim holds for $I \cdot \mathcal F$ and $\mathcal F/I \cdot \mathcal F$ by induction on the number of irreducible components. Thus we have reduced to the integral case.
Let us conclude: Let $\mathcal L = \mathcal O_C(\sum p_i)$ (The $p_i$ not necessarily distinct), such that the points $p_i$ avoid the associated points of $\mathcal F$. Denote by $\mathcal L' = \mathcal O_C(\sum_{i\neq 1} p_i)$ a line bundle with one point less. By induction, the claim holds for $\mathcal L'$.
Consider the exact sequence
$$0\to \mathcal O_C(-p_1) \to \mathcal O_C \to \mathcal O_{p_1} \to 0.$$
Since $p_1 \notin \operatorname{Ass} \mathcal F$, the sequence remains exact after tensoring with $\mathcal F \otimes \mathcal L$:
$$0\to \mathcal L' \otimes \mathcal F \to \mathcal L \otimes \mathcal F \to \mathcal O_{p_1} \otimes \mathcal L_{|p_1} \otimes \mathcal F_{|p_1} \to 0.$$
We obtain
$$\chi(\mathcal L \otimes \mathcal F) = \chi (\mathcal L' \otimes \mathcal F) + H^0(p_1,\mathcal O_{p_1} \otimes \mathcal L_{|p_1} \otimes \mathcal F_{|p_1})=\chi(\mathcal F)+ \deg_C \mathcal L' \cdot \ell(\mathcal F_\eta) + H^0(p_1,\mathcal F_{|p_1}).$$
To finish the proof, we have to show $\dim_k H^0(p_1,\mathcal F_{|p_1}) = \ell(\mathcal F_\eta)$, i.e. we have to show
$\dim_k \mathcal F_{p_1}/\mathcal m_{p_1} \mathcal F_{p_1} = \dim_{k(C)} \mathcal F_\eta$.
By the assumption on the associated points, we have that $\operatorname{Ass}_{\mathcal O_{C,p_1}} (\mathcal F_{p_1})$ does not contain the maximal ideal $m_{p_1}$. But $\mathcal O_{C,p_1}$ is a DVR, hence there are only 2 prime ideals. Thus $\operatorname{Ass}_{\mathcal O_C,{p_1}} (\mathcal F_{p_1}) = \{(0)\}$, which means that $\mathcal F_{p_1}$ is torsion-free and thus free, since $\mathcal O_{C,p_1}$ is in particular a PID. For free modules over local domains $(A,\mathfrak m)$, the dimensions $\dim_{A/\mathfrak m} M/\mathfrak mM$ and $\dim_{\operatorname{Frac} A} M \otimes \operatorname{Frac} A$ coincide.
