Calculating integral using Stokes theorem and directly

Calculate directly and using Stokes theorem $\int_C y^2 dx+x \, dy+z \, dz$, if $C$ is intersection line of surfaces $x^2+y^2=x+y$ and $2(x^2+y^2)=z$, orientated in positive direction viewed from point $(0;0;2R)$.

I did it using Stokes theorem, but I don't know how to do it directly. Any idea? Result is $0$.

Notice $$\int_C y^2 dx + x dy + z dz = \int_C \left[((x^2 + y^2) - (x+y)) dx + d\left( \frac{x^2}{2} + xy - \frac{x^3}{3} + \frac{z^2}{2}\right)\right]$$ The first term vanishes because $x^2 + y^2 = x + y$ on $C$, the second term vanishes because it is a total differential and $C$ is a closed curve.

• Thanks for reply. It's not clear to me, how fact that C is orientated in positive direction viewed from point (0;0;2R) affect solution? What would happen if it was some other point? – etf Jul 24 '15 at 16:33
• @etf there are only two orientations for $C$. If you change the view point and/or the direction from positive and negative, the integral can at most pick up a minus sign. In this case, the integral is $0$ and orientation of $C$ doesn't matter. – achille hui Jul 24 '15 at 17:02
• It's clear now. Thanks a lot! – etf Jul 24 '15 at 17:05

One way to do it is to use the parametrization $$x=\frac{1}{2}+\frac{\sqrt{2}}{2}\cos\theta, y=\frac{1}{2}+\frac{\sqrt{2}}{2}\sin\theta, 0\leq \theta \leq 2\pi$$ Then computing $z$ using the second equation gives you $$z=2(1+\frac{\sqrt{2}}{2}(\cos\theta+\sin\theta))$$

Plugging all these into the line integral will give you a single integral with respect to $\theta$.

• Thanks for reply. It's not clear to me, how fact that C is orientated in positive direction viewed from point (0;0;2R) affect solution? What would happen if it was some other point? – etf Jul 24 '15 at 16:33
• @etf: If it is from below, for example, $(0,0,-2R)$, then the limits of $\theta$ would be from $2\pi$ to $0$. However, the answer is $0$, so it does not affect. – KittyL Jul 24 '15 at 17:15
• It's clear now. Thanks a lot! – etf Jul 24 '15 at 17:29