© Springer Nature Switzerland AG 2018
Michael Oberguggenberger and Alexander OstermannAnalysis for Computer ScientistsUndergraduate Topics in Computer Sciencehttps://doi.org/10.1007/978-3-319-91155-7_3

3. Trigonometry

Michael Oberguggenberger1   and Alexander Ostermann1  
(1)
University of Innsbruck, Innsbruck, Austria
 
 
Michael Oberguggenberger (Corresponding author)
 
Alexander Ostermann

Trigonometric functions play a major role in geometric considerations as well as in the modelling of oscillations. We introduce these functions at the right-angled triangle and extend them periodically to $$\mathbb R$$ using the unit circle. Furthermore, we will discuss the inverse functions of the trigonometric functions in this chapter. As an application we will consider the transformation between Cartesian and polar coordinates.

3.1 Trigonometric Functions at the Triangle

The definitions of the trigonometric functions are based on elementary properties of the right-angled triangle. Figure 3.1 shows a right-angled triangle. The sides adjacent to the right angle are called legs (or catheti) , the opposite side hypotenuse.

One of the basic properties of the right-angled triangle is expressed by Pythagoras’ theorem.1

Proposition 3.1

(Pythagoras)   In a right-angled triangle the sum of the squares of the legs equals the square of the hypotenuse. In the notation of Fig. 3.1 this says that $$a^2 + b^2 = c^2$$.

Proof

According to Fig. 3.2 one can easily see that
$$ (a+b)^2 - c^2 = \text {area of the grey triangles} = 2 ab. $$
From this it follows that $$a^2 + b^2 -c^2 = 0$$.    $$\square $$
A fundamental fact is Thales’ intercept theorem2 which says that the ratios of the sides in a triangle are scale invariant; i.e. they do not depend on the size of the triangle.
images/215236_2_En_3_Chapter/215236_2_En_3_Fig1_HTML.gif
Fig. 3.1

A right-angled triangle with legs a, b and hypotenuse c

images/215236_2_En_3_Chapter/215236_2_En_3_Fig2_HTML.gif
Fig. 3.2

Basic idea of the proof of Pythagoras’ theorem

images/215236_2_En_3_Chapter/215236_2_En_3_Fig3_HTML.gif
Fig. 3.3

Similar triangles

In the situation of Fig. 3.3 Thales’ theorem asserts that the following ratios are valid:
$$ \frac{a}{c} = \frac{a'}{c'},\qquad \frac{b}{c} = \frac{b'}{c'},\qquad \frac{a}{b} = \frac{a'}{b'}. $$
The reason for this is that by changing the scale (enlargement or reduction of the triangle) all sides are changed by the same factor. One then concludes that the ratios of the sides only depend on the angle $${\alpha }$$ (and $$\beta =90^\circ -\alpha $$, respectively). This gives rise to the following definition.

Definition 3.2

(Trigonometric functions)    For $$0^\circ \le \alpha \le 90^\circ $$ we define
images/215236_2_En_3_Chapter/215236_2_En_3_Equ29_HTML.gif
Note that $$\tan \alpha $$ is not defined for $$\alpha =90^\circ $$ (since $$b=0$$) and that $$\cot \alpha $$ is not defined for $$\alpha = 0^\circ $$ (since $$a=0$$). The identities
$$ \tan \alpha = \frac{\sin \alpha }{\cos \alpha },\quad \cot \alpha = \displaystyle \frac{\cos \alpha }{\sin \alpha },\quad \sin \alpha = \cos \beta = \cos \ (90^\circ - \alpha ) $$
follow directly from the definition, the relationship
$$ \sin ^2 \alpha + \cos ^2 \alpha = 1 $$
is obtained using Pythagoras’ theorem.
The trigonometric functions have many applications in mathematics. As a first example we derive the formula for the area of a general triangle; see Fig. 3.4. The sides of a triangle are usually labelled in counterclockwise direction using lowercase Latin letters, and the angles opposite the sides are labelled using the corresponding Greek letters. Because $$F = \frac{1}{2} ch$$ and $$h=b\sin \alpha $$ the formula for the area of a triangle can be written as
$$ F = \frac{1}{2} \, bc \sin \alpha = \frac{1}{2}\, ac \sin \beta = \frac{1}{2} \, ab \sin \gamma . $$
So the area equals half the product of two sides times the sine of the enclosed angle. The last equality in the above formula is valid for reasons of symmetry. There $$\gamma $$ denotes the angle opposite to the side c, in other words $$\gamma = 180^\circ -\alpha -\beta $$.
images/215236_2_En_3_Chapter/215236_2_En_3_Fig4_HTML.gif
Fig. 3.4

A general triangle

images/215236_2_En_3_Chapter/215236_2_En_3_Fig5_HTML.gif
Fig. 3.5

Straight line with slope k

images/215236_2_En_3_Chapter/215236_2_En_3_Fig6_HTML.gif
Fig. 3.6

Relationship between degrees and radian measure

As a second example we compute the slope of a straight line. Figure 3.5 shows a straight line $$y = k x + d$$. Its slope k is the change of the y-value per unit change in x. It is calculated from the triangle attached to the straight line in Fig. 3.5 as $$k=\tan \alpha $$.

In order to have simple formulas such as
$$ {\frac{\mathrm{d}}{\mathrm{d}x}} \sin x = \cos x, $$
one has to measure the angle in radian measure . The connection between degree and radian measure can be seen from the unit circle (i.e., the circle with centre 0 and radius 1); see Fig. 3.6.

The radian measure of the angle $$\alpha $$ (in degrees) is defined as the length $$\ell $$ of the corresponding arc of the unit circle with the sign of $$\alpha $$. The arc length $$\ell $$ on the unit circle has no physical unit. However, one speaks about radians (rad) to emphasise the difference to degrees.

As is generally known the circumference of the unit circle is $$2\pi $$ with the constant
$$ \pi = 3.141592653589793...\approx \frac{22}{7}. $$
For the conversion between the two measures we use that $$ 360^\circ $$ corresponds to $$2 \pi $$ in radian measure, for short $$ 360^\circ \leftrightarrow 2 \pi \, \text {[rad]}$$, so
$$ \alpha ^\circ \ \leftrightarrow \ \frac{\pi }{180} \, \alpha \, \text {[rad]} \qquad \text {and} \qquad \ell \;\text {[rad]}\ \leftrightarrow \ \left( \frac{180}{\pi }\, \ell \right) ^\circ , $$
respectively. For example, $$90^\circ \leftrightarrow \frac{\pi }{2}$$ and $$-270^\circ \leftrightarrow -\frac{3\pi }{2}$$. Henceforth we always measure angles in radians.
images/215236_2_En_3_Chapter/215236_2_En_3_Fig7_HTML.gif
Fig. 3.7

Definition of the trigonometric functions on the unit circle

images/215236_2_En_3_Chapter/215236_2_En_3_Fig8_HTML.gif
Fig. 3.8

Extension of the trigonometric functions on the unit circle

3.2 Extension of the Trigonometric Functions to $$\mathbb R$$

For $$0 \le \alpha \le \frac{\pi }{2}$$ the values $$\sin \alpha $$, $$\cos \alpha $$, $$\tan \alpha $$ and $$\cot \alpha $$ have a simple interpretation on the unit circle; see Fig. 3.7. This representation follows from the fact that the hypotenuse of the defining triangle has length 1 on the unit circle.

One now extends the definition of the trigonometric functions for $$0 \le \alpha \le 2\pi $$ by continuation with the help of the unit circle. A general point P on the unit circle, which is defined by the angle $$\alpha $$, is assigned the coordinates
$$ P = (\cos \alpha , \sin \alpha ), $$
see Fig. 3.8. For $$0 \le \alpha \le \frac{\pi }{2}$$ this is compatible with the earlier definition. For larger angles the sine and cosine functions are extended to the interval $$[0,2\pi ]$$ by this convention. For example, it follows from the above that
$$ \sin \alpha = -\sin (\alpha -\pi ), \qquad \cos \alpha = -\cos (\alpha -\pi ) $$
for $$\pi \le \alpha \le \frac{3\pi }{2}$$, see Fig. 3.8.
For arbitrary values $$\alpha \in \mathbb R$$ one finally defines $$\sin \alpha $$ and $$\cos \alpha $$ by periodic continuation with period $$2 \pi $$. For this purpose one first writes $$\alpha = x + 2 k\pi $$ with a unique $$x \in [0, 2\pi )$$ and $$k \in \mathbb Z$$. Then one sets
$$ \sin \alpha = \sin \left( x + 2 k \pi \right) = \sin x, \qquad \cos \alpha = \cos \left( x + 2 k \pi \right) = \cos x. $$
With the help of the formulas
$$ \tan \alpha = \frac{\sin \alpha }{\cos \alpha },\qquad \cot \alpha = \frac{\cos \alpha }{\sin \alpha } $$
the tangent and cotangent functions are extended as well. Since the sine function equals zero for integer multiples of $$\pi $$, the cotangent is not defined for such arguments. Likewise the tangent is not defined for odd multiples of $$\frac{\pi }{2}$$.
The graphs of the functions $$y = \sin x$$, $$y = \cos x$$ are shown in Fig. 3.9. The domain of both functions is $$D = \mathbb R$$.
images/215236_2_En_3_Chapter/215236_2_En_3_Fig9_HTML.gif
Fig. 3.9

The graphs of the sine and cosine functions in the interval $$[-2\pi , 2\pi ]$$

The graphs of the functions $$y = \tan x$$ and $$y=\cot x$$ are presented in Fig. 3.10. The domain D for the tangent is, as explained above, given by $$D = \{x \in \mathbb R\;;\; x \ne \frac{\pi }{2} + k\pi , \ k \in \mathbb Z\}$$, the one for the cotangent is $$D = \{x \in \mathbb R\;;\; x \ne k\pi , \ k \in \mathbb Z\}$$.

Many relations are valid between the trigonometric functions. For example, the following addition theorems, which can be proven by elementary geometrical considerations, are valid; see Exercise 3. The maple commands expand and combine use such identities to simplify trigonometric expressions.

Proposition 3.3

(Addition theorems)    For $$x, y \in \mathbb R$$ it holds that
$$\begin{aligned} \sin \left( x + y\right)= & {} \sin x \cos y + \cos x \sin y,\\ \cos \left( x + y\right)= & {} \cos x \cos y - \sin x \sin y. \end{aligned}$$
images/215236_2_En_3_Chapter/215236_2_En_3_Fig10_HTML.gif
Fig. 3.10

The graphs of the tangent (left) and cotangent (right) functions

3.3 Cyclometric Functions

The cyclometric functions are inverse to the trigonometric functions in the appropriate bijectivity regions.

Sine and arcsine. The sine function is bijective from the interval $$[- \frac{\pi }{2}, \frac{\pi }{2}]$$ to the range $$[-1,1]$$; see Fig. 3.9. This part of the graph is called principal branch of the sine. Its inverse function (Fig. 3.11) is called arcsine (or sometimes inverse sine)
$$ \arcsin : [-1,1] \rightarrow \left[ -\frac{\pi }{2}, \frac{\pi }{2}\right] . $$
According to the definition of the inverse function it follows that
$$ \sin (\arcsin y) = y\qquad \text {for all } y\in [-1,1]. $$
However, the converse formula is only valid for the principal branch; i.e.
$$ \arcsin (\sin x) = x \qquad \text {is only valid for } -\frac{\pi }{2} \le x \le \frac{\pi }{2}. $$
For example, $$\arcsin (\sin 4) = -0.8584073... \ne 4$$.
images/215236_2_En_3_Chapter/215236_2_En_3_Fig11_HTML.gif
Fig. 3.11

The principal branch of the sine (left); the arcsine function (right)

Cosine and arccosine. Likewise, the principal branch of the cosine is defined as restriction of the cosine to the interval $$[0,\pi ]$$ with range $$[-1,1]$$. The principal branch is bijective, and its inverse function (Fig. 3.12) is called arccosine (or sometimes inverse cosine)
$$ \arccos : [-1, 1] \rightarrow [0,\pi ]. $$
images/215236_2_En_3_Chapter/215236_2_En_3_Fig12_HTML.gif
Fig. 3.12

The principal branch of the cosine (left); the arccosine function (right)

Tangent and arctangent. As can be seen in Fig. 3.10 the restriction of the tangent to the interval $$(-\frac{\pi }{2}, \frac{\pi }{2})$$ is bijective. Its inverse function is called arctangent (or inverse tangent)
$$ \arctan : \mathbb R\rightarrow \left( -\frac{\pi }{2}, \frac{\pi }{2}\right) . $$
To be precise this is again the principal branch of the inverse tangent (Fig. 3.13).
images/215236_2_En_3_Chapter/215236_2_En_3_Fig13_HTML.gif
Fig. 3.13

The principal branch of the arctangent

Application 3.4

(Polar coordinates in the plane)   The polar coordinates $$(r,\varphi )$$ of a point $$P=(x, y)$$ in the plane are obtained by prescribing its distance r from the origin and the angle $$\varphi $$ with the positive x-axis (in counterclockwise direction); see Fig. 3.14.

images/215236_2_En_3_Chapter/215236_2_En_3_Fig14_HTML.gif
Fig. 3.14

Plane polar coordinates

The connection between Cartesian and polar coordinates is therefore described by
$$\begin{aligned} x= & {} r \cos \varphi \,,\\ y= & {} r \sin \varphi \,, \end{aligned}$$
where $$0 \le \varphi < 2 \pi $$ and $$r \ge 0$$. The range $$-\pi < \varphi \le \pi $$ is also often used.
In the converse direction the following conversion formulas are valid
$$\begin{aligned} r= & {} \sqrt{x^2 + y^2}\,,\\ \varphi= & {} \arctan \frac{y}{x}\quad (\text {in the region}\ x> 0; \ -\tfrac{\pi }{2}< \varphi< \tfrac{\pi }{2}),\\ \varphi= & {} {\text {sign}}y \cdot \arccos \frac{x}{\sqrt{x^2+y^2}} \quad (\mathrm{if}\ y \ne 0\ \mathrm{or}\ x >0;\ -\pi< \varphi < \pi ). \end{aligned}$$
The reader is encouraged to verify these formulas with the help of maple.

3.4 Exercises

1.

Using geometric considerations at suitable right-angled triangles, determine the values of the sine, cosine and tangent of the angles $$\alpha = 45^\circ $$, $$\beta = 60^\circ $$, $$\gamma = 30^\circ $$. Extend your result for $$\alpha = 45^\circ $$ to the angles $$135^\circ $$, $$225^\circ $$, $$-45^\circ $$ with the help of the unit circle. What are the values of the angles under consideration in radian measure?

2.

Using MATLAB write a function degrad.m which converts degrees to radian measure. The command degrad(180) should give $$\pi $$ as a result. Furthermore, write a function mysin.m which calculates the sine of an angle in radian measure with the help of degrad.m.

3.
Prove the addition theorem of the sine function
$$ \sin (x+y)=\sin x\cos y+\cos x\sin y. $$

Hint. If the angles xy and their sum $$x+y$$ are between 0 and $$\pi /2$$ you can directly argue with the help of Fig. 3.15; the remaining cases can be reduced to this case.

4.
Prove the law of cosines
$$ a^2 = b^2 + c^2 - 2 bc \cos \alpha $$
for the general triangle in Fig. 3.4.
Hint. The segment c is divided into two segments $$c_1$$ (left) and $$c_2$$ (right) by the height h. The following identities hold true by Pythagoras’ theorem
$$ a^2 = h^2 + c_2^2,\qquad b^2 = h^2 + c_1^2,\qquad c =c_1 + c_2. $$
Eliminating h gives $$\ a^2 = b^2 + c^2 - 2 c c_1$$.
5.

Compute the angles $$\alpha , \beta , \gamma $$ of the triangle with sides $$a = 3$$, $$b = 4$$, $$c = 2$$ and plot the triangle in maple.

Hint. Use the law of cosines from Exercise 4.

6.
Prove the law of sines
$$ \frac{a}{\sin \alpha } = \frac{b}{\sin \beta } = \frac{c}{\sin \gamma } $$
for the general triangle in Fig. 3.4.
Hint. The first identity follows from
$$ \sin \alpha = \frac{h}{b},\qquad \sin \beta = \frac{h}{a}. $$
7.

Compute the missing sides and angles of the triangle with data $$b = 5$$, $$\alpha = 43^\circ $$, $$\gamma = 62^\circ $$, and plot your solutions using MATLAB.

Hint. Use the law of sines from Exercise 6.

8.
With the help of MATLAB plot the following functions
$$\begin{aligned} y&= \cos (\arccos x ), \qquad x\in [-1,1];\\ y&= \arccos ( \cos x ), \qquad x\in [0,\pi ];\\ y&= \arccos ( \cos x ), \qquad x\in [0,4\pi ]. \end{aligned}$$
Why is $$\arccos (\cos x)\not = x $$ in the last case?
9.

Plot the functions $$ y = \sin x$$, $$y = \left| \sin x \right| $$, $$y = \sin ^2 x$$, $$y = \sin ^3 x$$, $$y = \frac{1}{2}\left( \left| \sin x \right| -\right. $$$$\left. \sin x\right) $$ and $$y = \arcsin \left( \frac{1}{2}(\left| \sin x\right| -\sin x)\right) $$ in the interval $$[0,6\pi ]$$. Explain your results.

Hint. Use the MATLAB command axis equal.

10.

Plot the graph of the function $$f: \mathbb R\rightarrow \mathbb R: x\mapsto ax + \sin x$$ for various values of a. For which values of a is the function f injective or surjective?

11.
Show that the following formulas for the surface line s and the surface area M of a right circular truncated cone (see Fig. 3.16, left) hold true
$$ s=\sqrt{h^2+(R-r)^2},\qquad M=\pi (r+R)s. $$

Hint. By unrolling the truncated cone a sector of an annulus with apex angle $$\alpha $$ is created; see Fig. 3.16, right. Therefore, the following relationships hold: $$\alpha t=2\pi r$$, $$\alpha (s+t)=2\pi R$$ and $$M=\tfrac{1}{2} \alpha \bigl ( (s+t)^2-t^2\bigr )$$.

12.
The secant and cosecant functions are defined as the reciprocals of the cosine and the sine functions, respectively,
$$ \sec \alpha = \frac{1}{\cos \alpha },\quad \csc \alpha = \frac{1}{\sin \alpha }. $$
Due to the zeros of the cosine and the sine function, the secant is not defined for odd multiples of $$\frac{\pi }{2}$$, and the cosecant is not defined for integer multiples of $$\pi $$.
(a)

Prove the identities $$1 + \tan ^2\alpha = \sec ^2\alpha $$ and $$1 + \cot ^2\alpha = \csc ^2\alpha $$.

(b)

With the help of MATLAB plot the graph of the functions $$y = \sec x$$ and $$y = \csc x$$ for x between $$-2\pi $$ and $$2\pi $$.

images/215236_2_En_3_Chapter/215236_2_En_3_Fig15_HTML.gif
Fig. 3.15

Proof of Proposition 3.3

images/215236_2_En_3_Chapter/215236_2_En_3_Fig16_HTML.gif
Fig. 3.16

Right circular truncated cone with unrolled surface