Pātuhitia tēnei: Calculus of variations with applications to physics and enginnering