We have the following definition given in our textbook:
Let $U \subseteq \mathbb{R}^n$ be open and $F: U \rightarrow \mathbb{R}$ be continuously partial differentiable. If $a, b \in U$ and $\gamma$ is a piecewise differentiable path from a to b, that lies completely in $U$ ($[a,b]\in U$), then: $$\int_\gamma (\operatorname{grad} F) \cdot dx = F(b)-F(a)$$
This is obviously super useful for solving line integrals $$\int_\gamma f\,dx$$ where we can find $F$ such that $\operatorname{grad} F = f$. My question is:
why doesn't the path matter in these cases? If I have two paths $\gamma$ and $\gamma^*$ with the same origin/destination but with completely different paths, this tells me the line integral is the same. Why does this make sense?
First, note that this formula only applies to (in fact only makes sense for) line integrals of certain vector fields $\bf F$, namely conservative ones, that is, those of the form $${\bf X} = \operatorname{grad} F$$ for some function $F : U \to \Bbb R$ and (when $n > 1$) this is a very strong restriction: In a sense that can be made precise, most vector fields are not conservative.
So, procedurally, the formula (called the "Fundamental Theorem of Calculus for line integrals") works because we restrict our attention to line integrals of vector fields for which the formula will work. And it's not surprising that the formula works for conservative vector fields: After all, $\operatorname{grad} f \cdot d{\bf s}$ is the infinitesimal change of $f$ along the path $\gamma : [a, b] \to U$ with length element $d{\bf s}$, so by definition $\int_\gamma \operatorname{grad} F \cdot d{\bf s}$ is just the total change of $F$ along the path from $a$ to $b$. But we already know $F$ and the values $F(a), F(b)$ at its endpoints, so the total change along the path is $$\int_\gamma \operatorname{grad} F \cdot d{\bf s} = F(b) - F(a) ,$$ which doesn't depend on the path $\gamma$ connecting those endpoints.