I found statements of the GaussBonnet theorem here, here, here, here, here, here, here, and here. None of them require that the surface be orientable. However, Ted Shifrin claims in a comment to this question that the GaussBonnet theorem actually only applies to orientable surfaces. Are these sources all incorrect?
 50,316
 18
 169
 342
 5,421
 1
 17
 51

6Shocking. I can't load several of those. Interesting that none of your sources is a published respected textbook. :) You know what my answer to your question is. I'm curious to see what other feedback you get :) – Ted Shifrin Aug 19 '18 at 23:49

2@TedShifrin The reason that none of them is a published respected textbook is that I just Googled it, and the complete text of published respected textbooks is rarely available online. For what it's worth, I suspect you're right, I'd just like to get further info. – tparker Aug 19 '18 at 23:51

6I am not criticizing you or your curiosity. (Indeed, I upvoted.) I am truly shocked, particularly because Herman Gluck, for example, is usually very careful :) I'm not surprised by errors in Wiki or other such sources. I'll give you this little challenge: Take one of the standard embeddings of the Möbius strip in $\Bbb R^3$ [I can give you a formula if you can't find one]. Find the geodesic curvature of the boundary. The Euler characteristic is $0$. See if you can make sense of the curvature integral and see if it works out. I'm actually curious to see the computation. :) – Ted Shifrin Aug 19 '18 at 23:56

@TedShifrin I think a nonorientable Riemannian manifold still has a volume density (instead of a volume form), so the curvature integral still makes sense. No? – Seub Sep 12 '18 at 00:19

@Seub, sure, but the theorem fails, I believe. And in general Pfaffian of curvature needs $SO(2m)$. – Ted Shifrin Sep 12 '18 at 00:23

@tparker I moved my comment to an answer. Thanks. – Henry Sep 12 '18 at 14:36

2@tparker: I've resolved the paradox. Consider the matter settled :P – Ted Shifrin Sep 14 '18 at 23:42
3 Answers
Orientability is not needed. Indeed, one can deduce unorientable version of GaussBonnet theorem from the orientable one :
Given a (compact) nonorientable surface, say $M$, with metric $g$, consider its orientable double cover $\widetilde{M}$. The metric $g$ is naturally pulled back to a metric $\widetilde{g}$ on $\widetilde{M}$; i.e. locally, $\widetilde{M}$ is isometric to $M$. Then it is easy to see that the usual GaussBonnet theorem on the orientable double cover implies the GaussBonnet theorem on the nonorientable surface, because $2\pi\chi(M) = \pi\chi(\widetilde{M}) = \frac{1}{2}\int_{\widetilde{M}}{K} = \int_{M}K$, where $K$ denotes the Gaussian curvature.
Added :
One might want a version of GaussBonnet theorem for surfaces with boundary. Indeed, the argument above can be applied to nonorientable surfaces with boundary. Let $M$ be a nonorientable surface with boundary $\partial M$. Then correspondingly its has an orientable double cover $\widetilde{M}$ with boundary $\partial \widetilde{M}$. As before, this double cover is locally isometric to $M$. Following the notation of Wikipedia, we have the GaussBonnet theorem on $\widetilde{M}$ : $$\int_{\widetilde{M}}K + \int_{\partial\widetilde{M}}k_g = 2\pi \chi(\widetilde{M})$$ Now observe that each term are twice the corresponding term for $M$. In particular, $\int_{\partial\widetilde{M}}k_g = 2\int_{\partial M}k_g$ just because it is a 2to1 locally isometric double covering. As a result, we get $$\int_{M}K + \int_{\partial M}k_g = 2\pi \chi(M)$$ There is nothing special for nonorientable surfaces!
Added again :
Let me give you an example, a Möbius strip. Its Euler Characteristic is $0$. The most convenient metric on the Möbius strip is a flat metric; such Möbius strip can be realized as a quotient of a flat strip with parallel geodesic boundaries. With such a metric, $K=0$ and $k_g=0$, so the LHS of the GaussBonnet theorem is $0$ as expected.
In general, for any metric on the Möbius strip, the GaussBonnet theorem should hold just as well, because the LHS remains constant under smooth deformation of metric. (Any deformation is a composition of local deformations, and for local deformations, it is a corollary of the orientable version of GaussBonnet theorem.)
Another easy proof is to cut your surface into small orientable pieces. It is not important whether your original surface is orientable or not. GaussBonnet theorem holds for individual pieces, and when you glue them back, boundary terms corresponding to seams cancel out. In this way it is easy to see that orientability is not important at all in GaussBonnet theorem for surfaces.
 2,865
 13
 32

I don't believe this argument generalizes to the case with boundary. – Ted Shifrin Sep 12 '18 at 15:17

@TedShifrin This argument seems persuasive to me. Unless you can provide an explicit counterexample of a nonorientable surface for which the GaussBonnet theorem fails, I'm inclined to accept. – tparker Sep 12 '18 at 18:47

This answer looks convincing to me. I had to convince myself why, if $p \colon (M,g) \to (N,h)$ is a $2:1$ covering map and local isometry, then $\int_{M} (p^* f) \, v_g = 2 \int_N f \,v_h$ for any function $f$ on $N$, where I denote $v_g$ the Riemannian density of a metric $g$. But after thinking about it I think it's true (take a cover of $N$ with charts that trivialize the covering map, take a partition of unity subordinate to that cover...) – Seub Sep 12 '18 at 19:11

1I haven't worked it out, but I think the line integrals on the boundary cancel, rather than doubling. I did work out the Möbius strip with explicit computation (the exercise I posed to you) and the theorem most definitely did *not* check. [I think the boundaryless case is, in fact, convincing with the area density in there.] I also still stand by my complaints about the Pfaffian in higher dimensions. And Chern certainly uses orientability in his proofs. – Ted Shifrin Sep 12 '18 at 19:38

The fact that Chern's proofs use orientability doesn't preclude the existence of more complicated proofs that *don't* use orientability... – tparker Sep 13 '18 at 00:05

1@TedShifrin I'm not sure whether the boundary terms should add up or cancel, but let's imagine that they cancel, that would mean that $\int_\tilde{M} \tilde{K} = 2\pi \chi(\tilde{M})$, hence $\int_M K = 2\pi \chi(M)$. This would be a version of GaussBonnet for nonorientable surfaces: no boundary term, even if the surface has boundary. Interesting? – Seub Sep 13 '18 at 11:26

1@Sunghyuk Park: Your addition with the Möbius strip example is nice, but it is also compatible with Ted Shifrin's hypothesis that the boundary term $\int_\tilde{\partial M} \tilde{k}$ could be equal to zero instead of $2 \int_{\partial M} k$ – Seub Sep 13 '18 at 11:43

1@TedShifrin@Seub The boundary term cannot cancel out. I know it can be a little confusing at first, but observe that even in case of an orientable surface, the boundary term does not depend on the orientation of the surface; the integral should be understood as a density integral, rather than an integral of a differential form. Intuitively, the boundary term measures the amount the boundary is curved inward (or outward). It is irrelevant to orientation. – Henry Sep 13 '18 at 12:27

I find all of this quite compelling except for this: I wrote down an explicit parametrization of the Möbius strip in $\Bbb R^3$ and (Mathematica) computed $\int_M KdA$ and $\int_{\partial M} \kappa_gds$. I get $6\pi$ for the former and approximately $13.8$ for the latter. Even if I'm not sure about the sign on the latter, we can't get $0$ with a sum. (I obviously can't fit all this explicitly into a comment.) This is all too perplexing. – Ted Shifrin Sep 13 '18 at 16:11

1@TedShifrin Since there's no consensus here, I [asked](https://mathoverflow.net/q/310445/95043) on Math Overflow, where the unanimous consensus (at least by comment upvotes) is that the GB theorem holds perfectly well for compact nonorientable surfaces, whether closed or with boundary. You may want to either further explain your curvaturematrix Pfaffian objection or show the results of your purported Mobius strip counterexample calculation as an answer, either here or on the MO page. – tparker Sep 13 '18 at 17:46

It seems Palais's paper referenced in the other answer has the definitive answer and also suggests that the boundary term should disappear in the nonorientable case. I don't know what to make of my explicit computations. I'm somewhat embarrassed that in my long career I never considered (and settled) this particular question. (Perhaps I'll email Palais and ask him to resolve my seeming contradiction.) – Ted Shifrin Sep 13 '18 at 18:01

@SunghyukPark: Oh right, I forgot the geodesic curvature was nonnegative by definition, thank you. Ok so yes, now I don't see anywhere your proof could go wrong. – Seub Sep 13 '18 at 19:13

@TedShifrin Just post your Mathematica code as an answer (perhaps with a disclaimer that you're not sure it's correct), either here or on the Math Overflow page. Someone will debug it in no time. – tparker Sep 14 '18 at 01:02

Actually, there was an error in computing the integral of curvature. It comes out approximately $4.1$. Still confused. I'm going to work on it some more. – Ted Shifrin Sep 14 '18 at 01:05

2@TedShifrin Also observe that a collar neighborhood of the boundary of a surface (not necessarily orientable) is always orientable. Hence there's no way the line integral "sees" orientability of the surface. – Henry Sep 14 '18 at 03:42

@SunghyukPark: I don't agree with your "little orientable pieces" argument. They don't glue in the nonorientable case. – Ted Shifrin Sep 14 '18 at 23:33

@TedShifrin I believe they do. It may be easier to understand if you think of the discrete GaussBonnet theorem where you consider PL surfaces. The usual GaussBonnet theorem is a sort of a limit case. – Henry Sep 15 '18 at 00:18

@SunghyukPark It's still a little confusing to me that you write about the boundary term: "the integral should be understood as a density integral, rather than an integral of a differential form", but then also "when you glue them back, boundary terms corresponding to seams cancel out". So you are actually integrating on an oriented curve, right? Otherwise the boundary term would always be positive and could not cancel out. Or maybe you have a different definition of the geodesic curvature $k_g$ than I have (from wikipedia): for me it's always nonnegative. – Seub Sep 15 '18 at 00:57

1@Seub The geodesic curvature is positive if the boundary is curved inward and negative otherwise. For instance, the curvature of the boundary of a disk is positive, while the curvature of the boundary of the complement of a disk on a plane is negative. There is no orientation involved. – Henry Sep 15 '18 at 01:07

I see, no orientation involved, but the geodesic curvature does have a sign. Thanks. – Seub Sep 15 '18 at 01:19
Following the OP's request, I'm posting the details of my computations for the explicit embedding of the Möbius strip $M$ in $\Bbb R^3$. The orientation of (halves) of the boundary curve turns out to be the crucial matter, as I'd suspected. Although the theoretical arguments are compelling, I remain confused about what's wrong with the following computations. I can now vouch that the numerics are correct.
Consider the parametrization $$x(u,v) = \big((2+v\sin(u/2))\cos u,(2+v\sin(u/2))\sin u,v\cos(u/2)\big), \quad 0\le u\le 2\pi, 1\le v\le 1.$$ Note that $B = x(0,1) = x(2\pi,1)$ and $C=x(0,1)=x(0,1)$. As you can check, this is an orthogonal parametrization, and the first fundamental form has coefficients $E = \x_u\^2 = 4+\frac34 v^2  \frac12 v^2\cos u + 4v\sin(u/2)$ and $G=\x_v\^2 = 1$. I'm now going to use the standard formulas for $K$ and $\kappa_g$ in an orthogonal parametrization (see, e.g., my text, pp. 60 and 81): \begin{align*} K &= \frac1{2\sqrt{EG}}\left(\Big(\frac{E_v}{\sqrt{EG}}\Big)_v + \Big(\frac{G_u}{\sqrt{EG}}\Big)_u\right) \\ \kappa_g &= \frac1{2\sqrt{EG}}\big({}E_v u'(s) + G_u v'(s)\big)+\theta'(s), \end{align*} the latter for an arclength parametrization of the curve. Here $\theta$ is the angle the curve makes with $x_u$ at each point. In our case $\theta'=0$ everywhere. Note, also, that (forgetting about orientation issues for the moment) \begin{align*} \int_M K\,dA &= \iint_{[0,2\pi]\times [1,1]} \frac1{2\sqrt{EG}}\left(\Big(\frac{E_v}{\sqrt{EG}}\Big)_v + \Big(\frac{G_u}{\sqrt{EG}}\Big)_u\right)\underbrace{\sqrt{EG}\,du\,dv}_{dA} \\ &= \frac12\int_0^{2\pi}\int_{1}^1 \Big(\frac{E_v}{\sqrt E}\Big)_v\,dv\,du \\ &= \frac12\int_0^{2\pi} \Big(\frac{E_v}{\sqrt E}\Big)\Big_{v=1}  \Big(\frac{E_v}{\sqrt E}\Big)\Big_{v=1} \,du. \end{align*} Regarding the orientation issue, surely we'll agree that $dA$ should agree with this $dA$ if we remove one ruling of the surface (say the ruling from $B$ to $C$). So this integral should be the density integral.
Now, $E_v/\sqrt E$ is rather a mess, but, using Mathematica to do the numerical integration, we find that this integral is (approximately) $1.97$. [The most basic check is that it's negative, as we have a nondevelopable ruled surface.]
We can now use Mathematica to evaluate the geodesic curvature integrals. We note that $ds = \frac{ds}{du}du$, so $\kappa_g\,ds = \big({}\frac12 E_v/\sqrt E\big)u'(s)\,ds =\big({}\frac12 E_v/\sqrt E\big)\,du$. On half the boundary circle, going from $B$ to $C$, $$\frac12\int_0^{2\pi} \frac{E_v}{\sqrt E}\Big_{v=1}du \approx 4.53,$$ and on the other half, going from $C$ to $B$, we have $$\frac12\int_0^{2\pi} \frac{E_v}{\sqrt E}\Big_{v=1}du \approx 2.56.$$ So $\int_M K\,dA + \int_{\partial M} \kappa_g\,ds \approx 9.06$ (certainly not $0$, nor, indeed, an integer multiple of $2\pi$).
To doublecheck this computation, let's remove a tiny bit of our Möbius strip, say the region corresponding to $0\le u\le \varepsilon$. This leaves us an oriented surface, for sure. Its boundary has two extra pieces, $u=0$ (oriented downward) and $u=\varepsilon$ (oriented upward); these have no contribution, regardless of $\varepsilon$, since the $v$curves are line segments and have no geodesic curvature. The main discrepancy, however, is the reversed orientation on the segment $v=1$. Indeed, for $\varepsilon$ very small, the $v=1$ integral is now approximately $+4.53$, and — mirabile dictu — note that $$1.97 + 4.53  2.56 = 0,$$ as it should! (The exterior angles of the "rectangle" contribute the $2\pi\chi = 2\pi$.) But I emphasize that when we've removed a bit of the Möbius strip to make an oriented creature, we do not have (almost) the same boundary curve as the Möbius strip. This difference, as far as I'm concerned, is what messes up the GaussBonnet Theorem. One more comment: The definition of $\kappa_g$ (as $\kappa\mathbf N\cdot(\mathbf n\times\mathbf T)$, where $\mathbf T,\mathbf N$ are the Frenet frame of the curve and $\mathbf n$ is the surface normal) makes it clear that when we have an oriented surface with boundary, the sign of $\kappa_g$ does not change if we reverse the orientation of the surface; for when we do, we change both $\mathbf n$ and $\mathbf T$ by a sign. But, if we interpreted $ds$ in this integral as a measure, as @SunghyukPark suggests, it surely must be consistent along the boundary circle of the Möbius strip, so we cannot just switch the sign of half the line integral. ...
EDIT: OK, I believe I've figured it out, much to my chagrin. We need to think about geodesic curvature intrinsically (as one does in a fancier proof of the GaussBonnet Theorem). If $e_1$ is the unit tangent vector along $\partial M$ and $e_2$ is the inwardpointing normal to $\partial M$ in $M$, then, by definition, $\kappa_g = \nabla_{e_1}e_1\cdot e_2$. So, in fact, on the upper edge $v=1$ of our parametrizing rectangle, the formula for $\kappa_g$ we used earlier is off by a sign, and correcting this is equivalent to reversing the orientation on that upper integral. The correct values are $$\int_M KdA = 1.97 \qquad\text{and}\qquad \int_{\partial M}\kappa_g ds = +4.532.56 = +1.97.$$ So the sum is, in fact, $2\pi\chi(M) = 0$, as desired. I feel better now. :)
Here's the graph of the geodesic curvature (upper upper, lower lower):
 50,316
 18
 169
 342
 101,067
 4
 80
 135

Thank you for sharing your computations. Just a small remark: according to wikipedia, the geodesic curvature of a curve $\gamma(t)$ is just the curvature of $\gamma(t)$ in $S$, where $S$ is equipped with the induced Riemannian metric: $k_g =\Vert \frac{\nabla^2}{ds^2} \gamma(s) \Vert$ for a unit speed curve, where $\nabla$ is the LeviCivita connection of the induced Riemannian metric. That seems to be a pretty good intrinsic definition. – Seub Sep 15 '18 at 01:00

@Seub: I definitely do not like that. $\kappa_g$ has an intrinsic sign. It shouldn't always be positive. – Ted Shifrin Sep 15 '18 at 01:05

This is more of an extended comment than a complete answer, but hope that it will close the question.
Applying a little Googlomagic (namely, searching for "gaussbonnet nonorientable") it is possible to find out the following:
a paper by R. Palais's A Topological GaussBonnet Theorem, J.Diff.Geom. 13 (1978) 385398, where he mentions in passing that the GaussBonnet theorem is easily generalized to the nonorientable case by considering measures.
an answer to this question with a feasible proof of the GaussBonnet for the nonorientable case;
and many more interesting things, of course :)
On a side note, the Pfaffian has nothing to do with the orientability, bit rather with the dimension: it is defined in even dimensions (thus, in dimension 2 as well). See, maybe, here for the details.
 10,211
 2
 33
 58

Your final link makes it clear why you need an oriented (even rank) bundle. – Ted Shifrin Sep 12 '18 at 16:14

1