My textbook at one point does the following:
$\ddot{x} = \frac{d \dot{x}}{dt} = \frac{d \dot{x}}{dx} \frac{dx}{dt} = \frac{d}{dx} \left(\frac{1}{2} \dot{x}^2 \right)$
I don't quite understand the last step here. Surely $\dfrac{dx}{dt} = \dot{x}$, so why isn't the last expression $\dfrac{d}{dx}(\dot{x})$?
I would greatly appreciate it if someone could explain this to me.