There are numbers $A$ and $B$ for which  \[\frac A{x-1}+\frac B{x+1}=\frac{x+2}{x^2-1}\]for every number $x\neq\pm1$.  Find $A-B$.
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
There are numbers $A$ and $B$ for which  \[\frac A{x-1}+\frac B{x+1}=\frac{x+2}{x^2-1}\]for every number $x\neq\pm1$.  Find $A-B$.
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
2
There are numbers $A$ and $B$ for which  \[\frac A{x-1}+\frac B{x+1}=\frac{x+2}{x^2-1}\]for every number $x\neq\pm1$.  Find $A-B$.
train