Proving that two vectors are perpendicular given information of derivatives I'm trying to solve the following question:

Let $f,g:\mathbb {R \to R^{3}}$ two differentiable functions s.t. $\forall x\in\mathbb{R}$
$\quad f(x) = f(x+1), \quad g(x) = g(x+3)$. Show that exist $a,b\in\mathbb{R}$ s.t. the vector $u =f(a) - g(b)$ is perpendicular to both $f'(a)$ and $g'(b)$.

Why is it true? Any hint would help. Thank you!
 A: I got it finally. I was finding it more difficult than it was, I thought that you had to choose the same point for both functions (and in that case, the result is not true by the way).
Geometric argument:
If you find $a,b\in\mathbb{R}$ such that $f(a)=g(b)$, then the result is trivially true. So, let's suppose that the two functions have disjoint images. Let's call $A$ the image of $f$ and $B$ the image of $g$.
Since they are both periodic, we can see them as continuous functions from the circle $S^1:=\mathbb{R}/\mathbb{Z}$ to $\mathbb{R}^3$. But the circle is a compact space, so $A$ and $B$ are compact and disjoint subsets of $\mathbb{R}$, as images of compact spaces through continuous maps. They are actually continuous closed curves (even though they could be non-regular).
Then, roughly speaking, by compactness, there are two points $p,q\in\mathbb{R}^3$, $p\in A,\,q\in B$ that minimize the distance between each other, and if we draw the segment that connects these two points, it must be orthogonal to both these curves if both points are regular points of the curves. (If instead they are not, then $f'$ and $g'$ vanish at those points, so there is nothing to prove). Below the rigorous procedure.

Rigorous analytic argument
Let's consider the function $d:\mathbb{R}\times\mathbb{R}\to\mathbb{R}$ such that $d(x,y)=\|f(x)-g(y)\|^2$, where here I am considering the standard Euclidean norm.
Since this function is periodic in both variables (let's assume $f(x) = f(x+1),\quad g(x) = g(x+1)$ for simplicity), it can be seen as a continuous function $\widetilde d\colon S^1\times S^1\to\mathbb{R}$, where the domain $S^1\times S^1$ is compact (it is just a 2-dimensional torus). Thus, $d$ admits maxima and minima.
Let's call $(a,b)$ a minimum point for $d$. We are assuming that $d(a,b)>0$, otherwise the result is clearly obtained. Since $f$ and $g$ are differentiable and $(a,b)$ is a minimum, it must hold
$$\frac{d}{dx}d(x,y)|_{x=a}=0,\qquad\text{and}\qquad\frac{d}{dy}d(x,y)|_{y=b}=0.$$
If you write explicitly these two derivatives (recall that we can write $d(x,y)=<f(x)-g(y),f(x)-g(y)>$), we obtain exactly $2<f'(a),f(a)-g(b)>=0$ and $2<g'(b),f(a)-g(b)>=0$.
