Solution (source code)

= Solution

The <Lorentz force> in the uniform <magnetic field> gives
$$
\dot{\mathbf L}=\mathbf r\times m\dot{\mathbf v}=q\mathbf r\times(\mathbf v\times\mathbf B)=q[(\mathbf r\cdot\mathbf B)\mathbf v-(\mathbf r\cdot\mathbf v)\mathbf B],
$$
where the last step is the <vector triple product identity>. Hence
$$
\frac d{dt}(\mathbf L\cdot\mathbf B)=q[(\mathbf r\cdot\mathbf B)(\mathbf v\cdot\mathbf B)-B^2(\mathbf r\cdot\mathbf v)].
$$
On the other hand, $|\mathbf r\times\mathbf B|^2=B^2r^2-(\mathbf r\cdot\mathbf B)^2$, so
$$
\frac d{dt}\left(\frac q2|\mathbf r\times\mathbf B|^2\right)=q[B^2(\mathbf r\cdot\mathbf v)- (\mathbf r\cdot\mathbf B)(\mathbf v\cdot\mathbf B)].
$$
The derivatives cancel, proving the <magnetic angular-momentum invariant>
$$
\boxed{\mathbf L\cdot\mathbf B+\frac q2|\mathbf r\times\mathbf B|^2=\text{constant}.}
$$
The magnetic <Lorentz force> is perpendicular to velocity, so its power is zero:
$$
\dot T=m\mathbf v\cdot\dot{\mathbf v}=q\mathbf v\cdot(\mathbf v\times\mathbf B)=0.
$$
Thus \b[the kinetic energy is constant].

For the alternative <kinetic energy> expression, work on an interval where $r>0$ so that the radial <unit vector> $\mathbf u=\mathbf r/r$ is defined. Differentiating $\mathbf u\cdot\mathbf u=1$ once and twice gives
$$
\mathbf u\cdot\dot{\mathbf u}=0,\qquad \mathbf u\cdot\ddot{\mathbf u}=-|\dot{\mathbf u}|^2.
$$
Since $\mathbf v=\dot r\mathbf u+r\dot{\mathbf u}$, it follows that $\mathbf u\cdot\mathbf v=\dot r$ and $v^2=\dot r^2+r^2|\dot{\mathbf u}|^2$. Therefore the <unit-direction kinetic-energy identity> is
$$
\boxed{T=\frac m2\mathbf u\cdot\left[(\mathbf u\cdot\mathbf v)\mathbf v-r^2\ddot{\mathbf u}\right]=\frac m2v^2.}
$$
This identity holds for any twice differentiable trajectory away from the origin, not only for motion in a <magnetic field>.