Relation between curves on a surface and divisors Given a projective surface $S$, the irreducible curves contained in $S$ are exactly, by definition, the prime (Weil) divisors of $S$. I was wondering what are reducible curves on $S$ in terms of divisors. To be more precise, I expect that I can associate a (Weil) divisor to any reducible curve. 
For instance let $D\subset S$ be a reducible curve and suppose that its irreducible components are $C_1$ and $C_2$. My guess is that $D$ is a Weil divisor on $S$ supported by $C_1$ and $C_2$, namely $D=\alpha C_1+\beta C_2$ with $\alpha,\beta\in\mathbb Z$. But what are $\alpha$ and $\beta$? What do they represent?
 A: Sure you can do that, you can even do that for every varieties (not necessarily projective) and closed subscheme of any dimension. This is the foundation of intersection theory. A standard reference for all that is Fulton's Intersection theory.
In your example, you are right that the associated Weil divisor would be $\alpha C_1 +\beta C_2$. In fact, the $\alpha$ would be the length of the ring $\mathcal{O}_{C,\eta_1}$ where $\eta_1$ is the generic point of $C_1$, and similarly for $C_2$. This is called the geometric multiplicity (note that it is positive).
For example, the subscheme $\operatorname{Spec}k[X,Y]/(X^2)$ of $\mathbb{A}^2$ gives twice the class of the $Y$-axis. Intuitively $\operatorname{Spec}k[X,Y]/(X^2)$ is the double $Y$-axis. More generally the class of $\operatorname{Spec}k[X,Y]/(X^n)$ would be $n$ times the class of the $Y$-axis.
As A.P. points out, there are other ways to define this multiplicity. However this is the only one that works everywhere. Here are two situation when it is useful to have other definitions :


*

*if the ambient variety $X$ is normal and the $C_i$ are codimension 1 closed subsets with generic point $\eta_i$, then $\mathcal{O}_{X,\eta_i}$ are discrete valuation rings with valuations $v_i$. Then if $f$ is a local parameter for $C$, then $\alpha=v_1(f)$.

*if $X$ is a curve over a field $k$ (not necessarily normal), $C_i=P_i$ and $I$ the ideal of $C$, then $\alpha=\dim_k\mathcal{O}_{X,P_i}/I$.

