# Dot Product of Vectors

The dot product of two vectors $\vec{a}$ and $\vec{b}$ is

$\vec{a} \cdot \vec{b} = \lVert \vec{a} \rVert \times \lVert \vec{b} \rVert \cos \theta,$

where $\theta$ is the angle between the vectors $\vec{a}$ and $\vec{b}$.

Algebraically, the dot product of two vectors $\vec{a} = [ a_1 , a_2, \ldots, a_n ]$ and $\vec{b} = [b_1, b_2, \ldots, b_n ]$ is given by

$\vec{a} \cdot \vec{b} = \sum a_i b_i.$

The equivalence of these two forms can be shown through the cosine rule.

### The dot product satisfies the following properties:

1. If $\vec{a} \cdot \vec{b} = 0$, then $\theta = 90^\circ$, implying $\vec{a}$ and $\vec{b}$ are orthogonal.

2. $\vec{a} \cdot \vec{a} = \lVert \vec{a} \rVert ^2$.

3. Given vectors $\vec{a}$ and $\vec{b}$, the projection of $\vec{a}$ onto $\vec{b}$ is given by \vec{a}_\vec{b} = \frac { \vec{a} \cdot \vec{b} } { \lVert \vec{b} \rVert} . This formula is useful for finding the (perpendicular) distance of a point to a line (or hyperplane).

## Worked Examples

### 1. Derive the law of cosines.

Solution: In triangle $OAB$, let $\vec{OA} = \vec{a}$, $\vec{OB} = \vec{b}$ and $\vec{BA} = \vec{c} = \vec{a} - \vec{b}$. Then, we have

\begin{aligned} \lVert\vec{c} \rVert^2 & = \vec{c} \cdot \vec{c} = ( \vec{a} - \vec{b} )( \vec{a} - \vec{b}) = \vec{a} \cdot \vec{a} - 2 \vec{a} \cdot \vec{b} + \vec{b} \cdot \vec{b} \\ & = \lVert \vec{a} \rVert^2 - 2 \lVert \vec{a} \rVert \lVert \vec{b} \rVert \cos \theta + \lVert \vec{b} \rVert^2. \end{aligned}

### 2. Consider four points in space $A, B, C, D$. Show

$\lvert AB \rvert^2 + \lvert CD \rvert^2 - \lvert BC \rvert^2 - \lvert AD \rvert^2 = 2 \vec{AC} \cdot \vec{DB} .$

Solution: We have

\begin{aligned} \quad \lvert AB \rvert^2 + \lvert CD \rvert^2 - \lvert BC \rvert^2 - \lvert AD \rvert^2 & = ( \vec{b}- \vec{a})^2 + ( \vec{d}- \vec{c})^2 - ( \vec{c}- \vec{b})^2 - ( \vec{d}- \vec{a})^2 \\ & = 2 ( -\vec{b} \cdot \vec{a} - \vec{d} \cdot \vec{c} + \vec{c} \cdot \vec{b} + \vec{d} \cdot \vec{a})\\ & = 2 ( \vec{b} - \vec{d}) \cdot (\vec{c} - \vec{a})\\ & = 2 \vec{ AC} \cdot \vec {DB}. \\ \end{aligned}

### 3. In a circle $\Gamma$ with center $O$ and radius $r$, we have inscribed a regular $n-$gon $A_1 A_2 \ldots A_n$. If $P$ is any point on the circumference, show that $\sum | A_i P |^2 = 2nr^2$.

Solution: Let $O$ be the origin. Then $\vec{A_1} + \ldots + \vec{A_n} = 0$. Hence,

\begin{aligned} \sum \lvert A_i P \rvert^2 & = \sum (\vec{P} - \vec{A_i}) \cdot (\vec{P} - \vec{A_i}) \\ & = \sum \left(\vec{P} \cdot \vec{P} + \vec{A} \cdot \vec{A} - 2 \vec{P} \cdot \vec{A_i}\right)\\ & = nr^2 + nr^2 - 2 \vec{P} \cdot \left( \sum \vec{A_i} \right) \\ & = 2nr^2. \\ \end{aligned} Note by Arron Kau
5 years, 7 months ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.
2 \times 3 $2 \times 3$
2^{34} $2^{34}$
a_{i-1} $a_{i-1}$
\frac{2}{3} $\frac{2}{3}$
\sqrt{2} $\sqrt{2}$
\sum_{i=1}^3 $\sum_{i=1}^3$
\sin \theta $\sin \theta$
\boxed{123} $\boxed{123}$

Sort by:

I don't get that last one, #3: Why is Sum of A vectors up to An zero? Also, what is the meaning of A1A2...An, the product of all -gons before the n gon and including?

Thanks,

- 5 years, 4 months ago

the sum of A VECTORS adds up to zero as it results into a closed structure and hence the addition resulting in a zero resultant vector.

- 5 years ago

good

- 4 years, 5 months ago

Nice proof for the last question

- 4 years, 7 months ago