To add or subtract expressions, expand them to make their denominators the same. Least common multiple of $\left(x+1\right)^{2}$ and $\left(x-1\right)^{2}$ is $\left(x-1\right)^{2}\left(x+1\right)^{2}$. Multiply $\frac{1}{\left(x+1\right)^{2}}$ times $\frac{\left(x-1\right)^{2}}{\left(x-1\right)^{2}}$. Multiply $\frac{1}{\left(x-1\right)^{2}}$ times $\frac{\left(x+1\right)^{2}}{\left(x+1\right)^{2}}$.
Since $\frac{\left(x-1\right)^{2}}{\left(x-1\right)^{2}\left(x+1\right)^{2}}$ and $\frac{\left(x+1\right)^{2}}{\left(x-1\right)^{2}\left(x+1\right)^{2}}$ have the same denominator, add them by adding their numerators.