Rewrite as .

Since both terms are perfect squares, factor using the difference of squares formula, where and .

To write as a fraction with a common denominator, multiply by .

Multiply and .

Combine the numerators over the common denominator.

Apply the distributive property.

Multiply by .

Subtract from .

Subtract 2/(x+1)-x/(x^2-1)