Pātuhitia tēnei: Convex analysis and variational problems