While doing a physics lab, I noticed that the error analysis equation for multiplication $$R = \frac{X*Y}{Z}$$ $$ \delta R = |R|\sqrt{\left(\frac{\delta X}{X}\right)^2+\left(\frac{\delta Y}{Y}\right)^2+\left(\frac{\delta Z}{Z}\right)^2}$$ is not algebraically equivalent to $$R = X^n$$ $$\delta R = |n|*\frac{\delta X}{|X|}*|R|$$ For example, if we take $R = X*X$ then the first equation gives $\sqrt{2}*\left(\frac{\delta X}{|X|}\right)*X^2$. But if we take $R = X^2$ then the second equation gives $2*\left(\frac{\delta X}{|X|}\right)*X^2$.
Why is this the case? I have feeling that I should only use the first equation for differing variables $X$ and $Y$, but I don't understand why.