Jensen inequality and the second law