Vectors/Vector Algebra

Addition and Subtraction
If $$\mathbf{a}\,$$ and $$\mathbf{b}\,$$ are vectors, then the sum $$\mathbf{c} = \mathbf{a} + \mathbf{b}\,$$ is also a vector.

The two vectors can also be subtracted from one another to give another vector $$\mathbf{d} = \mathbf{a} - \mathbf{b}\,$$.

Multiplication by a scalar
Multiplication of a vector $$\mathbf{b}\,$$ by a scalar $$\lambda\,$$ has the effect of stretching or shrinking the vector.

You can form a unit vector $$\hat\mathbf{b}\,$$ that is parallel to $$\mathbf{b}\,$$ by dividing by the length of the vector $$|\mathbf{b}|\,$$. Thus,

\hat\mathbf{b} = \frac{\mathbf{b}}{|\mathbf{b}|} ~. $$

Scalar product of two vectors
The scalar product or inner product or dot product of two vectors is defined as

\mathbf{a}\cdot\mathbf{b} = |\mathbf{a}||\mathbf{b}|\cos(\theta) $$ where $$\theta\,$$ is the angle between the two vectors (see Figure 2(b)).

If $$\mathbf{a}\,$$ and $$\mathbf{b}\,$$ are perpendicular to each other, $$\theta = \pi/2\,$$ and $$\cos(\theta) = 0\,$$. Therefore, $${\mathbf{a}}\cdot{\mathbf{b}} = 0$$.

The dot product therefore has the geometric interpretation as the length of the projection of $$\mathbf{a}\,$$ onto the unit vector $$\hat\mathbf{b}\,$$ when the two vectors are placed so that they start from the same point (tail-to-tail).

The scalar product leads to a scalar quantity and can also be written in component form (with respect to a given basis) as

{\mathbf{a}}\cdot{\mathbf{b}} = a_1 b_1 + a_2 b_2 + a_3 b_3 = \sum_{i=1..3} a_i b_i~. $$

If the vector is $$n$$ dimensional, the dot product is written as

{\mathbf{a}}\cdot{\mathbf{b}} = \sum_{i=1..n} a_i b_i~. $$

Using the Einstein summation convention, we can also write the scalar product as

{\mathbf{a}}\cdot{\mathbf{b}} = a_i b_i~. $$

Also notice that the following also hold for the scalar product
 * 1) $${\mathbf{a}}\cdot{\mathbf{b}} = {\mathbf{b}}\cdot{\mathbf{a}}$$ (commutative law).
 * 2) $${\mathbf{a}}\cdot{(\mathbf{b}+\mathbf{c})} = {\mathbf{a}}\cdot{\mathbf{b}} + {\mathbf{a}}\cdot{\mathbf{c}}$$ (distributive law).

Vector product of two vectors
The vector product (or cross product) of two vectors $$\mathbf{a}\,$$ and $$\mathbf{b}\,$$ is another vector $$\mathbf{c}\,$$ defined as

\mathbf{c} = {\mathbf{a}}\times{\mathbf{b}} = |\mathbf{a}||\mathbf{b}|\sin(\theta) \hat{\mathbf{c}} $$ where $$\theta\,$$ is the angle between $$\mathbf{a}\,$$ and $$\mathbf{b}\,$$, and $$\hat{\mathbf{c}}\,$$ is a unit vector perpendicular to the plane containing $$\mathbf{a}\,$$ and $$\mathbf{b}\,$$ in the right-handed sense.

In terms of the orthonormal basis $$(\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3)\,$$, the cross product can be written in the form of a determinant

{\mathbf{a}}\times{\mathbf{b}} = \begin{vmatrix} \mathbf{e}_1 & \mathbf{e}_2 & \mathbf{e}_3 \\ a_1 & a_2   & a_3 \\ b_1 & b_2   & b_3 \end{vmatrix}. $$

In index notation, the cross product can be written as

{\mathbf{a}}\times{\mathbf{b}} \equiv e_{ijk} a_j b_k. $$ where $$e_{ijk}$$ is the Levi-Civita symbol (also called the permutation symbol, alternating tensor).

Identities from Vector Algebra
Some useful vector identities are given below. {\mathbf{b}}\cdot{({\mathbf{a}}\times{\mathbf{b}})} = \mathbf{0}$$
 * 1) $${\mathbf{a}}\times{\mathbf{b}} = - {\mathbf{b}}\times{\mathbf{a}}$$.
 * 2) $${\mathbf{a}}\times{\mathbf{b}+\mathbf{c}} = {\mathbf{a}}\times{\mathbf{b}} + {\mathbf{a}}\times{\mathbf{c}}$$.
 * 3) $${\mathbf{a}}\times{({\mathbf{b}}\times{\mathbf{c}})} = \mathbf{b}({\mathbf{a}}\cdot{\mathbf{c}}) - \mathbf{c}({\mathbf{a}}\cdot{\mathbf{b}})$$
 * 4) $${({\mathbf{a}}\times{\mathbf{b}})}\times{\mathbf{c}} = \mathbf{b}({\mathbf{a}}\cdot{\mathbf{c}}) - \mathbf{a}({\mathbf{b}}\cdot{\mathbf{c}})$$
 * 5) $${\mathbf{a}}\times{\mathbf{a}} = \mathbf{0}$$
 * 6) $${\mathbf{a}}\cdot{({\mathbf{a}}\times{\mathbf{b}})} =
 * 1) $${({\mathbf{a}}\times{\mathbf{b}})}\cdot{\mathbf{c}} = {\mathbf{a}}\cdot{({\mathbf{b}}\times{\mathbf{c}})}$$

For more details on the topics of this chapter, see Vectors in the wikibook on Calculus.