# Difficult limits

**Calculus**Level 4

Let \(f\left(x\right) = {x^{n+2} + a_1 x^{n+1} + ... + a_{n+1} x + 1}\), and \(g(x) = \frac{f\left(x\right)}{\left(x+1\right)^{n+1}} \), where \(n \geq 0\) is an integer, and \(x\), \(a_1\), ..., \(a_{n+1}\) are real numbers

Find the sum of all possible values of \(\displaystyle \lim_{x \to 1} g(x)\) when \(\displaystyle \lim_{x \to -1} g(x)\) is defined, and \(\frac{d}{dx} f(-1) = \frac{d^2}{d^2 x} f(-1) = \cdots = \frac{d^{n+1}}{d^{n+1} x} f(-1)\)