Solution (source code)

= Solution

For a \b[smooth] complex <projective plane> curve of degree $d$,
$$
\boxed{g=\frac{(d-1)(d-2)}2.}
$$
Project generically from a point outside the curve to a <projective line>. Its degree is $d$, by intersection with a generic line through the center. Ramification occurs when such a line is tangent. In coordinates for projection $[x:y:z]\mapsto[x:z]$, these points satisfy $F=F_y=0$. The polar has degree $d-1$, and Bézout gives total ramification $d(d-1)$; generic projection makes the ramification simple, or the intersection multiplicities can be read as the corresponding ramification orders. The <Riemann-Hurwitz formula> yields $2g-2=-2d+d(d-1)$ and hence the formula. The smoothness qualification is essential for <geometric genus>: singular plane curves have the same arithmetic degree-<genus> expression, while the <genus> of their normalization can be smaller.