Let $C$ be an effective Cartier divisor on a complete surface $ X $.
I'm looking for a proof of the following : $$ (C^2 )_X = \int_C c_1 (N) $$
where $ N $ is the normal bundle of $ C $ in $ X $.
If $C$ and $X$ are non-singular, and $ i $ is the inclusion of $ C $ in $ X $, then $ N = i^* T_X / T_C $, so $$ (C^2 )_X = \int_C c_1 ( i^* T_X ) - c_1 (T_C ) $$
Equivalently, $$ ( C \cdot (C+K))_X = 2 g - 2 $$ where $ K = - c_1 ( T_X ) $ is the canonical divisor class of $ X $, and $ g $ is the genus of $ C$.
In case $X$ is a non-singular surface of degree $d$ in $ \mathbb{P}^3 $, $$ (C^2 )_X = 2g - 2 + (4 - d) \mathrm{deg} (C) $$
There's Example 3.2.14 in Fulton's book on intersection theory which briefly mentions this, but it does not give a reference. Can someone help me out with one ?
Thanks in advance.