Happiness is the function being maximized, whereas money is just one of several parameters/variables in the equation. It's an important distinction. You can't treat them as two parameters being maximized - for a few rare people, for example, the two are completely inversely related.