Angle Between Vectors: A Tricky Problem

A new question of the week

We haven’t done much with vectors here, though there have been many problems of that sort lately. Let’s look at a recent question that touches on the basics, yet is by no means a simple problem.

The problem

This came from Stefan in March:

Determine the angle between vectors a and b if

  • (a + b) is perpendicular to (7a – 5b), and
  • (a – 4b) is perpendicular to (7a – 2b).

I don’t really know how to start.

I know that cos θ = (a*b)/(|a|*|b|) but I’m not sure how to use it here.

Stefan knows the key formula to be used to find the angle between vectors, using their dot product, and just needs some help getting to the point of using it. If you are not familiar with the dot product, I plan to have a post on that soon!

Writing equations

I answered,

I’d start by observing that the two pairs of perpendicular vectors imply that

(a + b) • (7a – 5b) = 0 and

(a – 4b) • (7a – 2b) = 0

Expand each equation, and see what you can determine about ab.

If I did my work correctly, you will find that the answer is numerically unpleasant, but the work is conceptually straightforward.

If you need more help, be sure to show your work as far as you get, so I can check it and make any appropriate suggestions for a next step or a correction.

In my answer I demonstrated a better way to represent vectors and their operations in typing; with two different multiplication operations on vectors, the symbol “*” can be ambiguous, but since our site (though not the best in handling math) provides a way to insert special symbols, it is not too hard to use the dot for the dot product. To represent vectors, we can use either the arrow, \(\vec{a}\), or bold,\(\mathbf{a}\). The latter is easier to just type, so I’ll be using that.

The key idea is to see that the dot product is useful not only to find an angle, but also to express the fact of perpendicularity. Since \(\mathbf{a}\cdot \mathbf{b} = |\mathbf{a}||\mathbf{b}|\cos\theta\), when a and b are perpendicular, \(\mathbf{a}\cdot \mathbf{b} = 0\).

But I’d carried out the work (which I don’t always do initially), and found the answer to be an ugly radical expression; I wanted to mention that as an encouragement, as it might lead to unnecessary doubt.

Stefan replied,

Hi, Doctor Peterson. Thank you for responding so fast.

So this is what I did:

(a + b)*(7a – 5b) = 7a2 – 5ab + 7ab – 5b2 = 0
(a – 4b)*(7a – 2b) = 7a2 – 2ab – 28ab + 8b2 = 0 →

7a2 – 2ab – 28ab + 8b2 = 7a2 – 5ab + 7ab – 5b2 →

-32ab = -13b2 → a/b = 13/32

Now if I can assume that this represents cos(13/32) then I get the angle 66°.

So if it’s right then great, but is it?

He presumably meant to say, \(\cos(\theta) = 13/32\), which if correct would indeed imply that \(\theta = \cos^{-1}(13/32) = 66.03°\).

Careful! They’re vectors!

But the work, while partly correct, suggests that he is not paying enough attention to the fact that a and b are vectors. This is a natural mistake when one is first learning about vectors, as the notation looks mostly like ordinary algebra with numbers (scalars). I replied,

The trouble is that you are not clearly distinguishing between vectors and scalars, so some of what you did makes no sense. (You can’t divide vectors.) Also, there is no reason to imagine that your “a/b”, even if it meant something, would be the cosine of the angle between them, is there?

What you really have is this, where I have put vectors in bold, indicated the dot product explicitly (which is necessary), and made the magnitude of a vector explicit as |a|, using the fact that aa = |a|2:

(a + b)•(7a – 5b) = 7|a|2 – 5ab + 7ab – 5|b|2 = 0

(a – 4b)•(7a – 2b) = 7|a|2 – 2ab – 28ab + 8|b|2 = 0

I would not rush to set these equal to one another, which loses the important information that not only are they equal, but they are both zero. I would first simplify each equation. Note that you can then solve each of them for ab in terms of |a| and |b|, if you find that useful. Or (big hint) you could eliminate ab between them.

As I mentioned, you can’t say that a/b = 13/32, because a and b are vectors, and there is no division operation on vectors; the step before you wrote that is really -32ab = -13|b|2, and you can’t divide by b.

But what you did up to that point will be useful, because your goal is to find ab/(|a||b|), which is rather close to what you have. If you can only find how |a| and |b| are related …

The equation he got can be used to express \(\mathbf{a}\cdot \mathbf{b}\) (and therefore the angle) in terms of the magnitudes of a and b, but we need more to get an actual value.

Stefan replied, taking my hint by solving the first equation for \(\mathbf{a}\cdot \mathbf{b}\) and putting it into the second:

So I guess to find the relationship I would have to do this:

7|a|2 + 2ab – 5|b|2 = 0

ab = (5|b|2 – 7|a|2)/2

now insert that into

7|a|2 – 2ab – 28ab + 8|b|2 = 0

and get

112|a|2 – 67|b|2 = 0 →

112|a|2 = 67|b|2

|a|2 = (67/112)|b|2

|a|/√(67/112) = |b|

Then

-32ab = -13|b|2

(ab)/|b|2 = (13/32) →

(ab)/(|b|*|b|) = (13/32) →

(ab)/(|b|*|a|/√(62/112)) = 13/32

(ab)/(|b|*|a|) = (13/32)*√(62/112) = cosθ

This is the only thing i can think of, sorry, my monkey brain is slow when it comes to math.

Cleaning up the details

I answered,

I think you’ve got a pretty good “monkey brain”! You thought of almost exactly the right thing!

You just made two little slips: You miscopied 67 as 62, and messed up the final step.

Fix that, then get a decimal value for the cosine, take the inverse cosine, and you’ll have the answer!

Now, I took a slightly different path that led to a slightly more complicated expression, (91/134)√(67/112), which turns out to be equivalent to yours (after correction). Your method is a little nicer than mine, and we both missed some simplification of the fractions, which would have made the similarity more obvious.

He wrote back,

So it’s almost right, besides the miscopied numbers.

I’m not sure what you meant by messing up the final step?

I know that cosθ doesn’t equal to the angle but arccos (or cos-1, I’m not sure if there is a difference?) but I just wrote it that way.

I answered, explaining the subtle error in the last step, and finishing:

When you solved

(ab)/(|b|*|a|/√(67/112)) = (13/32)

for (ab)/(|b|*|a|), you should have multiplied both sides by (1/√(67/112)), that is, by √(112/67), to get

(ab)/(|b|*|a|) = (13/32)*√(112/67).

You didn’t flip the radical over. This simplifies (though this is not needed) to

cos(θ) = (13/8)*√(7/67) = 0.525249,

so θ = 58.315°.

(You are correct that arccos and cos-1 are two ways to say what we are doing here.)

I have attached a picture of a pair of vectors a and b that satisfy this, with the correct angle and ratio of magnitudes. This is how I verified that my answer was correct!

(By the way, the answer I originally got was (91/134)√(67/112), which looked very different from yours; that’s why I had to simplify both to make sure they agreed.)

The desired vectors a and b are in green, and the two pairs of perpendicular resultants are in red and blue, respectively. Once I arbitrarily created vector a, vector b was determined by the angle \(\cos^{-1}\left(\frac{13}{8}\sqrt\frac{7}{67}\right)\) (which could have been in either direction) and the magnitude, \(4\sqrt\frac{7}{67}\) times that of a.

He responded,

Ah, I see, that was a stupid mistake…

Thanks for helping me with this, I appreciate it greatly!

I closed with,

We all do that!

That’s why I teach my students that checking your work, as well as your answer, is half the work. (And I manage to demonstrate that at least once a lesson, by making mistakes for them to catch!)

And thanks for asking the question, which was an interesting challenge.

Postscript: A similar older problem

While preparing for an upcoming series on vectors, I ran across this 2006 problem, which is quite similar in some respects:

Finding the Angle between Two Vectors

There's two vectors A and B, which both have equal magnitudes.  In order for the magnitude of A+B to be 120 times larger than the magnitude of A-B, what must the angle between them be?

Writing equations

Doctor Luis answered:

Hi Victor,

Using vector norm notation, the problem informs us that A and B are two vectors such that 

    |A| = |B|

Further, they want us to determine the angle T (between A and B) such that

  |A+B| = 120 * |A-B|

Ok.  Now that we have expressed the requirements in concise mathematical notation, let's solve the problem.

As above, we can use the dot product to relate the various magnitudes:

The easiest way to find T is probably to use the dot product between A and B (denoted A.B).  I'm sure you'll recognize the identity

  A.B = |A| * |B| * cos(T)

Solving for cos(T) we get

  cos(T) = A.B/(|A| * |B|)

if we use |A|=|B|, then

  cos(T) = (A.B)/|A|^2

Solving the equations

And, as above, we can distribute the dot products to make usable equations:

Now, it is clear that the problem will be easier if we find the value (A.B) in terms of |A|^2. We can do that from the following relationship between the dot product and vector norm:

  v.v = |v|^2

(which is actually an instance of the identity above, applied to the same vector v, so that T=0, or cos(T)=1).

Well the important thing is to realize that we can apply v.v = |v|^2 to |A+B|^2 and to |A-B|^2 (and then applying the distributive rule of the dot product),

  |A + B|^2 = (A + B).(A + B)
            = A.(A+B) + B.(A+B)
            = (A.A + A.B) + (B.A + B.B)
            = |A|^2 + 2(A.B) + |B|^2
            = 2|A|^2 + 2(A.B)           (using |A|=|B|)
Similarly,

  |A - B|^2 = (A - B).(A - B)
            = A.(A-B) - B.(A-B)
            = (A.A - A.B) - (B.A - B.B)
            = |A|^2 - 2(A.B) + |B|^2
            = 2|A|^2 - 2(A.B)            (using |A|=|B|)

This turns the equation we had into something we can actually solve (I’ll correct a small error in the original):

Now, we'll use that second equation that the problem gave us:

    |A+B| = 120 |A-B|

or

  |A+B|^2 = 120^2 * |A-B|^2

  (2|A|^2 + 2(A.B)) = 120^2 * (2|A|^2 - 2(A.B))

You can use this last equation to solve for A.B in terms of |A|^2, which will allow you to find the ratio A.B/|A|^2 = cos(T), from which you can finally determine the value of T.

Let’s finish the work. We have $$2|A|^2 + 2(A\cdot B) = 14,400 (2|A|^2 – 2(A\cdot B))$$ Distributing and rearranging, we get $$2|A|^2 + 2(A\cdot B) = 28,800|A|^2 – 28,800(A\cdot B)$$ and then $$28,802(A\cdot B) = 28,798|A|^2$$ so that $$A\cdot B = \frac{28,798}{28,802}|A|^2 = 0.99986|A|^2$$

Therefore, $$\cos(T) = \frac{A\cdot B}{|A|^2} = 0.99986$$ $$T = \cos^{-1}(0.99986) = 0.9549°$$

As a sanity check, you should notice that the answer is small (at least relative to 180 degrees), which means that A and B are pointing in almost the same direction.  This makes sense, since they'll reinforce each other when added, but almost cancel out when subtracted.  This is how |A+B| can manage to be 120 times larger than |A-B|, even though the two vectors A and B have the same magnitude.

Again, for confirmation, I’ve constructed these vectors in GeoGebra, though it’s hard to see:

The program tells me that the ratio \(\displaystyle\frac{|a+b|}{|a-b|} = 120\). In effect, we have constructed a rhombus such that the ratio of its diagonals is 120:1; looking at it that way, the angle between the sides of the rhombus is \(2\cot^{-1}(120) = 0.9549°\), just as we found by explicitly using vectors.

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.