A more everyday example of a functional in chemistry is calculating the pH of a solution. The pH measures the acidity or basicity of a solution and is calculated from the concentration of hydrogen ions ([H+]) in the solution.
The functional in this case takes the concentration of hydrogen ions and returns the pH, defined as: pH=−log10([H+]).