Walk me through the mathematical formulation of a Kalman filter and explain how it handles non-linearities in a tracking system.