This formula
cos(x)=a⋅b||a||||b||. Just to clarify, The ⋅ between the a and b is not a multiplication sign, it is a dot product.
This formula is very useful for calculating the angle between 2 vectors.
To prove: draw a vector, connecting vector →a and →b, remembering vector subtraction, this vector is →a−b.
We see a cosine, so we hope to use the law of cosines to help us relate side lengths. However, we don't know the side lengths of these vectors. However, we have a very important symbol called the norm, || ||, and this the distance to the endpoint to the origin. Remember, vectors aren't defined with position, so norm gives an effective way to represent length. Here is a graph:

Set θ=∠AOB
Therefore by the law of cosines, we have:
cos(θ)=||a||2+||b||2−||a−b||22||a||||b||.
To relate norm to dot product, we have another very important formula:
v⋅v=||v||2. (dot product again). PS, notice the resemblance to the formula z∗¯z=|z|2, for complex number z.
Using this formula,
cos(θ)=a⋅a+b⋅b−(a−b)⋅(a−b)2||a||||b||.
Dot products have a special property, because they are commutative, and distributive.
Therefore, cos(θ)=a⋅a+b⋅b−(a⋅a−2a⋅b+b⋅b)2||a||||b||
Simplifying:
cos(θ)=2a⋅b2||a||||b||=a⋅b||a||||b||.
This gives our desired formula.