Classical Mechanics: work This a a fragment from my Theoretical Physics (- Classical Mechanics) notes:

$$W_{1 \to 2} = \int_{t_1}^{t_2} \boldsymbol{F}\cdot\boldsymbol{v}\,dt = m \int_{t_1}^{t_2} \dot{\bf{v}}\cdot{\bf{v}}\,dt. $$
This is only possible if $\bf{F}\cdot\bf{v}$ is a derivative with respect to time $t$ of a certain function $f({\bf r}(t))$, in other words if for every path ${\bf r}(t)$: $${\bf F} ({\bf r}(t),{\bf\dot{r}}(t),t)\cdot \dot{\bf r}(t)=\frac{d}{dt}f({\bf r}(t)). $$

with $W_{1 \to 2}$ the work done by ${\bf F}$ from time $t_1$ to $t_2$, ${\bf r}(t)$ is the trajectory of a point particle.
I don't understand why it says that ${\bf F}({\bf r}(t),{\bf\dot{r}}(t),t)\cdot \dot{\bf r}(t)=\frac{d}{dt}f({\bf r}(t)) $ has to be fulfilled.
I know that ${\bf F}=  m \,\dot{\bf v} $. Where $\dot{\bf v}$ is a derivative with respect to $t$. Does it have to do with this?
 A: There is something that might be swept under the rug here a little. When you write the integral as a function of time $t$, you are implicitly assuming that the particle is following a particular path, which is determined by your choice of function $\vec{v}(t)$. Then the integral $W_{1 \to 2} = \int_{t_1}^{t_2} \vec{F}\cdot\vec{v}(t)\,dt$ has a single consistent value only if it doesn't depend on our choice of function $\vec{v}(t)$. In general, $W$ might have a different value even if we get from point A to point B in all cases, depending on how we get there.
We can see this explicitly if we write the integral in this way:

$$W_{1 \to 2} = \int_{t_1}^{t_2} \vec{F}\cdot\vec{v}(t)\,dt = \int_{\gamma(\vec{r}_1 \to \vec{r}_2)}\vec{F}\cdot d\vec{r} $$

since $\vec{v}(t)\,dt = d\vec{r}$. Now this is a path integral, which means that while we go from initial position $\vec{r}_1$ at time $t_1$ to final position $\vec{r}_2$ at time $t_2$ following some specified path $\gamma$.
If you want $W$ to have a single consistent value if you only specify the starting and ending points of your particle, you need that any choice of $\gamma$ going from $\vec{r}_1$ to $\vec{r}_2$ gives the same result for the integral.
Now there is a necessary and sufficient condition which states exactly when this path integral is path-independent (i.e. does not depend on choice of path $\gamma$). It is when the force field $\vec{F}$ can be written as the gradient of some potential $U$, or explicitly $\vec{F}=-\vec{\nabla}U$, where $\vec{F}(\vec{r})$ is a function of position only and $U(\vec{r})$ is a function of position only. (I want to emphasise that $\vec{F}$ in the integral is a function of position which is itself a function of time; the value of $\vec{F}$ at any given point does not depend on time.)
This condition turns out to be equivalent to the one supplied by your book:
$$\frac{d}{dt}\Big(-(\vec{\nabla}U)\cdot\vec{r}\Big) = -\vec{\nabla}U\cdot\frac{d}{dt}\vec{r} = \vec{F}\cdot\vec{v}$$The first equals sign is because neither the gradient operator nor $U$ depend explicitly on time; the second equals sign is because of our condition that $\vec{F}$ can be written as $\vec{\nabla}U$. When $\vec{F}$ satisfies this condition, it is called conservative, and we can define work done in the way that your book does.
A: I am going to take a different approach than the other two answers and say that this is not required. As you can pick up from the other answers, this requirement the text gives is essentially saying that we need our force to be conservative. I am going to argue that these integrals themselves do not require us to use conservative forces.$^*$ 
We will start with the definition of the work done by a force:
$$W=\int_\gamma\mathbf F(\mathbf x)\cdot\text d\mathbf x=\int_{\mathbf x_1}^{\mathbf x_2}\mathbf F(\mathbf x)\cdot\text d\mathbf x$$
where $\mathbf F$ is the force in question and $\text d\mathbf x$ is the infinitesimal displacement along the path $\gamma$. I will drop the $\gamma$ and put the initial and final locations as limits of the integral (the final integral on the right), but just keep in mind that this integral is done over the path the object moves through in space.
Now, two things to consider:


*

*This definition applies for any force. It does not matter if $\mathbf F$ is conservative or not. If we need to impose this condition later we can, but we will not for now.

*The trajectory of the object does not have to depend on this force $\mathbf F$ alone. The object could be going on a path due to a number of various forces. However, this definition still applies for any force (or sum of forces) we choose to consider. The object still has a defined trajectory due to the forces acting on it (based on Newton's second law), and we can use this definition to determine the work done by any one of these forces. Once again, this does not require the force $\mathbf F$ in question to be conservative.


Now, we can take this definition and apply a change of variables. We can imagine a function that tells us at what point in time we are are currently at based on where in space we are at (of course there is the issue of if the trajectory crosses a point in space more than once, but we can just break the trajectory up into pieces such that on each piece any location is not occupied at more than one point in time). i.e., we have a function $g(\mathbf x)=t$. Of course, the inverse of this function is just a function that gives us the position as a function of time: $\mathbf{g^{-1}}(t)=\mathbf x$. Therefore, $\text d \mathbf x=\frac{\text d \mathbf{g^{-1}}}{\text d t}\text d t$, which is (as expected) $\text d\mathbf x=\mathbf v(t)\text d t$ Therefore: 
$$W=\int_{g(\mathbf x_1)}^{g(\mathbf x_2)}\mathbf F\left(\mathbf{g^{-1}}(t)\right)\cdot\mathbf v(t)\ \text d t=\int_{t_1}^{t_2}\mathbf F'(t)\cdot\mathbf v(t)\ \text d t$$.
Where the function $\mathbf F'=\mathbf F\circ\mathbf{g^{-1}}$ still represents your force, but it is a function into which we input time rather than position to determine the force.(you can look at my answer here to see this treated in more detail, but you will have to generalize to more than one dimension. But really we are just doing a change in variables here).
The point is that we have not assumed anything new about the force still! We just changed our integral to look different. The velocity $\mathbf v(t)$ is still just determined by the forces acting on the object, just like the trajectory in point 2 above. Therefore, this integral is still valid for any force we want to consider that is acting on the object during its travel along the path determined by the forces acting on the object.
From here then we just apply Newton's second law: $$\mathbf F'=m\mathbf{\dot v}$$
and arrive at
$$W=\int_{t_1}^{t_2}\mathbf F'(t)\cdot\mathbf v(t)\ \text d t=m\int_{t_1}^{t_2}\mathbf{\dot v}\cdot\mathbf v\ \text d t$$
We did not assume anything about the force here. This is just from using the definition of work and then performing a change of variables on the integral.
Now, if we do assume a conservative force, then we can do the following
$$W=\int_{t_1}^{t_2}\frac{\text d}{\text d t}f(\mathbf x(t))\text d t=f(\mathbf x(t_2))-f(\mathbf x(t_1))=-\Delta f$$
i.e. the work done is the negative change in our potential energy function (which is a pretty well known property of the work done by conservative forces).
Therefore, to do those integrals/substitutions does not require a conservative force! It just makes the integrals easier to work with (by basically not considering the integrals at all). I am assuming we are missing some context in the text you have quoted.
Note: this can be seen a lot easier working with differentials rather than the entire integrals, but I wanted to keep it in terms of integrals since it seems like this is what the text is focusing on.

$^*$ In this sense, I am assuming that the object travels on a set path over time determined by the net force acting on the object and Newton's second law. We can pick a time interval over which we wish to calculate the work done by a force acting on the object. This contrasts @Remellion's answer, which assumes set end points in space and/or time and considers the ability to choose the path the object moves along (I would assume by varying the other forces acting on the object and keeping the force $\mathbf F$ in question acting on our object the same). Of course this is equally valid. It would be akin to the typical homework problem of "Show that the work done by gravity is the same from $r_1$ to $r_2$ along these three different paths" where the force in question that doesn't change is gravity, but the force "we" apply to move the object along the different paths is variable.
