Answer
$\frac{3a(a-3)}{(a+4)(3a-5)}$.
Work Step by Step
The given expression is
$\Rightarrow \frac{\frac{2}{a^2+2a-8}+\frac{1}{a^2+5a+4}}{\frac{1}{a^2-5a+6}+\frac{2}{a^2-a-2}}$
First solve the numerator.
$=\frac{2}{a^2+2a-8}+\frac{1}{a^2+5a+4}$
Factor all terms.
$\Rightarrow a^2+2a-8$
Rewrite the middle term $2a$ as $4a-2a$.
$\Rightarrow a^2+4a-2a-8$
Group terms.
$\Rightarrow (a^2+4a)+(-2a-8)$
Factor each group.
$\Rightarrow a(a+4)-2(a+4)$
Factor out $(a+4)$.
$\Rightarrow (a+4)(a-2)$
$\Rightarrow a^2+5a+4$
Rewrite the middle term $5a$ as $4a+1a$.
$\Rightarrow a^2+4a+1a+4$
Group terms.
$\Rightarrow (a^2+4a)+(1a+4)$
Factor each group.
$\Rightarrow a(a+4)+1(a+4)$
Factor out $(a+4)$.
$\Rightarrow (a+4)(a+1)$
Substitute back all factors.
$=\frac{2}{(a+4)(a-2)}+\frac{1}{(a+4)(a+1)}$
The LCD of the denominators is $(a+4)(a+1)(a-2)$.
$=\frac{2(a+1)}{(a+4)(a+1)(a-2)}+\frac{1(a-2)}{(a+4)(a+1)(a-2)}$
$=\frac{2(a+1)+1(a-2)}{(a+4)(a+1)(a-2)}$
$=\frac{2a+2+a-2}{(a+4)(a+1)(a-2)}$
Simplify.
$=\frac{3a}{(a+4)(a+1)(a-2)}$
Now solve the denominator of the given fraction.
$=\frac{1}{a^2-5a+6}+\frac{2}{a^2-a-2}$
Factor all the terms.
$\Rightarrow a^2-5a+6$
Rewrite the middle term $-5a$ as $-3a-2a$.
$\Rightarrow a^2-3a-2a+6$
Group terms.
$\Rightarrow (a^2-3a)+(-2a+6)$
Factor each group.
$\Rightarrow a(a-3)-2(a-3)$
Factor out $(a-3)$.
$\Rightarrow (a-3)(a-2)$
$\Rightarrow a^2-a-2$
Rewrite the middle term $-a$ as $-2a+a$.
$\Rightarrow a^2-2a+a-2$
Group terms.
$\Rightarrow (a^2-2a)+(a-2)$
Factor each group.
$\Rightarrow a(a-2)+1(a-2)$
Factor out $(a-2)$.
$\Rightarrow (a-2)(a+1)$
Substitute back all factors.
$=\frac{1}{(a-3)(a-2)}+\frac{2}{(a-2)(a+1)}$
The LCD of the denominators is $(a-3)(a-2)(a+1)$.
$=\frac{a+1}{(a-3)(a-2)(a+1)}+\frac{2(a-3)}{(a-3)(a-2)(a+1)}$
$=\frac{a+1+2(a-3)}{(a-3)(a-2)(a+1)}$
$=\frac{a+1+2a-6}{(a-3)(a-2)(a+1)}$
Simplify.
$=\frac{3a-5}{(a-3)(a-2)(a+1)}$
Back substitute all values into the given fraction.
$\Rightarrow \frac{\frac{3a}{(a+4)(a+1)(a-2)}}{\frac{3a-5}{(a-3)(a-2)(a+1)}}$
Invert the divisor and multiply.
$\Rightarrow \frac{3a}{(a+4)(a+1)(a-2)}\cdot \frac{(a-3)(a-2)(a+1)}{3a-5}$
Cancel common terms.
$\Rightarrow \frac{3a(a-3)}{(a+4)(3a-5)}$.