Let $U$ be the potential energy associated with the force $F$. Why is $\frac{d}{dx}U=-F$? In a conservative force field, we may define a function $U:\mathbb{R}^3\to\mathbb{R}$ such that
$$\int_CFdx = U(x_A)-U(x_B)$$
and we call $U$ the potential energy associated with the force $F$.

I've read in multiple places (e.g. N F Taussig's answer to this post) that
$$\frac{d}{dx}U = -F(x)$$
and this is what I wish to understand properly.

My confusion starts in that the function $U$ is not a function $\mathbb{R}\to\mathbb{R}$, so it is not clear what it means to differentiate with respect to $x$.
Furthermore, we have that
$$\int_CFdx := \int_a^bF(x(t))\cdot x'(t)dt$$
for a function $x:[a,b]\to C\subseteq \mathbb{R}^3$ which I believe we may regard as the position $x$ of the particle with respect to time $t$. Note that the integral runs from $a$ to $b$, and, again, it is not clear what differentiating this expression with respect to $x$ means. Lastly, even if we differentiate with respect to $b$ we would get
$$F(x(t))\cdot x' (t)$$
so I have trouble seeing where the result $-F(x(t))$ comes from.
 A: I shall present a more simpler way to get the required result, from which you shall see the law of conservation of energy pops up!
consider the work done by an external force, $\textbf{F}$, on  a particle going from point $\textbf{r}_1$ to $\textbf{r}_2$, the work done is defined as:
$$W=\int_{\textbf{r}_1}^{
\textbf{r}_2}\textbf{F}\cdot d\textbf{r}$$
Now, assuming a constant mass system,
$$W=m\int_{\textbf{r}_1}^{
\textbf{r}_2}\textbf{v}\cdot\dot{\textbf{v}}dt=\frac{m}{2}\int_{t_1}^{
t_2}\frac{d}{dt}v^2dt$$
Hence,
\begin{equation}
    W=\frac{m}{2}(v_2^2-v_1^2)
\end{equation}
We identify each of the terms as the kinetic energies $T_2,T_1$.\
Now, suppose the work done is independent of each of the paths joining the initial and final points, then the force is said to be conservative. Hence, it trivially follows that, the work done under the influence of a conservative force field, in a closed path is 0.
Now, a necessary and a sufficient condition for work done to be independent of paths, is:
\begin{equation}
    \textbf{F}=-\nabla(V(r))
\end{equation}
Now, using the form of total derivatives:
$$\textbf{F}\cdot d\textbf{r}=-\sum_{i}\frac{\partial V}{\partial x_i}dx_i=-dV$$
It is easy to see that since, V is only a function of r, we get the work done independent of path taken to reach from the initial to the final point.\
Thus,
$$W=V(r_1)-V(r_2)=V_1-V_2$$
which gives, the Law of Conservation of Energy:
$$T_1+V_1=T_2+V_2=C$$
A: it is by definition.
By definition, the change in potential energy is:
$$U(b)-U(a) = \int_{a}^{b} -\vec{F}(x,y,z) \cdot \vec{dr}$$
Given I have some path, and some field,  I can find the work done against the field. Moving some object from a, and ending on position b.
$-\vec{F}(x,y,z)$ is conservative.
The best way to show this is by showing that $$\nabla × -\vec{F} = 0$$
This means it can be written as the gradient of some scalar function, by definition of it being  conservative.
$$-\vec{F} = \nabla U$$
$$\vec{F} = -\nabla U$$
But why should this U  be the same U that we have defined to be our potential energy difference?
From the fundamental theorem  of line integrals.
$$U(b)-U(a) = \int_{a}^{b} \nabla U \cdot \vec{dr}$$
If a vector field can be written as the gradient of some scalar function, its line integral depends upon the evaluation of that scalar function at the start and end of the path.
[Which,if you substitute it in, IS the definition of potential energy difference]
I prefer to start with this, show the field is Conservative  and then substitute the definitions of the the potential function, to "define" the change in potential energy.
Given I have some path, under a parameterization variable t
$$\vec{r}(t) = x(t) \hat i + y(t) \hat j + z(t)\hat k$$
$$\frac{\vec{dr}}{dt} = x'(t) \hat i + y'(t) \hat j + z'(t)\hat k$$
$$\vec{dr} = [x'(t) \hat i + y'(t) \hat j + z'(t)\hat k]dt$$
This is redefining out path in the variable t, instead of x,y,z
And as such we have  $\vec{F}(x(t),y(t),z(t))$ As we are evaluating this integral in the variable t, we need to find the value of the field, as a function of t, since we are dealing with a specific x,y,z location of an object, in terms of the variables t.
a also becomes $t_{0}$
b becomes  $t_{1}$
Where $r(t_{0}) = a$
$r(t_{1}) = b$
