Path with polar coordinates needs some more post signs For reference, this is the problem I'm dealing with:

Compute the value of the integral
$\int_c ydx+zdy+xdz$, where $C$ is the curve of intersection of the surfaces $x+y=2$ and $x^2+y^2+z^2=2(x+y)$

The curve is a circumference with center in $(1,1,0)$ and $r=\sqrt2$, so now I want to parametrize the curve in order to solve the integral. My first try was quite unsuccessful (the integral was too complicated), so I thought that polar coordinates would make everything easier.
$$
x = \sqrt2 \cos \theta
$$
$$
y = \sqrt2 \sin\theta
$$
I found $z$ by substituting $x$ and $y$ in the original equations and hoping for the best, I obtained $z=\pm\sqrt2$, so now I have two paths, one with positive z and other with negative z. I will just put here what happened with the positive path because I don't want to write too much here.
My path is $\beta(\theta) = ( \sqrt2 \cos\theta, \sqrt2\sin\theta, \sqrt2)$, my function is $f(x,y,z)=(y,z,x)=(\sqrt2\sin\theta,\sqrt2,\sqrt2\cos\theta)$
$$
\int^\pi_0f\cdot d\beta=\int^\pi_0-2sin^2\theta + 2 \cos\theta\ d\theta
$$
However, I don't like this for two reasons: 1) my results don't match with the right ones 2) I expected an easier integral. So I suspect there must be something wrong with my conversion to polar coordinates, which wouldn't be surprising because this is my first time doing something with them and most of the things I have learnt about them are self taught :') I would really appreciate if someone could give me a hint to locate my mistakes, thank you in advance!
 A: Your parametrization of the intersection curve is not correct.
The orientation of the curve is not given. So I will assume one and the answer may have opposite sign if the orientation is different.
Given surfaces are $~x + y = 2, x^2 + y^2 + z^2 = 2 (x + y)$
To find the intersection curve,
$x^2 + (2-x)^2 + z^2 = 4 \implies 2(x-1)^2 + z^2 = 2$
So we can use the parametrization,
$ r(t) = (1 + \cos t, 1 - \cos t, \sqrt 2 \sin t), t \in (0, 2\pi)$
We have $\vec F = (y, z, x)$
So, $\vec F(r(t)) = (1 - \cos t, \sqrt 2 \sin t, 1 + \cos t)$
$r'(t) = (- \sin t, \sin t, \sqrt2 \cos t)$
$ \displaystyle \int_0^{2\pi} \vec F(r(t))\cdot r'(t) ~ dt$
$$ \displaystyle = \int_0^{2\pi} (\sqrt2 \cos t - \sin t + \frac 12 \sin 2t  + \sqrt 2) ~ dt$$
As integral of $\sin t, \cos t$ and $\sin 2t$ over $(0, 2\pi)$ is zero, the answer is simply $2 \sqrt2 ~\pi$.
Alternatively, you could have used Stokes' theorem
$ \displaystyle \iint_S (\nabla \times \vec F) \cdot \hat n ~dS = \int_C \vec F \cdot dr$
and evaluated the LHS. Note that the curl of the vector field is $(-1, -1, -1)$, $ \vec n = (-1, -1, 0)$ and the projection in xz-plane is,
$\displaystyle \frac{(x-1)^2}{1^2} + \frac{z^2}{(\sqrt2)^2} \leq 1$
The answer is simply two times the area of the ellipse and using the formula for area of the ellipse, the answer is $2 \sqrt2 ~\pi$.
