From Spivak's Calculus.
This proof is motivated by the observation that |a| = $\sqrt {a^2}$. $\sqrt x$ denotes the positive square root of x; this symbol is defined only when x $\geq 0$. We may now observe that.
$$ (|a + b|)^2 = (a+b)^2 = a^2 + 2ab + b^2 \leq a^2 + 2|a| |b| + b^2 \\ =|a|^2 + 2|a| |b| + |b|^2 =(|a| + |b|)^2 $$
I don't understand why the $\leq$ appears in line 2, and then changes to $=$ in line 3. Thank you.
It doesn't really "change" in the sense that the equality is replaced by an inequality or vice versa; what you have here is a chain of equations and an inequality, which say that $(|a+b|)^2 = (a+b)^2$ and $(a+b)^2 = a^2+2ab+b^2$ and $a^2+2ab+b^2\leq a^2+2|a|*|b|+b^2$, etc.