A variational approach to the establishment of a lubrication equation for a non-Newtonian thin film