Let $Y\subset\mathbb{P}^n$ be a smooth variety of codimension two. Consider the blowup $X = Bl_Y\mathbb{P}^n$ of $\mathbb{P}^n$ along $Y$, and let $E$ be the exceptional divisor over $Y$. Then $E$ has a structure of $\mathbb{P}^1$bundle over $Y$. The anticanonical divisor is $$K_X = (n+1)HE.$$ I would like to compute $(K_X)^n$. For example if $Y\subset\mathbb{P}^3$ is a curve of degree $d$ and genus $g$, by Shafarevich "Algebraic Geometry V" Lemma 2.2.14, we have: $$E^3 = deg(N_{Y/\mathbb{P}^3}) = K_{\mathbb{P}^3}\cdot C2g+2 =4d2g+2.$$ and $$(K_X)^3 = 62+2g8d.$$ I would like to have a formula for the top selfintersection $(K_X)^n$ when $X$ is the blowup of a smooth subvariety $Y\subset\mathbb{P}^n$ of codimension two. Even for complete intersections of two hypersurfaces it would be good. More generally does there exists a formula for $(K_X)^n$ when $X$ is the blowup of $\mathbb{P}^n$ along a smooth subvariety of codimension $c$ (again, I would be happy with complete intersections)?
So you want to compute the intersection numbers $(H^p\cdot E^q)$, $p+q=n$.
Let me start with some notation. Let $b: X\rightarrow \mathbb{P}^n$ be the blowing up, $i:E \hookrightarrow X$ the embedding, $p:E\rightarrow Y$ the projection. Write one factor $E$ as $i_*1$ (in $CH(X)$, say) and use the projection formula twice: $$(H^p\cdot E^q)=(i^*E^{q1}\cdot p^*H_Y^p)=(p_*i^*E^{q1}\cdot H_Y^p)\quad \mbox{where }\ H_Y:=c_1(\mathcal{O}_{\mathbb{P}^n}(1))_{Y}\ .$$ We have $i^*E=h$, where $h$ is the first Chern class of the tautological line bundle $\mathcal{O}_E(1)$ on $E=\mathbb{P}(N^*_{Y/\mathbb{P}^n})$. The classes $s_m:=p_*h^{m+c1}$ (with $c=\mathrm{codim}(Y)$) are the Segre classes of $N_{Y/\mathbb{P}^n}$; they are easily calculated from the Chern classes, see Fulton Intersection Theory, Chapter 3. So the numbers $(H^p\cdot E^q)=(1)^{q1}s_{qc}\cdot H_Y^p$ can be calculated when you know the Chern classes of the normal bundle. In codimension 2 you just have two nonzero Chern classes, so the computation is relatively easy. For instance, if $n=3$ and $Y$ is a curve of degree $d$ and genus $g$, you find $(K_X^3)= 648d+2g2$.

$\begingroup$ I guess there is something wrong in your formula. For instace if we blowup a point in $\mathbb{P}^2$ the first two Segre classes of the conormal bundle are $s_0=1, s_1 = 2$. With your formula we get $E^2 = s_1 = 2$ and $HE = s_0 = 1$, instead of $E^2=1, HE = 0$. $\endgroup$ – user49214 Apr 9 '14 at 23:22

$\begingroup$ I see the point: my subscript of the Segre class was not the standard one, I edited. The (co)normal bundle of a point is of course trivial, so $s_0=1$, all the others $s_i$ are zero. This gives what you expect. $\endgroup$ – abx Apr 10 '14 at 5:13

$\begingroup$ Sorry to bother you abx but I think there is something wrong. For instance blow up a conic $Y\subset\mathbb{P}^3$. Then using your formula $E^3 = H^0\cdot E^3 = s_1$. The conormal bundle of the conic is $\mathcal{O}_Y(1)\oplus\mathcal{O}_Y(2)$. Therefore the first Chern class is $c_1 = 3$ and the first Segre class is $s_1 = 3$. We get $E^3 = 3$. But I guess the right number is $E^3 = 6$. $\endgroup$ – F_L Apr 15 '14 at 15:39

$\begingroup$ You are right for the sign, and I am right for the number. You must take $c_1$ on $Y$: so $\mathcal{O}_Y(1)$ has degree 2, and my formula gives $E^3=6$. Now I am wrong on the sign, because I followed Fulton and I didn't realize he doesn't use Grothendieck notation for $\mathbb{P}(E)$. So $N^*$ should be replaced by $N$, and then one gets indeed $E^3=6$. I have edited. Thanks! $\endgroup$ – abx Apr 15 '14 at 16:01