Calculating a scalar product: formulas and properties
The three scalar product formulas
Why are there several formulas?
The dot product of two vectors u and v, denoted u·v, is a number (a scalar, not a vector). Depending on the data you have (coordinates, magnitudes and angle, or just magnitudes), you choose the quickest formula.
Formula using the angle
u·v = ||u|| × ||v|| × cos(angle(u,v))
This is THE formula to use when you know the magnitudes of the vectors and the angle between them. The sign of the result depends on the cosine: if the angle is acute, u·v > 0; if it is obtuse, u·v < 0; if it is 90 degrees, u·v = 0.
Formula using coordinates
In an orthonormal coordinate system, if u(x; y) and v(x’; y’), then:
u·v = xx’ + yy’
Example: u(3; -2) and v(4; 5). Then u·v = 3·4 + (-2)·5 = 12 - 10 = 2.
Formula using norm (polarisation identity)
u·v = 1/2 × (||u+v||² − ||u||² − ||v||²)
Very useful in geometry when only the lengths of line segments are known; for example, AB.AC = 1/2 × (AB² + AC² - BC²).
Summary table
| Situation | Formula to use |
|---|---|
| Norms and angle known | u·v = |
| Coordinates known | u·v = xx' + yy' |
| Segment lengths known | u.v = 1/2 (AB² + AC² - BC²) |
Common pitfall
Do not confuse ||u+v||² with ||u||² + ||v||²: the term 2 × u.v is missing! In fact, we have ||u+v||² = ||u||² + 2 × u.v + ||v||², and this is where the polarisation identity comes from.

