Dot product with binomials I have the following proof:
$$||\vec{u} + \vec{v}||^2 = (\vec{u} + \vec{v}) \cdot (\vec{u} + \vec{v})$$
$$= ||\vec{u}||^2 + 2(\vec{u} \cdot \vec{v}) + ||\vec{v}||^2$$
$$= ||\vec{u}||^2 + ||\vec{v}||^2$$
I don't understand the second line of this. How is the dot product calculated with binomials inside of the terms? The vectors seem to be treated as normal variables here, but why is that? Thanks in advance.
Added after: $\vec{u}$ and $\vec{v}$ are perpendicular.
 A: For scalars, you have a lot of operations like sum, subtractions, multiplication and so on. I think you are used to it.
For vectors, you also have many operations, but the operations are a little bit different.
Sum and subtraction of vectors, gives us a new vector with components computed by adding/subtracting the components of the two vectors.
$$
\vec{u} \pm \vec{v} = \vec{w}
$$
$$
u_i \pm v_i = w_i
$$
Then, what happens for multiplication? You could define
$$\vec{u} \cdot \vec{v} = \vec{w}$$
$$u_i \cdot v_i = w_i$$
But for many applications, it's useful to have the inner product which the multiplication of two vectors gives you a scalar:
$$
\vec{u} \cdot \vec{v} = w
$$
$$
\sum u_i \cdot v_i = w
$$
The same happens for absolute:
$$|x| = \begin{cases}-x\ \ \ \text{if} \ x< 0 \\
x \ \ \ \text{else}\end{cases}$$
But for vectors we define
$$\|\vec{u}\| = \sqrt{\sum u_{i}^2}$$
For "coincidence" we see that
$$
\|\vec{u}\| = \sqrt{\vec{u} \cdot \vec{u}}
$$
$$
\|\vec{u}\|^2 = \vec{u} \cdot \vec{u}
$$
In that case you can "transform" the absolute of a vector as an operation with two vectors
\begin{align*}
\|\vec{u} \pm \vec{v} \|^2 & = \left(\vec{u} \pm \vec{v}\right)\cdot \left(\vec{u} \pm \vec{v}\right) \\
& = \vec{u} \cdot \vec{u} \pm 2 \vec{u} \cdot \vec{v} + \vec{v} \cdot \vec{v} \\
& = \|\vec{u}\|^2 \pm 2 \vec{u} \cdot \vec{v} + \|\vec{v}\|^2
\end{align*}
Or using the indicial notation
\begin{align*}
\sum \left(u_i \pm v_i\right)^2 & = \sum \left(u_i \pm v_i\right) \cdot \left(u_i \pm v_i\right) \\
& = \sum u_i^2 \pm 2 u_i v_i + v_i^2 \\
& = \left(\sum u_i^2 \right) \pm 2 \left(\sum u_i v_i\right) + \left(\sum v_i^2\right)
\end{align*}
When we work with the vectors, some operations seems like the scalar operations, but they are not.
We can treat vectors as normal variables (mean, scalars), but only for some operations (like sum, subtraction).
And it's wanted to their operations be similar to the scalar operations, cause we don't get too confused while working with them.
