Line integrals, cross products, surface integrals and Stoke's Theorem related problem? The vector field $\vec{F}(\vec{R})$ is defined as being equal to the line integral over some simple closed curve $C$: 
$$\vec{F}(\vec{R})=\oint_C\|\vec{r}-\vec{R}\|^2d\vec{r}.$$
We show that there are constant vectors $\vec A$ and $\vec B$ such that
$$\vec{F}(\vec{R})=\vec{A}\times\vec{R}+\vec{B}.$$
I don't know how to handle this part of the question at all, I've tried writing this in more explicit ways but it still seems really obscure to me. Can you help me?
Then we deduce that 
$$\nabla\times\vec{R}=-4\iint_S d\vec{S},$$
where $S$ is any smooth surface with boundary $C$.
I guess this is related to Stoke's Theorem but I'm not very sure I see the proper way of doing this... Any kind of hint for this second part would be amazing!
Thank you.
 A: Try using the Helmholtz decomposition. Write
$${\bf F}=\nabla\times {\bf G}-\nabla\phi$$
where
$${\bf G}({\bf r})=\frac{1}{4\pi}\int\frac{\nabla'\times {\bf F}({\bf r}')}{|{\bf r}-{\bf r}'|}\,dV'$$
$$\phi({\bf r})=\frac{1}{4\pi}\int\frac{\nabla'\cdot {\bf F}({\bf r}')}{|{\bf r}-{\bf r}'|}\,dV'$$
Hopefully, the double integrals will allow exchange of integration order and you will get something reasonable.
I didn't try it myself.
EDIT:
It states that every vector field can be split into a irrotational potential contribution and a sourceless curl contribution. The formulas are the ones above (of course it's for 3D space only). It's basically just doing "there and back again": F=derivative of integral of derivative. But it does split the contributions nicely, and it sometimes simplifies the expressions.
However, unfortunately your $\vec{F}$ is not bounded (it increases quadratically with R) so the above aren't correct without an additional surface terms (see http://en.wikipedia.org/wiki/Helmholtz_decomposition). Even more, you aren't actually looking for decomposition into curl and grad, but a simple vector expression.

It's also much more simple that it looks:
$$||\vec{R}-\vec{r}||^2=\vec{R}^2+\vec{r}^2-2\vec{r}\cdot\vec{R}$$
integrating this on a closed curve, you get
$$\oint \vec{r}^2\,d\vec{r}+||R||^2\oint d\vec{r}-2\vec{R}\oint \vec{r}\,d\vec{r}$$
The first term is independent of $\vec{R}$ and is just a vector (call it $\vec{B}$). The second term is $0$ because you are on a closed curve. The last term evaluates to a dot product of $\vec{R}$ on to a vector, that is essentially a length-rescaled position of the center of gravity of the curve: $\vec{A}=l\vec{r}_{center}$.
This means that the $\times$ in your expression isn't a cross product.

The second part is straight-forward:
$$\oint_C(\vec{r}-\vec{R})^2\,d\vec{r}$$
Take the curl
$$\nabla_R\times\oint_C(\vec{r}-\vec{R})^2\,d\vec{r}$$
$$=-2\oint_C (\vec{r}-\vec{R})\times\,d\vec{r}=-4\iint\,d\vec{S}$$
where we saw that this is completely independent of $\vec{R}$ because the curve is closed ($\vec{R}$ is just a displacement of the curve).
A: Let $\vec{a}$ be arbitrary constant vector; $S$ a smooth surface with $\partial S = C$; and, for ease of notation, let $\phi = \|\vec{r} - \vec{R}\|^2$. 
Then
$\begin{eqnarray*}
\vec{a} \cdot \displaystyle\oint_C\phi d\vec{r} &=& \displaystyle\oint_C\phi\vec{a}\cdot d\vec{r}\\
&=& \displaystyle\iint _S\nabla \times (\phi\vec{a})\cdot d\vec{S} \ \text{(By Stokes')}\\
&=& \displaystyle\iint_S \left(\phi\underbrace{\nabla \times \vec{a}}_{=\ 0} +\nabla\phi \times \vec{a}\right)\cdot d\vec{S}\\
&=&\vec{a}\cdot \displaystyle\iint_S-\nabla \phi \times d\vec{S} \ \text{(By cyclic permutation of the scalar triple product)}
\end{eqnarray*}$
Hence
$\begin{eqnarray*}
\vec{F}(\vec{R}) &=& - \displaystyle\iint_S \nabla\left(\|\vec{r}-\vec{R}\|^2\right)\times d\vec{S}\\
&=& -2\displaystyle\iint_S\left(\vec{r}-\vec{R}\right) \times d\vec{S} \\ 
&=& \left(-2\displaystyle\iint_S d\vec{S}\right) \times \vec{R} + \left(-2\displaystyle\iint_S\vec{r}\times d\vec{S}\right)\\
&=&\vec{A}\times \vec{R} + \vec{B}
\end{eqnarray*}$
Where $\vec{A}$ and $\vec{B}$ are suitable constant vectors, as desired.
