<s>[INST] How to simplify this to the given answer? I'm trying to simplify:
$$\frac{x^2}{x^2-4}-\frac{x+1}{x+2}$$
but I can't get to the answer:
$$\frac{1}{x-2}$$
How to do it?
 [/INST] First, do the operation by finding the least common denominator. Since $x^2-4 = (x-2)(x+2)$, the least common denominator is already $x^2-4$. Then do some simple algebra:
\begin{align*}
\frac{x^2}{x^2-4} - \frac{x+1}{x+2} &= \frac{x^2 - (x+1)(x-2)}{x^2-4} = \frac{x^2-(x^2-x-2)}{x^2-4}\\
 &= \frac{x+2}{x^2-4} = \frac{x+2}{(x-2)(x+2)} = \frac{1}{x-2}.
\end{align*}
If you didn't realize that $x+2$ already divides $x^2-4$, you probably would get
\begin{align*}
\frac{x^2}{x^2-4} - \frac{x+1}{x+2} &= \frac{x^2(x+2) - (x+1)(x^2-4)}{(x^2-4)(x+2)}\\
&= \frac{x^3 + 2x^2 - (x^3 +x^2 - 4x - 4)}{(x^2-4)(x+2)}\\
&= \frac{x^2 +4x + 4}{(x^2-4)(x+2)} = \frac{(x+2)^2}{(x^2-4)(x+2)}\\
&= \frac{x+2}{x^2-4} = \frac{1}{x-2},
\end{align*}
with the extra work for not noticing.
</s>