Leveraging Analytic Gradients in Provably Safe Reinforcement Learning