I'm taking a course on differential geometry now, and we got the following exercise from the lecturer: compute the (de Rham) cohomology groups $H_{dR}^i(M)$ of your favourite space.
In all the examples I've seen, these groups are only calculated for easy spaces, like spheres, tori, or combinations of these, or spaces that can be built from these.
However, even for the basic example of a smooth hypersurface in $\mathbb R^n$, the zero set of a polynomial in $n$ variables, I have no clue how to proceed.
So the question is this: let $M$ be the zero set in $\mathbb R^n$ of a smooth polynomial (i.e. such that the partial derivates and the polynomial share no zeros) in $n$ variables. What is, and how can I compute the de Rham cohomology groups of $M$?
If that makes it easier, assume the polynomial is homogeneous of degree $d$. Then how can one compute the de Rham cohomology groups of the corresponding projective hypersurface in $\mathbb {P}_{\mathbb R}^n$?
Added: For that matter, one could also ask the same question with $\mathbb R$ replaced by $\mathbb C$.
There is a general algorithm for computation of (co)homology groups of real-algebraic subsets in $\mathbf{R}^n$. Being a hypersurface does not particularly help in this computation. The algorithm goes back to Tarski's work (on elimination of quantifiers).
The entire book Algorithms in Real Algebraic Geometry is pretty much all about such computations.
If you are dealing with complex projective varieties, then, in some range of dimensions, Lefschetz hyperplane theorem will allow you a dimension reduction. However, in the end of the day, you still have to do some dirty work (of algorithmic nature). See the book "Stratified Morse Theory", it is mostly about Lefschetz theorem in various forms. A good summary can be found here.