In reading the Lemma to the Four-Vertex Theorem in Do Carmo's book Differential Geometry of Curves and Surfaces, he writes:
Lemma: Let $\alpha: [0,l] \rightarrow \mathbb{R}^2$ be a plane closed curve parametrized by arc length and let $A,B,C$ be arbitrary real numbers. Then $\int_{0}^{l} (Ax + By + C) \frac{dk}{ds} ds = 0$, where the functions $x=x(s), y=y(s)$ are given by $\alpha(s) = (x(s), y(s))$ and $k$ is the curvature of $\alpha$.
Proof: Recall that there exists a differentiable function $\theta: [0,l] \rightarrow \mathbb{R}$ such that $x'(s) = cos \theta(s), y'(s) = sin \theta(s)$. Thus $k(s) = \theta'(s)$ and $x'' = -ky'$ and $y'' = kx'$.
So far so good, he then writes:
Therefore since the functions involved agree at $0$ and $l$, then $$\int_{0}^{l} k' ds =0$$ $$\int_{0}^{l} xk'ds = -\int_{0}^l kx' ds = - \int_{0}^{l} y'' ds = 0$$ $$\int_{0}^{l} yk' ds = -\int_{0}^{l} ky' ds = \int_{0}^{l} s'' ds = 0 $$
I'm not sure why $x'(0) = x'(l)$ or why $y'(0) = y'(l)$ (or rather why the above three equalities equal to $0$), any insights appreciated.