Rick Miranda's "The basic theory of elliptic surfaces" the Example (I.5.1) see page 7 on a pencil of plane curves contains an argument that I do not understand yet.


Let $C\_1$ be a smooth cubic curve in $\mathbb{P^2}$ and let $C\_2$ be any other cubic. By intersection theory and Bezout's theorem the intersection number $C\_1 \cdot C\_2$ is $9$. We form a pencil $P \subset \mathbb{P^2} $ generated by $C\_1$ and $C\_2$; it is the $\mathbb{P^1}$-family of curves (or more generally divisors) $[ \lambda C\_1 + \mu C\_2 ]$, which has $9$ base points $x\_1,..., x\_9$ . This gives only a rational map to $\mathbb{P^1}$. After blowing them up the fundamental locus of this rational map is resolved and we obtain a honest morphism $\pi: X \to \mathbb{P^1}$ where $X= \operatorname{Bl}(\mathbb{P}^2)\_{x\_1,..., x\_9}$ is the blowup of the plane at these $ 9 $ points.


Then it is claimed that the canonical class of $X$ is $-C\_1$ and that this implies that $K\_X^2= (-C\_1)^2 =0$.



> 
> **Question.** How to verify that the canonical class of $X$ equals $-C\_1$ and why does it have as consequence self-intersection number
> zero? The divisor $-C\_1$ is definitely not vertical and therefore I
> not see why its intersection with itself should vanish.
> 
> 
> 


(I posted identical [question](https://math.stackexchange.com/questions/4555014/blow-up-of-a-pencil-of-cubic-curves-mirandas-basic-theory-of-elliptic-surfaces) a week ago on MSE without getting any resonance. Hope that the question is not too elementary to be asked here.)



Blow-up of a pencil of cubic curves (from Miranda's basic theory of elliptic surfaces)
As explained in abx's comment, the canonical divisor of your surface is given by $$K\_X=-3 \pi^\*L + \sum E\_i,$$ and this is precisely the class of $-\widetilde{C}\_1$ (note that $C\_1$ is a curve in $\mathbb{P}^2$, so I put the tilde to specify that we are considering its strict transform in $X$).


Now, $\widetilde{C}\_1$ is the strict transform of a smooth cubic curve: since the self-intersection number of a cubic is $9$ and you are blowing up nine points on it, the self-intersection of the strict transform is $(C\_1)^2=9-9=0,$ as claimed.


Finally, the strict transform of your pencil of cubics is a base-point free pencil of elliptic curves in $X$, providing an elliptic fibration $\pi \colon X \to \mathbb{P}^1$, endowed with nine sections corresponding to the nine exceptional divisors of the blow-up. By construction, the curve $\widetilde{C}\_1$ is a fibre of $\pi$, hence it *is* a "vertical divisor", after all.


