On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Algebra Fundamentals · Grade 9-12

Dot Product

The dot product takes two vectors and returns a single number measuring how much they point the same way.

a⋅b=a1b1+a2b2+⋯+anbn=∥a∥∥b∥cos⁡θ

Quick Answer

The dot product takes two vectors and returns a single number measuring how much they point the same way. Use it to find the angle between two vectors, to test whether they are perpendicular (the dot product is 0), or to measure how much of one vector points along another, such as the part of a force that actually moves an object. Multiply matching components and add: ⟨1,2⟩⋅⟨3,−1⟩=3−2=1. A positive result means an angle under 90∘, zero means a right angle, and negative means more than 90∘.

Why This Matters

The dot product turns a question about angles into arithmetic on components, so you can check whether two walls, roads or forces meet at right angles without a protractor. In physics, work is the dot product of force and displacement: only the part of a push along the motion counts. Without it, finding the angle between ⟨2,5⟩ and ⟨4,1⟩ would take a careful scale drawing.

Intuitive Explanation

Multiply matching components and add the results. For a=⟨4,1⟩ and b=⟨2,3⟩, a⋅b=4⋅2+1⋅3=11. Two vectors go in and one number comes out. That number measures how far the vectors agree in direction, scaled by their lengths: a⋅b=∥a∥∥b∥cos⁡θ, where θ is the angle between them.

The cosine explains the sign. Vectors pointing the same way have cos⁡0∘=1, so the dot product is as large as it can be: ⟨3,0⟩⋅⟨5,0⟩=15=3⋅5. At a right angle cos⁡90∘=0, and ⟨3,0⟩⋅⟨0,5⟩=0. Pointing opposite ways, cos⁡180∘=−1, and ⟨3,0⟩⋅⟨−5,0⟩=−15. A zero dot product is the quickest test for perpendicular vectors.

Solving for the cosine gives the angle. For a=⟨4,1⟩ and b=⟨2,3⟩, ∥a∥=17 and ∥b∥=13, so cos⁡θ=11221≈0.740 and θ≈42.3∘.

The cross product also takes two vectors, but it returns a vector perpendicular to both, and it is largest when the vectors are perpendicular rather than parallel. Scalar multiplication, as in 3⟨4,1⟩=⟨12,3⟩, takes a number and a vector and returns a vector. If your answer to a dot product has angle brackets, something has gone wrong.

Think of it like this. The dot product is a shadow measurement: shine light straight down onto the line of b, measure the shadow that a casts, and multiply by the length of b. A vector at right angles casts no shadow, so the result is 0, and one pointing backwards casts its shadow on the far side, a negative result. Unlike a real shadow, swapping the two roles gives the same answer.

Core idea. The dot product multiplies matching components and adds, giving one number that is positive when vectors point alike, zero when perpendicular, negative when opposed.


When to Use

Use it when you have two vectors and want one number about how they line up: the angle between them, a check for perpendicular, or the part of one vector lying along another, as in a projection or the work done by a force. If you need a new vector perpendicular to two 3D vectors, use the cross product. If you are combining the vectors into a resultant, add them; if you are stretching one vector, use scalar multiplication.

Tip. Ask: Do I have two vectors and need one number measuring their directional agreement (not a new vector)?

How to Recognize It

Before taking a dot product, look at what the answer should be: an angle, a yes or no about right angles, or an amount of one vector along another.

  1. Is the angle between two vectors, or a right-angle check, what you need?

    Yes points to the dot product, since cos⁡θ=a⋅b∥a∥∥b∥. If you want one vector's own heading from the x-axis, use its direction angle instead.

  2. Is only part of a force or motion useful, such as the push along a ramp?

    Then you want the part of one vector along another, which the dot product measures; the work done by a force is the classic case. If every bit of each vector counts toward a total, add the vectors.

  3. Are both vectors in 3D, with a perpendicular direction or an area wanted?

    That calls for the cross product, which returns a vector. The dot product works in any number of dimensions but cannot produce a new direction.

  4. Is a vector multiplied by a plain number rather than by another vector?

    That is scalar multiplication, and the result is a vector. A dot product always needs two vectors with the same number of components.

Dot Product compared with Cross product, Scalar multiplication, and Vector addition

All four rows take two vectors, or a vector and a number, and multiply or combine them. Ask what you expect back: a single number about alignment, a perpendicular vector, a stretched copy of one vector, or the resultant of both.

Dot Product

Meaning
Use this when you need the angle between two vectors, a perpendicularity check, or a projection — and want a single number out.
Key test
Do I have two vectors and need one number measuring their directional agreement (not a new vector)?
Formula
a⋅b=a1b1+a2b2+⋯+anbn=∥a∥∥b∥cos⁡θ
Example
Are a=⟨3,4⟩ and b=⟨4,−3⟩ perpendicular?

Cross product

Meaning
Returns a new vector perpendicular to both, with magnitude equal to the spanned area.
Key test
Use when you need a perpendicular direction or a parallelogram/triangle area in 3D.
Formula
∥a×b∥=∥a∥∥b∥sin⁡θ
Example
Torque or a normal to a plane

Scalar multiplication

Meaning
Scales one vector by a single number, returning a vector.
Key test
Use when stretching or shrinking one vector, not comparing two.
Formula
ca=⟨ca1,ca2⟩
Example
3⟨2,1⟩=⟨6,3⟩

Vector addition

Meaning
Combines two vectors into a resultant vector.
Key test
Use when totaling displacements or forces, not measuring alignment.
Formula
a+b=⟨a1+b1,a2+b2⟩
Example
⟨1,2⟩+⟨3,1⟩=⟨4,3⟩

Formula & Notation

a⋅b=a1b1+a2b2+⋯+anbn=∥a∥∥b∥cos⁡θ
The dot product (inner product) on Rn: a⋅b=∑i=1naibi=∥a∥∥b∥cos⁡θ. Properties: bilinear, symmetric (a⋅b=b⋅a), positive-definite (a⋅a>0 for a≠0). Orthogonality: a⊥b  ⟺  a⋅b=0.

How to read it: a⋅b uses a raised dot. Do not confuse with a×b (cross product).

Worked Examples

Example 1 — Test for perpendicular

Easy

Are a=⟨3,4⟩ and b=⟨4,−3⟩ perpendicular?
Show the steps and the answer
  1. Multiply the x-components: 3⋅4=12.

    The dot product pairs like with like, starting with x and x.

  2. Multiply the y-components: 4⋅(−3)=−12.

    The second pair is y with y.

  3. Add: 12+(−12)=0.

    Since a⋅b=∥a∥∥b∥cos⁡θ and neither vector has length 0, a zero result forces cos⁡θ=0, so θ=90∘.

  4. Sketch to confirm: ⟨3,4⟩ points up and right, and ⟨4,−3⟩ is the same arrow turned 90∘ clockwise.

    In 2D, swapping the components and negating one of them always gives a perpendicular vector.

Answer: Yes — the dot product is 0, so they are perpendicular

Takeaway: A zero dot product between two nonzero vectors means they are perpendicular.

Example 2 — Wanting a perpendicular vector

Standard

Given a=⟨3,4,0⟩ and b=⟨4,−3,0⟩, find a vector perpendicular to both.
Show the steps and the answer
  1. Read the request: a vector perpendicular to both, not a number about their angle.

    A dot product returns one number, so it cannot answer a request for a vector.

  2. Set up the cross product: ⟨a2b3−a3b2, a3b1−a1b3, a1b2−a2b1⟩=⟨4⋅0−0⋅(−3), 0⋅4−3⋅0, 3(−3)−4⋅4⟩.

    The cross product is built to be perpendicular to both of its inputs.

  3. Simplify: ⟨0,0,−9−16⟩=⟨0,0,−25⟩.

    Both inputs lie flat in the xy-plane, so the perpendicular runs along the z-axis.

  4. Check with dot products: ⟨3,4,0⟩⋅⟨0,0,−25⟩=0 and ⟨4,−3,0⟩⋅⟨0,0,−25⟩=0.

    Testing perpendicularity is the job the dot product does well.

Answer: a×b=⟨0,0,−25⟩

Takeaway: Ask whether the answer should be a number or a vector: a number about alignment is a dot product; a perpendicular vector is a cross product.

Example 3 — Find the mistake: pair like with like

Application

Find the angle between a=⟨1,2⟩ and b=⟨3,1⟩. Noor writes: "a⋅b=1⋅1+2⋅3=7." Find the mistake and correct it.
Show the steps and the answer
  1. Look at Noor's pairs: she multiplied a1 by b2 and a2 by b1.

    The dot product pairs matching components, x with x and y with y.

  2. Recompute: a⋅b=1⋅3+2⋅1=5.

    The matching pairs are (1,3) and (2,1).

  3. Find the lengths: ∥a∥=1+4=5 and ∥b∥=9+1=10.

    The angle formula divides by both magnitudes.

  4. Solve: cos⁡θ=5510=550=12, so θ=45∘.

    Noor's 7 would give cos⁡θ≈0.99, an angle of about 8∘, far too small.

  5. Confirm with direction angles: a is at tan⁡−12≈63.4∘ and b at tan⁡−113≈18.4∘, which differ by 45∘.

    Measuring each vector from the x-axis gives the same angle between them.

Answer: a⋅b=5 and the angle is 45∘.

Takeaway: Pair x with x and y with y; crosswise products belong to the cross product and determinants.

Where You'll See It

  • Work done pulling a wagon

    Pulling a wagon with force ⟨30,40⟩ N while it rolls ⟨10,0⟩ m along flat ground does work F⋅d=30⋅10+40⋅0=300 joules. The 40 N upward part of the pull lifts the handle but does nothing to move the wagon forward.

  • Checking a square corner

    A builder marks a corner at (0,0) with walls running toward (6,8) and (−4,3), in metres. The dot product 6(−4)+8⋅3=−24+24=0 shows the walls meet at exactly 90∘, with no protractor needed.

  • How much sun a solar panel catches

    The power a panel collects is proportional to n⋅s, where n is a unit vector straight out of the panel and s a unit vector toward the sun. With the sun 60∘ away from straight on, cos⁡60∘=0.5, so the panel collects half its full power.

Common Mistakes

  1. The slip: Reporting a vector as the answer

    Instead: the dot product is always a single scalar; multiply matching components and add them

  2. The slip: Pairing components crosswise like a1b2

    Instead: pair like-with-like: a1b1+a2b2

  3. The slip: Forgetting that cos⁡θ form needs magnitudes

    Instead: a⋅b=∥a∥∥b∥cos⁡θ, so solve cos⁡θ=a⋅b∥a∥∥b∥ for the angle


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Find ⟨2,3⟩⋅⟨4,−1⟩.

    Hint: Multiply matching components and add.

  2. Find ⟨1,−2,3⟩⋅⟨4,0,−1⟩.

    Hint: There are three pairs of matching components.

  3. Find k so that ⟨k,2⟩ and ⟨3,−6⟩ are perpendicular.

    Hint: Perpendicular vectors have a dot product of 0.

  4. Find the angle between ⟨1,0⟩ and ⟨1,1⟩ using the dot product.

    Hint: Use cos⁡θ=a⋅b∥a∥∥b∥.

  5. A force ⟨30,40⟩ N moves a box through a displacement ⟨10,0⟩ m. To find the work done, a single number, use the dot product or vector addition?

    Hint: Is the answer a vector or a number?

  6. A student computes ⟨3,5⟩⋅⟨2,1⟩=⟨6,5⟩. Find the mistake.

    Hint: What kind of answer does a dot product give?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Why is the work done by a force a dot product?

Only the part of a force along the motion does work. Pulling a sled with 50 N at 60∘60^\circ above the ground for 10 m does 50⋅10⋅cos⁡60∘=25050\cdot10\cdot\cos60^\circ=250 J of work, half of what a horizontal pull of the same strength would do. The upward part of the pull lifts slightly on the sled but moves it nowhere along the ground. That is exactly F⋅d\mathbf{F}\cdot\mathbf{d}: force and displacement combined by how well they line up.

What is a⋅a?

The square of the length of a\mathbf{a}. Multiplying the matching components of ⟨3,4⟩\langle3,4\rangle with itself gives 9+16=25=529+16=25=5^2. This is why the dot product and the magnitude formula look so alike: ∥a∥=a⋅a\|\mathbf{a}\|=\sqrt{\mathbf{a}\cdot\mathbf{a}}. It also fits the angle formula, since a vector makes an angle of 0∘0^\circ with itself and cos⁡0∘=1\cos0^\circ=1.

Is the dot product used outside math and physics?

Yes, in recommendation systems. Many apps describe each film, song or document as a long list of numbers, a vector of its features. The dot product of two such vectors divided by their lengths gives the cosine of the angle between them, called cosine similarity. A value near 1 means the items point the same way and are alike; near 0 means they are unrelated.

How do I find the projection of one vector onto another?

The scalar projection of a\mathbf{a} onto b\mathbf{b}, the signed length of its shadow, is a⋅b∥b∥\frac{\mathbf{a}\cdot\mathbf{b}}{\|\mathbf{b}\|}. To get the shadow as a vector, multiply that length by the unit vector of b\mathbf{b}: a⋅b∥b∥2b\frac{\mathbf{a}\cdot\mathbf{b}}{\|\mathbf{b}\|^2}\mathbf{b}. For a=⟨2,3⟩\mathbf{a}=\langle2,3\rangle onto b=⟨4,0⟩\mathbf{b}=\langle4,0\rangle this gives 816⟨4,0⟩=⟨2,0⟩\frac{8}{16}\langle4,0\rangle=\langle2,0\rangle, which is just the horizontal part of a\mathbf{a}.

Learning Path

You need Vector Addition, Subtraction, and Scalar Multiplication (working in components) and Vector Magnitude and Direction (lengths and angles) first. This concept adds a way to multiply two vectors into one number that measures how they line up. Next, the Cross Product multiplies two 3D vectors into a new vector, and projections built from the dot product split a force or velocity into the parts along and across a direction.

See Also