Questions about the canonical class of a nonsingular projective surface. Let $ X $ be a nonsingular projective surface. Consider the so-called adjunction formula $$ g_{C} = \frac{1}{2}C(C+K_{X}) + 1,   $$ where $ g_{C} $ is the genus of a curve $ C $ on $ X, $ and $ K_{X} $ is the canonical class of $ X. $ 

There is an example of an application of this which I am having a bit of trouble with.

Let $ X = \mathbb{P}^{2} $ then $ \operatorname{Cl}X = \mathbb{Z}, $ with generator $ L, $ the class containing all the lines of $ \mathbb{P}^{2}. $ If $ C \subset \mathbb{P}^{2} $ has degree $ n $ then $ C \sim nL. $ In view of $ K = -3L $ and $ L^{2} = 1, $ in this case the adjunction formula  yields $$ g = \frac{n(n-3)}{2} + 1 = \frac{(n-1)(n-2)}{3}. $$

(1) I'm not sure why $ C $ is linearly equivalent to $ nL. $ 
(2) I don't really see why $ K = -3L, $ because I don't know how to calculate $ K_{X} $ for $ X = \mathbb{P}^{2}. $ I know that the canonical class $ K_{X} = \operatorname{dim}_{k}\Omega^{n}(X), $ but I'm not sure where to go from here.  
 A: For question 1), consider the line bundle associated to each divisor: they're both $\mathcal{O}(n)$.
For 2), recall that the canonical sheaf of a smooth variety is just the sheaf of top differential forms, which can be calculated by taking the top exterior power of the sheaf of differential forms. By the Euler exact sequence $$0\to \Omega_{\Bbb P^n}^1 \to \mathcal{O}_{\Bbb P^n}(-1)^{n+1} \to \mathcal{O}_{\Bbb P^n} \to 0 $$ we get that $\Omega^n_{\Bbb P^n} \cong (\bigwedge^n\Omega^1_{\Bbb P^n})\otimes(\mathcal{O}_{\Bbb P^n})\cong \bigwedge^{n+1}\mathcal{O}_{\Bbb P^n}(-1)^{n+1}\cong \mathcal{O}_{\Bbb P^n}(-n-1)$. So $\Omega_{\Bbb P^2}^2=\mathcal{O}_{\Bbb P^2}(-3)$ as requested.
A: Here's another answer from a slightly different perspective.
1) Let $F(X,Y,Z) = 0$ be the equation for $C$. If $(s:t)$ are homogeneous coordinates on $\mathbb P^1$, then $sF + tX^n = 0$ is a flat family of curves over $\mathbb P^1$ with both $C$ and an $n$-fold line as fibers. If you don't like non-reduced schemes, you could replace $x^n$ with any product of $n$ distinct linear forms in $X,Y,Z$ and the same thing happens.
2) One way to calculate the degree of the canonical bundle is to just write down a section and examine its zeros and poles. So start with one chart with coordinates $(x,y)$, and consider the form $dx \wedge dy$. We'll assume this is the $Z\ne 0$ chart, so $(x,y) = (X/Z,Y/Z)$. Now if we look in the $Y \ne 0$ chart, we have coordinates $(x',z') = (X/Y,Z/Y)$, yielding $x = x'/z'$ and $y = 1/z'$. Plugging in the transition functions, we get $dx \wedge dy = \left(\frac{dx'}{z'} - \frac{x'dz'}{(z')^2}\right)\wedge\left(-\frac{dz'}{(z')^2}\right) = \frac{dx' \wedge dz'}{(z')^3}$. I won't do the calculation in the last chart because it's basically the same. The upshot is that this $2$-form has no zeroes, and a pole of order $3$ along the line $Z=0$. Thus the class of the canonical bundle is $-3L$.
