Deriving the kinematic equation $\frac{1}{2}v(t_f)^2 - \frac{1}{2}v(t_0)^2 = ax(t_f)-ax(t_0)$ I am trying to deduce the equation
$\frac{1}{2}v(t_f)^2 - \frac{1}{2}v(t_0)^2 = ax(t_f)-ax(t_0)$
Using substitution 
$\int_{g(b)}^{g(a)} f(x) = \int_{a}^{b} f(g(x))g'(x)$
I tried with 
$\int_{x(t_0)}^{x(t_f)} a(t) = \int_{t_0}^{t_f} a(x(t))x'(t)$
I just dont see how $\frac{v^2(t)}{2}$ can be a primitive of $a(x(t))x'(t)$
because $\frac{d(\frac{v^2(t)}{2})}{dt}=a(t)x'(t)$
 A: Work is closely related to energy. The work-energy principle states that an increase in the kinetic energy of a rigid body is caused by an equal amount of positive work done on the body by the resultant force acting on that body. Conversely, a decrease in kinetic energy is caused by an equal amount of negative work done by the resultant force.
From Newton's second law, it can be shown that work on a free (no fields), rigid (no internal degrees of freedom) body, is equal to the change in kinetic energy ${\displaystyle K_{E}}$ of the velocity and rotation of that body
$$W=\Delta K_{E}\tag{1}.$$
Now, work is the result of a force on a point that moves through a displacement. As the point moves, it follows a curve $\textbf{X}$, with a velocity $\text{v}$, at each instant. The small amount of work $\delta W$ that occurs over an instant of time $dt$ is calculated as
$$\delta W=\vec{F}\cdot d\vec{s}=\vec{F}\cdot\vec{v}\ dt$$
where the $\vec{F}\cdot \vec{v}$ is the power of the instant $dt$. The sum of these small amounts of work over the trajectory of the point yields the work,
$$W=\int^{t_{2}}_{t_{1}}\vec{F}\cdot\vec{v}\ dt=\int^{t_{2}}_{t_{1}}\vec{F}\cdot\frac{d\vec{s}}{dt}\ dt=\int_{C}\vec{F}\cdot\ d\vec{s},$$ where $C$ is the trajectory from $\vec{x}(t_{1})$ to $\vec{x}(t_{2})$. This integral is computed along the trajectory of the particle, and is therefore said to be path dependent.
If the force is always directed along this line, and the magnitude of the force is $F$, then this integral simplifies to
$$W=\int_{C}F\ ds,$$ where $s$ is the displacement along the line. If $\textbf{F}$ is constant, in addition to being directed along the line, then the integral simplifies further to 
$$W=\int_{C}F\ ds=F\int_{C}ds=Fs\tag{2}$$ where s is the displacement of the point along the line, given by $\Delta x=x(t_{f})-x(t_{0})$.
Combining (1) and (2), we get 
\begin{alignat*}{3}
 \Delta K_{E}&=Fs\\
\iff  \frac{1}{2}m v^2_{t_{f}}-\frac{1}{2} m v^2_{t_{0}}&=m  a \Delta x\\
\iff  \frac{1}{2}m v^2_{t_{f}}-\frac{1}{2} m v^2_{t_{0}}&=m  a \left(x(t_{f})-x(t_{0})\right)\\
\iff\quad\  \frac{1}{2} v^2_{t_{f}}-\frac{1}{2}  v^2_{t_{0}}&=  a \left(x(t_{f})-x(t_{0})\right)\\
\iff  \quad\ \frac{1}{2} v^2_{t_{f}}-\frac{1}{2}  v^2_{t_{0}}&=   ax(t_{f})-ax(t_{0})\text{, as desired.}
\end{alignat*}
A: You are right to have doubts on this formula if the force/acceleration $a$ is not a constant. If $a$ is a constant, you can either integrate
$$
\ddot x(t)=\dot v(t)=a,\\
\dot x(t)=v(t)=v_0+a(t-t_0),\\
x(t)=x_0+v_0(t-t_0)+\frac12a(t-t_0)^2,
$$
or you multiply with $\dot x=v$ to get
$$
v(t)\dot v(t)=a\dot x(t),\\
\frac12v(t)^2-\frac12v_0^2=a(x(t)-x_0).
$$
If the force field is not constant, a similar argument only works if it is a conservative field, that is $a(x)=-\nabla p(x)$ is the negative gradient of a potential function (for physics add mass factors). Then you can integrate
$$
v(t)\dot v(t)=a(x(t))\dot x(t)=-\nabla p(x(t))\dot x(t),\\
\frac12(v(t)^2-v_0^2)=-p(x(t))+p(x_0).
$$
The right side is by the chain rule $\frac d{dt}p(x(t))=p'(x(t))\dot x(t)$ and making no difference between gradient and differential.
A: Let's use the definition of the work in 1 dimension:
$$W=\int_{s_1}^{s_2} F\space\mathrm{d}s$$
$$W=\int_{s_1}^{s_2} ma\space\mathrm{d}s$$
$$W=\int_{s_1}^{s_2} m\frac{\mathrm{d}v}{\mathrm{dt}}\space\mathrm{d}s$$
$$W=\int_{s_1}^{s_2} m\frac{\mathrm{d}v}{\mathrm{ds}}\frac{\mathrm{ds}}{dt}\space\mathrm{d}s$$
$$W=\int_{v_1}^{v_2} m\frac{\mathrm{ds}}{dt}\space\mathrm{d}v$$
$$W=\int_{v_1}^{v_2} mv\space\mathrm{d}v$$
$$W=m\frac{v_2^2}{2}-m\frac{v_1^2}{2}$$
But we can calculate it this way too:
$$W=\int_{s_1}^{s_2} F\space\mathrm{d}s$$
$$W=\int_{s_1}^{s_2} ma\space\mathrm{d}s$$
And if the acceleration is constant, we get:
$$W=ms_2-ms_1$$
But the 2 work are equal:
$$m\frac{v_2^2}{2}-m\frac{v_1^2}{2}=ms_2-ms_1$$
