If I understand how to do the following problem, it will help with the real complicated problem I am actually doing. The problem I wish to understand is how to derive the equations of motion for a magnetic moment m\vec{m} that is in a changing magnetic field B\vec{B}. I know I can use the Lagrangian to quite easily obtain the equations of motion i.e. the motion of θ¨\ddot{\theta} and ϕ¨\ddot{\phi} of the magnetic moment (the reason why I do not want to use the Lagrangian is because the actual problem that I am doing has a piecewise torque function so when the and when integrating the torque to find a potential energy the equation becomes super nasty). Instead I wish to obtain the equations of motion using L=Iω\vec{L}=\mathbf{I}\vec{\omega} where I\mathbf{I} is the moment of inertia tensor. In representing a the magnetic moment as a thin rod, the moment of inertia tensor becomes, I=[λ1000λ20000],\mathbf{I}=\begin{bmatrix} \lambda_1 & 0 & 0 \\ 0 & \lambda_2 & 0 \\ 0 & 0 & 0 \end{bmatrix}, where λ1=λ2\lambda_1 = \lambda_2. The part that I am getting hung up on is the Euler's equation L˙+ω×L=Γ=m×B\dot{\vec{L}}+\omega \times\vec{L}=\vec{\Gamma}=\vec{m}\times\vec{B}: λ1ω1˙(λ2λ3)ω2ω3=Γ1,\lambda_1\dot{\omega_1}-(\lambda_2 - \lambda_3)\omega_2\omega_3=\Gamma_1, λ2ω2˙(λ3λ1)ω3ω1=Γ2,\lambda_2\dot{\omega_2}-(\lambda_3 - \lambda_1)\omega_3\omega_1=\Gamma_2, λ3ω3˙=Γ3,\lambda_3\dot{\omega_3}=\Gamma_3, where the ω\omega terms are in the body frame. So my question is how to implement the torque when the direction is constantly changing i.e. the magnetic field is a function of time and can be pointing in any direction. If I could get help on this one little spot (since the textbooks seem to have nice torques that are perpendicular to an axis) that would be appreciated.