Derivative of $x^2-\frac{1}{x^2}$ not matching WolframAlpha result I was calculating a very simple derivative of
$$
f(x) = x^2-\frac{1}{X^2}
$$
and my result is
$$
f^{\prime}(x) = 2x + \frac{2}{x^3}
$$
But I can't explain why WolframAlpha says the result is $2x$. It asserts that 

The derivative of $-\frac{1}{X^2}$ is zero thus
  $ = 2x+0$

However, when you ask it to compute the derivative of $-\frac{1}{X^2}$ alone, the result is $\frac{2}{X^3}$ as expected. Is there something I'm missing?
Here's my full solution.
$$\begin{aligned}
f^{\prime}(x) = &2x-(x^{-2})^{\prime}
\\
=&2x-(-2x^{-3})
\\
=&2x+2x^{-3}
\\
=&2x+\frac{2}{x^3}.
\end{aligned}$$
 A: When you specify an expression for $f(x)$ and take the derivative, all other variables apart from $x$ are considered constants. Here, $X$ is such a constant that must not be confused with $x$.
When you submit the expression $\frac1{X^2}$ instead, there is only one variable ocurring on the expression andWolframAlpha tacitly assumes that you want to take the derivative with respect to that (i.e. apply the operator $\frac {\mathrm d}{\mathrm d X}$ and not $\frac {\mathrm d}{\mathrm d x}$).
A: You did not use the same variable. Wolframalpha will make a difference between $x$ and $X$. It took the derivative with respect to $x$, so of course $\frac{d}{dx} X=0$.
A: In your link at Wolfram|Alpha, you wrote $$ \dfrac {\mathrm{d}}{\mathrm{d}x} \left( x^2 - \dfrac {1}{X^2} \right), $$whereas you should have written $$ \dfrac {\mathrm{d}}{\mathrm{d}x} \left( x^2 - \dfrac {1}{x^2} \right). $$ Wolfram now thinks you want to take the partial derivative with respect to $x$, leaving $X$ as some extra constant.
