Answer
$4$.
Work Step by Step
The given expression is
$(x+3)(x+?)=x^2+7x+12$
Factor the right hand side.
$=x^2+7x+12$
$=x^2+4x+3x+12$
$=x(x+4)+3(x+4)$
$=(x+3)(x+4)$
Plug into the given expression.
$(x+3)(x+?)=(x+3)(x+4)$
The $x+3$ values cancel, so we get that $x+?=x+4$. Cancelling x we get that the $?$ must equal $4$.