Simplifying $\frac{a^3 +ab + a^2 -b}{a^3 +ab +a^2 +b}$ For context, this is high school algebra and I'm trying to simplify this fraction:
$$\frac{a^3 +ab + a^2 -b}{a^3 +ab +a^2 +b}$$
My textbook says that the simplified answer is:
$$\frac{a^3 +ab + a^2 -b}{(a^2+b)(a+1)}$$
BUT, I thought I could simplify to:
$$\frac{(a^2-b)(a+1)}{(a^2+b)(a+1)}$$
Why is it correct to simplify the denominator this way, but not the numerator?
Thank you.
 A: @Jay - as others have said in the comments, your factorisation wasn't right. You ask whether there any rules or any trick that you're. Here are a couple:
If $(a-1)$ is a factor of an expression then setting $a=1$ will make it zero. So put $a=1$ into the original expression and see what you get. Similarly, if $(a^2-b)$ is a factor of an expression then setting $a^2=b$ will make it zero.
If you expand out two binomials with all positive signs, you will get 4 terms and they will all be positive:
$$(p+q)(r+s)=pr+ps+qr+qs$$
Similarly, If you expand out two binomials and there is one minus sign, you will get 4 terms and two will be negative:
$$(p+q)(r-s)=pr-ps+qr-qs$$
You can see that it's hard to get exactly one minus sign from this sort of exercise.
Depending on the complexity of what you are looking at, some terms may cancel or combine. The classic is:
$$(p-q)(p+q)=p^2+pq-pq-q^2=p^2-q^2$$
But there is also, for example:
$$(p-q)(p^2+pq+q^2)=p^3-q^3$$
In the last example note that there are $2 \times 3 = 6$ terms but 4 of them cancel. Both sides are zero when $p=q$.
