Finding a line integral of a vector field I'm working on the following:
For $k \in \mathbb{N}$ let the oriented piecewise $C^1$ curve $\gamma_k$ be parametrised by
$$\gamma_k(\theta):=\left ((k+1)\cos\left(\frac{\theta}{k+1}\right)−\cos(\theta),(k+1)\sin\left (\frac{\theta}{k+1}\right)−\sin(\theta) \right )$$
with $ \theta \in[0, 2(k+1)\pi]$. Then let 
$$g := \left(\frac{-y}{x^2+y^2}, \frac{x}{x^2+y^2}\right)$$
and find $$\int_{\gamma_k}g\cdot ds$$
for all $k \in \mathbb{N}$.
I tried letting $x(\theta) = (k+1)cos(\frac{θ}{k+1})−cos(θ)$, giving a $dx = sin(\theta) - sin(\frac{\theta}{k+1})$ and something similar, but with cosine for $y(\theta)$. Then I plugged them into $g$ and dotted the resulting vector with $\langle dx, dy \rangle$, but that results in a pretty ugly integrand. Is there a better way to approach this?
 A: This is a hefty computation and it needs to be done step-by-step.  First notice that in evaluating $g(\gamma(\theta))$ you need to compute $x^2 + y^2$:
\begin{eqnarray*}
x^2 + y^2 & = & (k+1)^2\cos^2\left (\frac{\theta}{k+1}\right ) - 2(k+1)\cos\theta\cos\left (\frac{\theta}{k+1}\right ) + \cos^2\theta \\
&& + (k+1)^2\sin^2\left (\frac{\theta}{k+1}\right ) - 2(k+1)\sin\theta\sin\left (\frac{\theta}{k+1}\right ) + \sin^2\theta \\
& = & 1 + (k+1)^2 - 2(k+1)\left [\cos\theta\cos\left (\frac{\theta}{k+1}\right ) + \sin\theta\sin\left (\frac{\theta}{k+1}\right )\right ] \\
& = & 1 + (k+1)^2 - 2(k+1)\cos\left (\frac{k\theta}{k+1}\right )
\end{eqnarray*}
where we use the identity $\cos(\alpha\pm \beta) = \cos\alpha\cos\beta \mp \sin\alpha\sin\beta$.  This means that 
$$
g(\gamma(\theta)) \;\; =\;\; \frac{\left (\sin\theta - (k+1)\sin\left (\frac{\theta}{k+1}\right ), \; (k+1)\cos\left (\frac{\theta}{k+1}\right ) - \cos\theta   \right )}{1 + (k+1)^2 - 2(k+1)\cos\left (\frac{k\theta}{k+1}\right )}.
$$
Similarly, we can compute $d\gamma$ as 
$$
d\gamma(\theta) \;\; =\;\; \left (\sin\theta - \sin\left (\frac{\theta}{k+1}\right ), \; \cos\left (\frac{\theta}{k+1}\right ) - \cos\theta\right ).
$$
Computing the line integral goes as follows:
\begin{eqnarray*}
\int_\gamma g\cdot ds & = & \int g(\gamma(\theta))\cdot \gamma'(\theta)d\theta \\
& = & \int_0^{2(k+1)\pi} \frac{\sin^2\theta + (k+1)\sin^2\left (\frac{\theta}{k+1}\right ) + \cos^2\theta + (k+1)\cos^2\left (\frac{\theta}{k+1}\right ) - 2(k+1)\left [\cos\theta\cos\left (\frac{\theta}{k+1}\right ) + \sin\theta\sin\left (\frac{\theta}{k+1}\right )  \right ]}{1 + (k+1)^2 - 2(k+1)\cos\left (\frac{k\theta}{k+1}\right )} d\theta \\
& = & \int_0^{2(k+1)\pi} \frac{1 + (k+1) - 2(k+1)\cos\left (\frac{k\theta}{k+1}\right )}{1 + (k+1)^2 - 2(k+1)\cos\left (\frac{k\theta}{k+1}\right )} d\theta \\
& = & \int_0^{2(k+1)\pi} \frac{-k +  2(k+1)\left [ 1 - \cos\left (\frac{k\theta}{k+1}\right ) \right ]}{k^2 + 2(k+1)\left [1 - \cos\left (\frac{k\theta}{k+1}\right )\right ]} d\theta \\
& = & \int_0^{2(k+1)\pi} 1 -  \frac{k(k+1)}{k^2 + 2(k+1)\left [1 - \cos\left (\frac{k\theta}{k+1}\right )\right ]} d\theta \\
& = & 2(k+1)\pi - \int_0^{2(k+1)\pi} \frac{k(k+1)}{k^2 + 2(k+1)\left [1 - \cos\left (\frac{k\theta}{k+1}\right )\right ]} d\theta.
\end{eqnarray*}
I'm not going to bother computing this integral by hand.  But using Wolfram we see that we obtain an integral of the type:
$$
\int \frac{1}{k^2 + 2(k+1)\left (1-\cos \left (\frac{k\theta}{k+1}\right ) \right )}d\theta \;\; =\;\; \frac{2(k+1)\tan^{-1}\left (\frac{(k+2)\tan\left (\frac{k\theta}{2(k+1)}\right ) }{k} \right ) }{k^2(k+2)}  \\
$$
While evaluating this integral at the endpoints would yield zero, this would not be correct.  What we would like to do instead is to observe the behavior of the function and see if we can find another way of computing the integral.  Observe the graph of the function for $k=1$ and also the lines at $x = 4\pi$ and $x = 2\pi$.

Notice that by the periodicity of the graph, we can bypass evaluating at the endpoints by taking $2k$-times the abstract expression and instead integrate between $0$ and $\frac{(k+1)\pi}{k}$ (thankfully, this behavior scales with $k$, hence it will work for all values).  What we compute is the following:
\begin{eqnarray*}
\int_0^{2(k+1)\pi} \frac{1}{k^2 + 2(k+1)(1-\cos u)}du & = & \int_0^{\frac{(k+1)\pi}{k}} \frac{2k}{k^2 + 2(k+1)(1-\cos u)}du \\ 
& = & \left .  \frac{4k(k+1)\tan^{-1}\left (\frac{(k+2)\tan\left (\frac{kx}{2(k+1)}\right ) }{k} \right ) }{k^2(k+2)}  \right |_0^{\frac{(k+1)\pi}{k}} \\
& = & \frac{4(k+1)\tan^{-1}\left (\frac{(k+2)\tan\left (\frac{\pi}{2}\right ) }{k} \right ) }{k(k+2)}  \\
& = & \frac{4(k+1)}{k(k+2)}\cdot \frac{\pi}{2} \\
& = & \frac{2(k+1)\pi}{k(k+2)}.
\end{eqnarray*}
Finally, we arrive at the final answer which is
\begin{eqnarray*}
\int_{\gamma_k}g\cdot ds & = & 2(k+1)\pi - \frac{2(k+1)\pi}{k(k+2)} \\
& = & 2(k+1)\pi \left [1 - \frac{1}{k(k+2)} \right ] \\
& = & 2(k+1)\pi\left [ \frac{k^2+2k-1}{k(k+2)}\right ]
\end{eqnarray*}
and finally finally:
$$
\int_{\gamma_k}g(s)\cdot ds \;\; =\;\; \frac{2\pi(k+1)(k^2+2k-1)}{k(k+2)}.
$$
