What is the mathematical definition of work? I'm looking for the pure mathematical definition of work, but I haven't yet learned line integrals.
My book says that the work due to a force ${\bf F}$ from point $A$ to point $B$ is
$$
W= |AB|\cdot |{\bf F}|\cdot\cos(\angle AB,{\bf F})
$$
but it also says this only applies for constant forces.
I am assigned a problem which asks me to determine the work of from a point $A$ to $B$ with gravitational force $$F=GmM/R^2.$$ I don't think that I can apply the normal rule above, since it only works for forces that don't change their pointing. Am I mistaken?
 A: Let $\mathbf x(t)$ be the path of a particle.  Let $\mathbf F(t)$ be a force acting on the particle as a function of time, then the work done by the force from time $t_a$ to time $t_b$ is
\begin{align}
  W(t_b, t_a) = \int_{t_a}^{t_b} \mathbf F(t)\cdot \frac{d\mathbf x}{dt}(t)\, dt.
\end{align}
where the center dot denotes dot product;
\begin{align}
  \mathbf F(t)\cdot \frac{d\mathbf x}{dt}(t) = |\mathbf F(t)|\left|\frac{d\mathbf x}{dt}(t)\right| \cos\theta(t)
\end{align}
where $\theta(t)$ is the angle between $\mathbf F(t)$ and $\frac{d\mathbf x}{dt}(t)$.
Technically, the definition I wrote down is also how one defines line integrals, but you don't actually need to know anything about line integrals to understand that expression; it's just an integral in the single variable $t$.
A: The definition of work, it is done on vectors, let's say
$$ \vec F = F_x\hat i+F_y\hat j+F_x\hat k, $$ 
that would be the force and the displacement vector it is
$$ \vec \ell=\ell_x\hat i+\ell_y \hat j + \ell_z\hat k $$
so you have the 3D. Then the definition is
$$W=\int \vec F \cdot d\vec\ell$$
also it would be good to check anyways the dot product and the line integral as well as work.
