You can underline a component of an equation using the ul command.

Example.

is entered as (x+4)(x+3)=x2+ul(3x+4x)+12 = x2+ul(7x)+12