# Scalar product of two vectors

Do you have to calculate the scalar product of two vectors? Find out how to do it here or use our online calculator to know the result immediately.

You only need to write the vector components  and those of the vector  as well as the angle formed by the two vectors in degrees. Press the calculate button and you will automatically know their scalar product.

## Scalar product formula of two vectors

To calculate the scalar product of two vectors you have to apply the following formula mathematics:

where:

• |u| and |v| are the modulus of each vector (find out here how to calculate the modulus of a vector).
• cosα is the cosine of angle that form the two vectors.

Depending on how that angle α is, the above formula can be simplified in certain cases:

• If the vectors are perpendicular (α = 90º), the scalar product will be zero. This is because the cosine of 90 is equal to 0.
• If the vectors are parallel and have the same sense (α = 0º), the formula reduces to the product of the moduli |u|⋅|v| This is because the cosine of 0 equals 1.
• If the vectors are parallel but have opposite directions (α = 180º), la fórmula será del producto escalar será - |u|⋅|v|. Ese símbolo negativo se debe a que el coseno de 180 es igual a -1.

It should be noted that the scalar product of two vectors will result in a real number. It is also very important that you do not confuse it with the vector product.

## Analytical formula of the scalar product

When calculating the scalar product of two vectors from the analytical point of viewwe obtain as a result a scalar number that is the result of multiplying each of the Cartesian components of the two vectors as we can see in this formula:

## Scalar product of a vector by itself

The above formula will come in handy for a solved exercise in which we are going to calculate the scalar product of a vector by itself.

As you can see, the scalar product of a vector by itself is equal to the square of its modulus. We could also have solved the exercise by applying the general scalar product formula and setting α = 0º.

The scalar product of a vector by itself will always be positive (as long as it is a non-zero vector).

## Scalar product properties

When solving exercises, it will be useful to know the properties of the scalar product:

• Commutative: u ⋅ v = v ⋅ u
• Distributive (vector sum): x ⋅ (u + v) = x ⋅ u + x ⋅ v
• Associative (product by a scalar m): m (u ⋅ v) = (mu) ⋅ v = u ⋅ (mv).

## Solved exercises

Next we are going to see a couple of exercises in which we are going to calculate the scalar product of the following vectors:

The first thing we are going to do is to calculate the modulus of each vector:

Now we apply the general formula and we are left with the following:

If you want to practice with more solved exercises, make up the data of two vectors and use our calculator to check the result. If you have problems with any of them, write us a comment and we will help you.

## Calculate scalar product of two vectors in Excel

As it could not be otherwise, Excel also has a function that allows us to calculate the scalar product of two vectors by means of the analytical formula.

This function is not easily found in the Microsoft program so we are going to explain how to do it. The first thing you have to do is to open a new spreadsheet and use an empty cell to write each component of the vector. We are going to calculate the scalar product of the vectors (-1, 3) and (2, -2) so we have this form:

Now we will use the function SUMAPRODUCT to obtain the scalar product. In our example case, it looks like this:

=SUMAPRODUCT(B2:C2;B3:C3)

Notice that in the range of cells B2:C2 are the components of vector 1 and in the range B3:C3 are the components of vector 2. You will have to adapt these ranges to the cells that you have used you.

Now you simply have to press the ENTER key and Excel will automatically calculate the scalar product of these two vectors for you. using the analytical formula.