Between Integrals And Optima: New Methods For Scalable Machine Learning