vector field as integral Define a vector field $ \vec{f}(\vec{R}) = \oint_C{|\vec{r} - \vec{R}|^2 d\vec{r} }$ where C is a simple closed curve.
show that there are constant vectors $ \vec{P} $ and $ \vec{Q} $ such that $ \vec{f}(\vec{R}) = \vec{R} \times \vec{P} + \vec{Q} $
 A: $\def\VP{{\bf P}}
\def\VQ{{\bf Q}}
\def\VR{{\bf R}}
\def\VS{{\bf S}}
\def\ve{{\bf e}}
\def\vf{{\bf f}}
\def\vr{{\bf r}}
\def\o{\cdot}$We have 
\begin{align*}
\vf(\VR) &= \oint_C |\vr-\VR|^2 d\vr \\
&= \oint_C (r^2 - 2\VR\o\vr+R^2)d\vr \\
&= \oint_C r^2 d\vr 
 -2\oint_C (\VR\o\vr) d\vr 
 +R^2\underbrace{\oint_C d\vr }_{{\bf 0}}.
\end{align*} 
Note that 
$d\vr = \ve_i(\ve_i\o d\vr)$, 
where a sum over the index $i$ is implied and where $\{\ve_i\}_{i=1}^3$ is a (constant) orthonormal basis of $\mathbb{R}^3$. 
Thus, 
\begin{align*}
\oint_C (\VR\o\vr) d\vr 
&= \ve_i\left\{\oint_C [(\VR\o\vr)\ve_i]\o d\vr\right\} \\
&= \ve_i \left(\iint_S \left\{\nabla\times[(\VR\o\vr)\ve_i]\right\}\o d\VS\right),
\end{align*}
by Stokes' theorem. 
It is a straightforward exercise to show that 
$$\nabla\times[(\VR\o\vr)\ve_i] = \VR\times\ve_i.$$
Thus, 
\begin{align*}
\oint_C (\VR\o\vr) d\vr 
&= \ve_i\left[\iint_S(\VR\times\ve_i)\o d\VS\right] \\
&= \ve_i\left[\iint_S(d\VS\times\VR)\o\ve_i\right] \\ 
&= \iint_S d\VS\times\VR \\ 
&= -\VR\times\iint_S d\VS.
\end{align*}
Therefore 
$$\vf(\VR) = \VR\times\VP + \VQ,$$
where $\VQ = \oint_C r^2 d\vr$ and $\VP = 2\iint_S d\VS$. 
Addendum
There appear to be at least two partial duplicates which I found after answering this question: 


*

*Line integrals, cross products, surface integrals and Stoke's Theorem related problem? 

*vector fields and closed curves.
