# Stein's Paradox and James Stein Estimator

I am trying to figure the intermediate steps in the proof of the Stein's paradox. How does it go from the left to the right? $$\frac{\partial}{\partial Y_i} \left\{\frac{Y_i }{\sum_j Y_j^2}\right\} = \frac{\sum_j Y_j^2 - 2Y_i^2 }{(\sum_j Y_j^2)^2}$$

The part I have trouble with is:

How would you differentiate this: $$\frac{\partial}{\partial Y_i} \left\{ \frac{1}{\sum_j Y_j^2}\right\}$$

-
Note that $\sum_j Y_j^2 = Y_i^2+\sum_{j\ne i} Y_j^2$. –  Hagen von Eitzen Jan 5 '13 at 17:01

Let $S=\displaystyle\sum_jY_j^2$, then $\dfrac{\partial S}{\partial Y_i}=2Y_i$ and $\dfrac{\partial Y_i}{\partial Y_i}=1$ hence $$\frac{\partial}{\partial Y_i}\left\{\frac{Y_i}{S}\right\}=1\cdot\frac1{S}+Y_i\cdot\left(2Y_i\cdot\frac{-1}{S^2}\right)=\frac{S-2Y_i^2}{S^2}.$$