Inverse Functions: Arccosine and Dot Products (Part 23)

The Law of Cosines can be applied to find the angle between two vectors {\bf a} and {\bf b}. To begin, we draw the vectors {\bf a} and {\bf b}, as well as the vector {\bf c} (to be determined momentarily) that connects the tips of the vectors {\bf a} and {\bf b}.

dotproduct2Using the usual rules for adding vectors, we see that {\bf a} + {\bf c} = {\bf b}, so that {\bf c} = {\bf b} - {\bf a}

We now apply the Law of Cosines to find \theta:

\parallel \! \! {\bf c} \! \! \parallel^2 = \parallel \! \! {\bf a} \! \! \parallel^2 + \parallel \! \! {\bf b} \! \! \parallel^2 - 2 \parallel \! \! {\bf a} \! \! \parallel \parallel \! \! {\bf b} \! \! \parallel \cos \theta

\parallel \! \! {\bf b} - {\bf a} \! \! \parallel^2 = \parallel \! \! {\bf a} \! \! \parallel^2 + \parallel \! \! {\bf b} \! \! \parallel^2 - 2 \parallel \! \! {\bf a} \! \! \parallel \parallel \! \! {\bf b} \! \! \parallel \cos \theta

We now apply the rule \parallel \! \! {\bf a} \! \! \parallel^2 = {\bf a} \cdot {\bf a}, convert the square of the norms into dot products. We then use the distributive and commutative properties of dot products to simplify.

( {\bf b} - {\bf a} ) \cdot ({\bf b} - {\bf a}) = {\bf a} \cdot {\bf a} + {\bf b} \cdot {\bf b} - 2 \parallel \! \! {\bf a} \! \! \parallel \parallel \! \! {\bf b} \! \! \parallel \cos \theta

{\bf b} \cdot ({\bf b} - {\bf a}) - {\bf a} \cdot ({\bf b} - {\bf a}) = {\bf a} \cdot {\bf a} + {\bf b} \cdot {\bf b} - 2 \parallel \! \! {\bf a} \! \! \parallel \parallel \! \! {\bf b} \! \! \parallel \cos \theta

{\bf b} \cdot ({\bf b} - {\bf a}) -{\bf a} \cdot ({\bf b} - {\bf a}) = {\bf a} \cdot {\bf a} + {\bf b} \cdot {\bf b} - 2 \parallel \! \! {\bf a} \! \! \parallel \parallel \! \! {\bf b} \! \! \parallel \cos \theta

{\bf b} \cdot {\bf b} - {\bf a} \cdot {\bf b} - {\bf a} \cdot {\bf b} + {\bf a} \cdot {\bf a} = {\bf a} \cdot {\bf a} + {\bf b} \cdot {\bf b} - 2 \parallel \! \! {\bf a} \! \! \parallel \parallel \! \! {\bf b} \! \! \parallel \cos \theta

{\bf b} \cdot {\bf b} - 2 {\bf a} \cdot {\bf b} + {\bf a} \cdot {\bf a} = {\bf a} \cdot {\bf a} + {\bf b} \cdot {\bf b} - 2 \parallel \! \! {\bf a} \! \! \parallel \parallel \! \! {\bf b} \! \! \parallel \cos \theta

We can now cancel from the left and right sides and solve for \cos \theta:

- 2 {\bf a} \cdot {\bf b} = - 2 \parallel \! \! {\bf a} \! \! \parallel \parallel \! \! {\bf b} \! \! \parallel \cos \theta

\displaystyle \frac{ {\bf a} \cdot {\bf b} }{ \parallel \! \! {\bf a} \! \! \parallel \parallel \! \! {\bf b} \! \! \parallel } = \cos \theta

Finally, we are guaranteed that the angle between two vectors must lie between 0 and \pi (or, in degrees, between 0^\circ and 180^\circ). Since this is the range of arccosine, we are permitted to use this inverse function to solve for \theta:

\cos^{-1} \left( \displaystyle \frac{ {\bf a} \cdot {\bf b} }{ \parallel \! \! {\bf a} \! \! \parallel \parallel \! \! {\bf b} \! \! \parallel } \right) = \theta

The good news is that there’s nothing special about two dimensions in the above proof, and so this formula may used for vectors in \mathbb{R}^n for any dimension n \ge 2.

In the next post, we’ll consider how this same problem can be solved — but only in two dimensions — using arctangent.

Inverse Functions: Arccosine and Dot Products (Part 22)

Here’s a straightforward application of arccosine, that, as far as I can tell, isn’t taught too often in Precalculus and is not part of the Common Core standards for vectors and matrices.

Find the angle between the vectors \langle 1,3 \rangle and \langle -2,1 \rangle.

dotproductThis problem is equivalent to finding the angle between the lines y = 3x and y = -x/2. The angle \theta is not drawn in standard position, which makes measurement of the angle initial daunting.

Fortunately, there is the straightforward formula for the angle between two vectors {\bf a} and {\bf b}:

\theta = \cos^{-1} \left( \displaystyle \frac{ {\bf a} \cdot {\bf b} }{ \parallel \!\! {\bf a} \!\! \parallel \parallel \!\! {\bf b} \!\! \parallel } \right)

We recall that {\bf a} \cdot {\bf b} is the dot product (or inner product) of the two vectors {\bf a} and {\bf b}, while \parallel \!\! {\bf a} \!\! \parallel = \sqrt{ {\bf a} \cdot {\bf a} } is the norm (or length) of the vector {\bf a}.

 For this particular example,

\theta = \cos^{-1} \left( \displaystyle \frac{\langle 1,3 \rangle \cdot \langle -2,1 \rangle }{ \parallel \!\!\langle 1,3 \rangle \!\! \parallel \parallel \!\!\langle -2,1 \rangle \!\! \parallel } \right)

\theta = \cos^{-1} \left( \displaystyle \frac{ (1)(-2) + (3)(1) }{ \sqrt{ (1)^2 + (3)^2} \sqrt{ (-2)^2 + 1^2 }} \right)

\theta = \cos^{-1} \displaystyle \frac{1}{\sqrt{50}}

\theta \approx 81.87^\circ

In the next post, we’ll discuss why this actually works. And then we’ll consider how the same problem can be solved more directly using arctangent.

Inverse Functions: Arccosine and SSS (Part 21)

Arccosine has an important advantage over arcsine when solving for the parts of a triangle: there is no possibility ambiguity about the angle.

Solve \triangle ABC if a = 16, b = 20, and c = 25.

When solving for the three angles, it’s best to start with the biggest angle (that is, the angle opposite the biggest side). To see why, let’s see what happens if we first use the Law of Cosines to solve for one of the two smaller angles, say \alpha:

a^2 = b^2 + c^2 - 2 b c \cos \alpha

256 = 400 + 625 - 1000 \cos \alpha

-769 = -1000 \cos \alpha

0.769 = \cos \alpha

\alpha \approx 39.746^\circ

So far, so good. Now let’s try using the Law of Sines to solve for \gamma:

\displaystyle \frac{\sin \alpha}{a} = \displaystyle \frac{\sin \gamma}{c}

\displaystyle \frac{\sin 39.746^\circ}{16} \approx \displaystyle \frac{\sin \gamma}{25}

0.99883 \approx \sin \gamma

Uh oh… there are two possible solutions for \gamma since, hypothetically, \gamma could be in either the first or second quadrant! So we have no way of knowing, using only the Law of Sines, whether \gamma \approx 87.223^\circ or if \gamma \approx 180^\circ - 87.223^\circ = 92.777^\circ.

green lineFor this reason, it would have been far better to solve for the biggest angle first. For the present example, the biggest answer is \gamma since that’s the angle opposite the longest side.

c^2 = a^2 + b^2 - 2 a b \cos \gamma

625 = 256 + 400 - 640 \cos \gamma

-31 =-640 \cos \gamma

0.0484375 = \cos \gamma

Using a calculator, we find that \gamma \approx 87.223^\circ.

We now use the Law of Sines to solve for either \alpha or \beta (pretending that we didn’t do the work above). Let’s solve for \alpha:

\displaystyle \frac{\sin \alpha}{a} = \displaystyle \frac{\sin \gamma}{c}

\displaystyle \frac{\sin \alpha}{16} \approx \displaystyle \frac{\sin 87.223}{25}

\sin \alpha \approx 0.63949

This equation also has two solutions in the interval [0^\circ, 180^\circ], namely, \alpha \approx 39.736^\circ and \alpha \approx 180^\circ - 39.736^\circ = 140.264^\circ. However, we know full well that the answer can’t be larger than \gamma since that’s already known to be the largest angle. So there’s no need to overthink the matter — the answer from blindly using arcsine on a calculator is going to be the answer for \alpha.

Naturally, the easiest way of finding \beta is by computing 180^\circ - \alpha - \gamma.

Inverse Functions: Arccosine and SSS (Part 20)

The Law of Cosines also recognizes when the purported sides of a triangle are impossible.

Solve \triangle ABC if latex a = 16$, b = 20, and c = 40.

Hopefully students would recognize that c > a + b, thus quickly demonstrating that the triangle is impossible. However, this also falls out of the Law of Cosines:

c^2 = a^2 + b^2 - 2 a b \cos \gamma

1600 = 256 + 400 - 640 \cos \gamma

944 =-640 \cos \gamma

-1.475 = \cos \gamma

Since the cosine of an angle can’t be less than -1, we can conclude that this is impossible.

Stated another way, we have the implications (since a, b, and c are all positive)

c > a + b \Longleftrightarrow c^2 > (a+b)^2

\Longleftrightarrow a^2 + b^2 - 2 a b \cos \gamma > a^2 + 2 a b + b^2

\Longleftrightarrow -2 a b \cos \gamma > 2 a b

\Longleftrightarrow \cos \gamma < -1

Since the last statement is impossible, so is the first one.

Inverse Functions: Arccosine and SSS (Part 19)

Arccosine has an important advantage over arcsine when solving for the parts of a triangle: there is no possibility ambiguity about the angle.

Solve \triangle ABC if latex a = 16$, b = 20, and c = 25.

To solve for, say, the angle \gamma, we employ the Law of Cosines:

 

c^2 = a^2 + b^2 - 2 a b \cos \gamma

625 = 256 + 400 - 640 \cos \gamma

-31 =-640 \cos \gamma

0.0484375 = \cos \gamma

Using a calculator, we find that \gamma \approx 87.2^\circ. And the good news is that there is no need to overthink this… this is guaranteed to be the angle since the range of y = \cos^{-1} x is [0,\pi], or [0^\circ, 180^\circ] in degrees. So the equation

\cos x = \hbox{something}

is guaranteed to have a unique solution between 0^\circ and 180^\circ. (But there are infinitely many solutions on \mathbb{R}. And since an angle in a triangle must lie between 0^\circ and 180^\circ, the practical upshot is that just plugging into a calculator blindly is perfectly OK for this problem. This is in stark contrast to the Law of Sines, for which some attention must be paid for solutions in the interval [0^\circ,90^\circ] and also the interval [90^\circ, 180^\circ].

From this point forward, the Law of Cosines could be employed again to find either \alpha or \beta. Indeed, this would be my preference since the sides a, b, and c are exactly. However, my experience is that students prefer the simplicity of the Law of Sines to solve for one of these angles, using the now known pair of c (exactly known) and \gamma (approximately known with a calculator).

Inverse Functions: Arccosine and Arctangent (Part 18)

In this series, we’ve seen that the inverse of function that fails the horizontal line test can be defined by appropriately restricting the domain of the function. For example, we now look at the graph of y = \cos x:

cos1As with the graph of y = \sin x, we select a section that satisfies the horizontal line test and ignore the rest of the graph. (I described this in more rigorous terms when I considered arcsine, so I will not repeat the rigor here.) There are plenty of choices that could be made; by tradition, the interval [0,\pi] is chosen.

cos2Reflecting only the half-wave of the cosine graph on the interval [0,\pi] through the line y = x produces the graph of y= \cos^{-1} x. Again, to assist my students when graphing this function, I point out that the graph of cosine has horizontal tangent lines at the points (0,1) and (\pi,-1). Therefore, after reflecting through the line y = x, we see that the graph of \cos^{-1} x has vertical tangent lines at (1,0) and (-1,\pi).

cos3green lineThe same logic applies when defining the arctangent function. By tradition, the interval (-\pi/2,\pi/2) is chosen as the section of the graph of y = \tan x that satisfies the horizontal line test.

tan1Reflecting only the half-wave of the cosine graph on the interval [0,\pi] through the line y = x produces the graph of y= \tan^{-1} x. Like the (more complicated) logistic growth function, this function has two different horizontal asymptotes that govern the behavior of the function as x \to \pm \infty.

tan2green line

So here are the rules that I want my Precalculus students to memorize:

y = \sin^{-1} x means that x = \sin y and \displaystyle -\frac{\pi}{2} \le y \le \displaystyle \frac{\pi}{2}

y = \cos^{-1} x means that x = \cos y and 0 \le y \le \pi

y = \sin^{-1} x means that x = \sin y and \displaystyle -\frac{\pi}{2} < y < \displaystyle \frac{\pi}{2}

Students using forget that the range of arccosine is different than the other two, and I’ll usually have to produce the graph of y = \cos x to explain and re-explain why this one is different.

Because these functions are defined on restricted domains, the usual funny things can happen. For example,

\cos^{-1} (\cos 2\pi) = \cos^{-1} 1 = 0 \ne 2 \pi

\tan^{-1} \left( \tan \displaystyle \frac{3\pi}{4} \right) = \tan^{-1} (-1) = -\displaystyle \frac{\pi}{4} \ne \displaystyle \frac{3\pi}{4}