A Google executive’s “happiness equation” got him through the grief of losing a son