I was solving a differentiation problem but my answer is coming different from the one in the textbook.The question is:-

**Differentiate the following equation where n is a constant**
$$ y = \frac{x^{-n-2}}{n} + \frac{1}{x^{n^2}} + x$$

$$ y = \frac{\frac{d(x^{-n-2})}{n}}{dx} + \frac{d(\frac{1}{x^{n^2}})}{dx} + \frac{d(x)}{dx} $$

$$ y = (\frac{-n-2}{n})(x^{-n-3}) + \frac{d(x^{-n^2})}{dx} + 1 $$

$$ y = \frac{-(n+2)}{n}(x^{-n-3}) + (-n^2)(x^{-n^2-1}) + 1 $$

$$ y = \frac{-(n+2)}{n}(x^{-n-3}) + \frac{(-n^2)}{(x^{n^2+1})} + 1 $$

**But the book says that the answer is:-**
$$ y = \frac{-(n+2)}{n}(x^{-n-3}) + \frac{(-n^2)}{(x^{n^2-1})} + 1 $$

Is it a printing mistake or is my answer wrong
Thanks in advance.