Math Lab
Home/Class XII/Ch 10/Scalar (dot) product

Scalar (dot) product

The scalar product (or dot product) of two vectors is a single number that captures how much they align. It is the simplest of the vector products , and arguably the most useful, because it gives you the angle between two vectors and the component of one along another.

Definition

ab=abcosθ,\vec{a} \cdot \vec{b} = |\vec{a}|\,|\vec{b}|\,\cos\theta, where θ[0,π]\theta \in [0, \pi] is the angle between a\vec{a} and b\vec{b} (when both are placed with the same tail).

Componentwise formula (in any orthonormal basis i^,j^,k^\hat{i}, \hat{j}, \hat{k}): ab=a1b1+a2b2+a3b3.\vec{a} \cdot \vec{b} = a_1 b_1 + a_2 b_2 + a_3 b_3.

Why two formulas agree

The componentwise formula is defined this way. To show it equals abcosθ|\vec a||\vec b|\cos\theta, use the law of cosines on the triangle formed by a,b,ab\vec{a}, \vec{b}, \vec{a} - \vec{b}: ab2=a2+b22abcosθ.|\vec{a} - \vec{b}|^2 = |\vec{a}|^2 + |\vec{b}|^2 - 2|\vec{a}||\vec{b}|\cos\theta. Expand the left side componentwise: ab2=(a1b1)2+=a2+b22(a1b1+a2b2+a3b3)|\vec{a} - \vec{b}|^2 = (a_1 - b_1)^2 + \cdots = |\vec{a}|^2 + |\vec{b}|^2 - 2(a_1 b_1 + a_2 b_2 + a_3 b_3). Match coefficients: a1b1+a2b2+a3b3=abcosθa_1 b_1 + a_2 b_2 + a_3 b_3 = |\vec{a}||\vec{b}|\cos\theta.

Key consequences

Perpendicularity test: ab=0    ab\vec{a} \cdot \vec{b} = 0 \iff \vec{a} \perp \vec{b} (for non-zero vectors). The reverse is trivial; the forward is from cos90=0\cos 90^\circ = 0.

Magnitude formula: aa=a2\vec{a} \cdot \vec{a} = |\vec{a}|^2.

Angle formula: cosθ=abab\cos\theta = \dfrac{\vec{a}\cdot\vec{b}}{|\vec{a}||\vec{b}|}.

Projection of a\vec{a} on b\vec{b}: the (signed) length is abb\dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|}; the vector projection is abb2b\dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|^2}\vec{b}.

Component of a\vec{a} along the direction u^\hat{u} (unit vector): au^\vec{a}\cdot\hat{u}.

Cauchy-Schwarz: abab|\vec{a}\cdot\vec{b}| \le |\vec{a}|\,|\vec{b}|, with equality iff a\vec{a} and b\vec{b} are parallel.

Properties

  • Commutative: ab=ba\vec{a}\cdot\vec{b} = \vec{b}\cdot\vec{a}.
  • Distributive: a(b+c)=ab+ac\vec{a}\cdot(\vec{b} + \vec{c}) = \vec{a}\cdot\vec{b} + \vec{a}\cdot\vec{c}.
  • Scalar factors come out: (λa)b=λ(ab)(\lambda\vec{a})\cdot\vec{b} = \lambda(\vec{a}\cdot\vec{b}).
  • Dot products of basis vectors: i^i^=j^j^=k^k^=1\hat{i}\cdot\hat{i} = \hat{j}\cdot\hat{j} = \hat{k}\cdot\hat{k} = 1; cross-pairs =0= 0.

Worked examples

Example 1. a=2i^+3j^k^\vec{a} = 2\hat{i} + 3\hat{j} - \hat{k}, b=i^+4j^+2k^\vec{b} = -\hat{i} + 4\hat{j} + 2\hat{k}. Find ab\vec{a}\cdot\vec{b}.

ab=(2)(1)+(3)(4)+(1)(2)=2+122=8\vec{a}\cdot\vec{b} = (2)(-1) + (3)(4) + (-1)(2) = -2 + 12 - 2 = 8.

Example 2. Find the angle between a=i^+j^\vec{a} = \hat{i} + \hat{j} and b=i^j^\vec{b} = \hat{i} - \hat{j}.

ab=11=0\vec{a}\cdot\vec{b} = 1 - 1 = 0. So θ=π/2\theta = \pi/2 (perpendicular).

Example 3. a=3i^4j^+0k^\vec{a} = 3\hat{i} - 4\hat{j} + 0\hat{k} and b=2j^+k^\vec{b} = -2\hat{j} + \hat{k}. Find the angle.

a=5|\vec{a}| = 5, b=5|\vec{b}| = \sqrt{5}. ab=00+(4)(2)+01=8\vec{a}\cdot\vec{b} = 0 \cdot 0 + (-4)(-2) + 0 \cdot 1 = 8. So cosθ=855=855\cos\theta = \dfrac{8}{5\sqrt 5} = \dfrac{8}{5\sqrt 5}. (Approximately 0.71550.7155, θ44.4\theta \approx 44.4^\circ.)

Example 4. Find the projection of a=2i^+3j^+2k^\vec{a} = 2\hat{i} + 3\hat{j} + 2\hat{k} on b=i^+2j^+k^\vec{b} = \hat{i} + 2\hat{j} + \hat{k}.

ab=2+6+2=10\vec{a}\cdot\vec{b} = 2 + 6 + 2 = 10. b=1+4+1=6|\vec{b}| = \sqrt{1 + 4 + 1} = \sqrt{6}. Projection length: 106\dfrac{10}{\sqrt 6}.

Example 5. Find λ\lambda so that a=2i^+λj^+k^\vec{a} = 2\hat{i} + \lambda\hat{j} + \hat{k} is perpendicular to b=i^+2j^+3k^\vec{b} = \hat{i} + 2\hat{j} + 3\hat{k}.

ab=2+2λ+3=0\vec{a}\cdot\vec{b} = 2 + 2\lambda + 3 = 0, so λ=5/2\lambda = -5/2.

Example 6. Show that a+b\vec{a} + \vec{b} and ab\vec{a} - \vec{b} are perpendicular iff a=b|\vec{a}| = |\vec{b}|.

(a+b)(ab)=aaab+babb=a2b2(\vec{a} + \vec{b})\cdot(\vec{a} - \vec{b}) = \vec{a}\cdot\vec{a} - \vec{a}\cdot\vec{b} + \vec{b}\cdot\vec{a} - \vec{b}\cdot\vec{b} = |\vec{a}|^2 - |\vec{b}|^2. This is zero iff a=b|\vec{a}| = |\vec{b}|. (Geometrically: the diagonals of a rhombus are perpendicular.)

Try it yourself

  1. a=i^j^\vec{a} = \hat{i} - \hat{j}, b=i^+j^\vec{b} = \hat{i} + \hat{j}. Find ab\vec{a}\cdot\vec{b}.
  2. Find the angle between a=2i^+2j^+k^\vec{a} = 2\hat{i} + 2\hat{j} + \hat{k} and b=i^j^+k^\vec{b} = \hat{i} - \hat{j} + \hat{k}.
  3. If ab=0\vec{a}\cdot\vec{b} = 0 and neither vector is zero, what is the angle between them?
  4. Find λ\lambda if i^+j^k^\hat{i} + \hat{j} - \hat{k} is perpendicular to 2i^+λj^+k^2\hat{i} + \lambda\hat{j} + \hat{k}.
  5. Find the projection of a=7i^+j^4k^\vec{a} = 7\hat{i} + \hat{j} - 4\hat{k} on b=2i^+6j^+3k^\vec{b} = 2\hat{i} + 6\hat{j} + 3\hat{k}.
  6. If a=3|\vec{a}| = 3, b=4|\vec{b}| = 4, and the angle between them is 6060^\circ, find ab\vec{a}\cdot\vec{b}.
  7. If a+b2=a2+b2|\vec{a} + \vec{b}|^2 = |\vec{a}|^2 + |\vec{b}|^2, what is the angle between a\vec{a} and b\vec{b}?
  8. Show that the diagonals of a square are perpendicular.
  9. Show that for any vectors a,b,c\vec{a}, \vec{b}, \vec{c}: a(b+c)=ab+ac\vec{a}\cdot(\vec{b}+\vec{c}) = \vec{a}\cdot\vec{b} + \vec{a}\cdot\vec{c}.
  10. Find ab|\vec{a} - \vec{b}| if a=5|\vec{a}| = 5, b=6|\vec{b}| = 6, angle between them θ\theta with cosθ=1/3\cos\theta = 1/3.
  11. Find a unit vector perpendicular to both i^+j^\hat{i} + \hat{j} and j^+k^\hat{j} + \hat{k}. (Try: a vector r=ai^+bj^+ck^\vec{r} = a\hat{i} + b\hat{j} + c\hat{k} with r\vec{r}\cdot each =0= 0.)
  12. Show (ab)2a2b2(\vec{a} \cdot \vec{b})^2 \le |\vec{a}|^2 |\vec{b}|^2 (Cauchy-Schwarz).
  13. The work done by a force F=3i^j^+2k^\vec{F} = 3\hat{i} - \hat{j} + 2\hat{k} moving a particle by d=i^+2j^3k^\vec{d} = \hat{i} + 2\hat{j} - 3\hat{k}.
  14. The cosine of the angle between the diagonals of the cube 0x,y,z10 \le x, y, z \le 1.

Pitfalls and tricks

  • Dot product is a scalar. Don't write ab\vec{a}\cdot\vec{b} as a vector.
  • Use the angle formula in geometric problems where the angle matters.
  • Use the componentwise formula when you have coordinates , it's the fastest path.
  • Projection has a sign. Negative projection means a\vec{a} points opposite to b\vec{b}.
  • Test perpendicularity via ab=0\vec{a}\cdot\vec{b} = 0 , far cleaner than computing angles.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Scalar product
6 questions · pick the best answer
Q1

(i^+j^)(i^j^)(\hat i + \hat j) \cdot (\hat i - \hat j)

Q2

Angle between i^\hat i and i^+j^\hat i + \hat j

Q3

aa\vec a \cdot \vec a equals

Q4

Projection length of a\vec a on b\vec b is

Q5

If ab=0\vec a \cdot \vec b = 0 and both nonzero, then

Q6

Cauchy-Schwarz: ab|\vec a \cdot \vec b|