# Euler characteristic of a surface in $\mathbb{R}^3.$

Suppose I have a (smooth) surface in $\mathbb{R}^3,$ given as (a component of) a real algebraic hypersurface. Is there a good algorithm (assuming, for example, we can compute intersections with lines or planes reasonably quickly) for computing the Euler characteristic of the surface?

• A good algorithm for what? – Sasha Jul 25 '16 at 19:00
• @Sasha For computing the euler characteristic/genus (fixed the text, as well). – Igor Rivin Jul 25 '16 at 19:24

You can assume that the $z$ function is Morse, compute the critical points (solve a Lagrange multiplier problem) and their indices (compute a second derivative), and remember that $\chi (S)= \sum _{c } (-1)^{index (c)}$.
• Not at all : once you know a critical point $(x_0,y_0,z_0)$ you can think that the surface is given by $z(x,y)$. To compute second derivative $\partial ^2_x z (x_0,y_0,z_0)$, juts derive twice $f(x,y,z(x,y))$. Or derive once $f'_x(x,y,z(x,y))+f'_z(x,y,z) \partial _x z$, yiu get $f"_x(x_0,y_0,z_0)+f"_zz (x_0,y_0,z_0)\partial ^2_x z (x_0,y_0,z_0)=0$, as $\partial _x z(x_0,y_0,z_0))=0$. What seems more tricky is to find easily the number of connected components – Thomas Jul 26 '16 at 15:29