Answer
$(x+5)(x+7)$
Work Step by Step
$\frac{x^2+13x+40}{x-7}\div\frac{x+8}{x^2-49}$
$=\frac{x^2+5x+8x+40}{x-7}\div\frac{x+8}{(x-7)(x+7)}$
$=\frac{(x+8)(x+5)}{x-7}\times\frac{(x-7)(x+7)}{x+8}$
$=\frac{(x+8)(x+5)(x-7)(x+7)}{(x-7)(x+8)}$
$=(x+5)(x+7)$