integral of closed differential form

This is my first course in differential forms so it might be a trivial question. If $\mu$ is a $n-1$-form on $n$-dim manifold $X$ the book uses that

$$\int_X{d\mu}=0.$$

Is this expression valid for all $\mu$ and $X$? If that is true doesn't by Stokes theorem follow that $\int_{\partial X}\mu=0$ for every $\mu$?

-
No, not all forms are closed. –  Muphrid May 9 '13 at 14:13
Is it true $\int_X\mu=0$ for closed $\mu$? –  John Peter May 9 '13 at 14:15
What you have written is not true in general. Is there some other condition on $X$ which you've forgotten to mention? Is $X$ a closed manifold? –  Santiago Canez May 9 '13 at 14:15
Well I am interested in what conditions on $X$ and $\mu$ I need to impose. The book I am using does not state them explicitly in the computation. Is it enough that $X$ is compact? –  John Peter May 9 '13 at 14:17
So $X$ is a manifold with boundary? This was not clear from the outset. –  Harald Hanche-Olsen May 9 '13 at 14:18

If $X$ is an $n$-dimensional manifold with boundary then for any $n-1$-form $\mu$ with compact support, $$\int_Xd\mu=\int_{\partial X}\mu.$$ This is Stokes' theorem. If there is no boundary, i.e., if $\partial X=\emptyset$, then the boundary integral is zero, and hence so is the other integral. But otherwise, you cannot expect the integral to vanish.