# Is the square-root of $x^2$ not $x?$

What happened to $x^2$

My question is what happened to the yellow part of the equation, why does it disappear in the new line. I understand that if you take the square root of $x^2$ then it should be $x,$ but in the second line of equation we only have the sum of $xy$ with square-root of $n-1.$ Please provide a dummy explanation. Also if you have time, please explain the red part of the equation?

Please be aware there is a picture attached. Please click on "What happened to $x^2$".

• The answer to the question in the title is no, the square root of $x^2$ is not $X$. Capital $X$ and $x$ are different things. – Ross Millikan Sep 1 '16 at 23:29
• It's easier than it looks. Let $X =\sum x_i^2; S = \sum_x_iy_i$ and $V = \sum (y_i-x_i\beta)^2$. Then this statement is: $\frac SX\sqrt {\frac {(n-1)X}{V}}=\frac {\sqrt {n-1}S}{\sqrt {XV}}$. That's not surprising. – fleablood Sep 1 '16 at 23:54

$$\frac{\sum x_iy_i}{\sum x_i^2}\sqrt{\frac{(n-1)\sum x_i^2}{\sum(y_i-x_i \beta )^2}} = (\sum x_iy_i)\sqrt{\frac{(n-1)\sum x_i^2}{(\sum x_i^2)^2\sum(y_i-x_i \beta )^2}} = (\sum x_iy_i)\frac{\sqrt{(n-1)}}{\sqrt{(\sum x_i^2)\sum(y_i-x_i \beta )^2}}$$

The sum in the denominator was brought under the square root, then appropriate terms were cancelled in the fraction.

• it says Math Processing Error, please edit – Boro Dega Sep 1 '16 at 23:34
• @Boro Dega I'm not exactly sure how to handle this; it comes up fine on my screen. Is anyone else getting this error? – Christian Sep 1 '16 at 23:35
• @Christian: I'm not getting an error. – Will R Sep 1 '16 at 23:38
• @Christian I believe it is a browser thing. Works fine with Firefox, but not in Chrome:) – Boro Dega Sep 1 '16 at 23:42
• @Christian Thanks for a very simplistic answer. – Boro Dega Sep 1 '16 at 23:49

Here's what happened: $$\frac{A}{C}\sqrt{\frac{B\cdot C\strut}{D}}=\frac{A}{C}\cdot\frac{\sqrt{B\strut}\cdot \sqrt{C\strut}}{\sqrt{D\strut}}=\frac{\sqrt{B\strut}\cdot A}{\sqrt{C\strut}\cdot \sqrt{D\strut}}=\frac{\sqrt{B\strut}\cdot A}{\sqrt{C\cdot D\strut}}$$ where $$\textstyle A=\sum x_iy_i\qquad B=n-1 \qquad C=\sum x_i^2\qquad D=\sum (y_i-x_i\beta)^2$$ Note that these steps are permitted and make sense since $A$, $B$, $C$, and $D$ are all non-negative.

• That is indeed what happened; what appears to be missing from this answer is why. – Will R Sep 1 '16 at 23:37
• @WillR: The point of my answer is that it may be clearer to see that what happened is nothing more than a simple manipulation with some judicious choices of what to hide underneath a variable name. However, I can add some more steps I suppose. – Zev Chonoles Sep 1 '16 at 23:39
• "Why?"? What do you mean why? Because. That's why. It's just math. Square roots and fractions and positive real numbers. – fleablood Sep 1 '16 at 23:59

In the equation you show we can define $\sum x_i^2=k$ The upper equation has $\sqrt k$ in the numerator and $k$ in the denominator. The lower expression, whic should be equal to $t$ as well, has $\sqrt k$ in the denominator. As long as $k \gt 0, \frac {\sqrt k}k=\frac 1{\sqrt k}$ It was just brought into the square root sign.