Answer
$x+2$.
Work Step by Step
The given expression is
$=\frac{x^2-x-6}{x+1}\div \left ( \frac{x^2-9}{x^2-1} \cdot \frac{x-1}{x+3} \right )$
Factor $x^2-x-6$.
Rewrite the middle term $-x$ as $-3x+2x$.
$=x^2-3x+2x-6$
Group terms.
$=(x^2-3x)+(2x-6)$
Factor each term.
$=x(x-3)+2(x-3)$
Factor out $(x-3)$.
$=(x-3)(x+2)$.
Factor $x^2-9$.
$=x^2-3^2$
Use algebraic identity $a^2-b^2=(a+b)(a-b)$.
$=(x+3)(x-3)$
Factor $x^2-1$.
$=x^2-1^2$
Use the algebraic identity $a^2-b^2=(a+b)(a-b)$.
$=(x+1)(x-1)$
Substitute all factors into the given expression.
$=\frac{(x-3)(x+2)}{x+1}\div \left ( \frac{(x+3)(x-3)}{(x+1)(x-1)} \cdot \frac{x-1}{x+3} \right )$
Cancel common terms
$=\frac{(x-3)(x+2)}{x+1}\div \left ( \frac{x-3}{x+1} \right )$
$=\frac{(x-3)(x+2)}{x+1}\times \frac{x+1}{x-3} $
Cancel common terms.
$=x+2$.