How do I get the integral of $\frac{1}{(x^2 - x -2)}$ I'm working with this problem $$ \int \frac{1}{x^2 - x - 2}$$
I'm thinking I break up the bottom so that it looks like this $$\int \frac{1}{(x-2)(x+1)} $$
Then I do $$x^2 - x -2 =  \frac{A}{x-2} + \frac{B}{x+1} $$
Multiple both sides by the common denominator and come out with $$ A(x+1) + B(x-2) = x^2 - x - 2 $$
Which equals $$Ax + A + Bx - 2B = x^2 - x - 2$$
Or $$ (A+B)x + (A-2B) = x^2 - x - 2$$
After that I tried to get values for my A and B but it doesn't seem right since I don't have anything for the $x^2$
Did I mess up somewhere?

Your error is in the step where you write:
$$x^2 - x -2 =  \frac{A}{x-2} + \frac{B}{x+1}$$
What you have, actually, is $$\dfrac 1{x^2 - x - 2} = \dfrac A{x-2} + \frac B{x+1}$$
So $A(x+1) + B(x - 2) = 1$.
If $x = -1$, $$A(-1 + 1) + B(-1 - 2) = 1 \iff -3B = 1 \iff B = -\frac 13$$
If $x = 2$, $$A(2 + 1) + B(2 - 2) = 1 \iff 3A = 1 \iff A = \frac 13$$
$$\int \dfrac {dx}{x^2 - x - 2} = \int \left(\dfrac A{x-2} + \frac B{x+1}\right)\,dx = \int \left(\frac 1{3(x-2)} - \frac{1}{3(x + 1)}\right)\,dx$$
Can you take it from here?
