Standard Boost Lorentz Transformation. Proof of Invariance

From my Textbook when proving invariance to a 4 vector. We apply a standard Lorentz Boost: $$s' = x_1'^2+x_2'^2+x_3'^2-x_4'^2$$ $$s' = \gamma^2 (\mathbf{x_1}-\beta \mathbf{x_4})^2+x_2^2+x_3^2-\gamma^2(-\beta \mathbf{x_1}+\mathbf{x_4})^2$$ $$s' = \gamma^2 (1-\beta^2)\mathbf{x_1}^2+x_2^2+x_3^2-\gamma^2 (1-\beta^2)\mathbf{x_4}^2$$ $$\gamma^2(1-\beta^2)=1$$ $$s' = (1)x_1^2+x_2^2+x_3^2-(1)x_4^2=s$$

My question concerns the bold terms in the derivation in lines 2 and 3. How can we write: $$\gamma^2 (\mathbf{x_1}-\beta \mathbf{x_4})^2=\gamma^2 (1-\beta^2)\mathbf{x_1}^2$$ $$\gamma^2(-\beta \mathbf{x_1}+\mathbf{x_4})^2=\gamma^2 (1-\beta^2)\mathbf{x_4}^2$$

Did we assume $x_1=x_4$ ? if so,why?

• The second line equals the third without any assumption about the relation between $x_1$ and $x_4$. But the first terms in those two line are not equal, and neither are the last (so the equalities you asked about in the second part of the question do not hold). There has been some rearrangement. Commented Mar 11, 2017 at 21:55
• I assumed too much. you're right, the textbook just moved the terms around. Thanks for clearing it up for me! Commented Mar 11, 2017 at 21:59
• Your assumption is incorrect. From line 2 if you expand the two parentheses, then it will become obvious. terms are rearranged. Commented Mar 20, 2017 at 13:04