The Art of Interface

Article 11 — Appendix A.15

cos — trigonometric cosine function

Category. Mathematics.

Abstract. Trigonometric cosine: definition, plot, properties, identities and table of values for some angles.

Reference. This article is a part of Librow scientific formula calculator project.

1. Definition

Cosine of the angle is ratio of the adjacent leg to hypotenuse.

2. Plot

Cosine is 2π periodic function defined everywhere on real axis — so its wave-like graph spreads endlessly to the left and to the right.

Fig. 1. Plot of the cosine function y = cos x Fig. 1. Plot of the cosine function y = cosx.

Function codomain is limited to the range [−1, 1].

3. Identities

Base:

sin2φ + cos2φ = 1

and its consequences:

cosφ = ±√(1 − sin2φ)
cosφ = ±1 /√(1 + tan2φ)
cosφ = ±cotφ /√(1 + cot2φ)
cosφ = ±√(csc2φ − 1) /cscφ

By definition:

cosφ ≡ 1 /secφ

Properties — symmetry, periodicity, etc.:

cos−φ = cosφ
cosφ = cos(φ + 2πn), where n = 0, ±1, ±2, ...
cosφ = −cos(π − φ)
cosφ = −cos(π + φ)
cosφ = sin(φ + π/2)

Half-angle:

cos(φ/2) = ±√[(1 + cosφ) /2]
cosφ = [1 − tan2(φ/2)] /[1 + tan2(φ/2)]

Double angle:

cos(2φ) = cos2φ − sin2φ
cos(2φ) = 2 cos2φ − 1
cos(2φ) = 1 − 2 sin2φ
sin(2φ) = (1 − tan2φ) /(1 + tan2φ)

Triple angle:

cos(3φ) = cos3φ − 3 sin2φ cosφ = 4 cos3φ − 3 cosφ

Quadruple angle:

cos(4φ) = 8 cos4φ − 8 cos2φ + 1

Power reduction:

cos2φ = [1 + cos(2φ)] /2
cos3φ = [3 cosφ + cos(3φ)] /4
cos4φ = [3 + 4 cos(2φ) + cos(4φ)] /8
cos5φ = [10 cosφ + 5 cos(3φ) + cos(5φ)] /16
sin2φ cos2φ = [1 − cos(4φ)] /8
sin3φ cos3φ = [3 sin(2φ) − sin(6φ)] /32
sin4φ cos4φ = [3 − 4 cos(4φ) + cos(8φ)] /128
sin5φ cos5φ = [10 sin(2φ) − 5 sin(6φ) + sin(10φ)] /512

Sum and difference of angles:

cos(φ + ψ) = cosφ cosψ − sinφ sinψ
cos(φψ) = cosφ cosψ + sinφ sinψ

Product-to-sum:

cosφ cosψ = [cos(φψ) + cos(φ + ψ)] /2
sinφ cosψ = [sin(φ + ψ) + sin(φψ)] /2

Sum-to-product:

cosφ + cosψ = 2 cos[(φ + ψ) /2] cos[(φψ) /2]
cosφ − cosψ = −2 sin[(φ + ψ) /2] sin[(φ - ψ) /2]
cosφ + cos(φ + ψ) + cos(φ + 2ψ) + ... + cos(φ + nψ) = sin[(n + 1) ψ/2] cos(φ + nψ/2) /sin(ψ/2)

Cosine of inverse functions:

cos(arccos x) ≡ x
cos(arcsinx) = √(1 − x2)
cos(arctan x) = 1 /√(1 + x2)

Some angles:

Angle φValue cosφ
01
π/12(√6 + √2) /4
π/10√(10 + 2√5) /4
π/8√(2 + √2) /2
π/6√3 /2
π/5(√5 + 1) /4
π/41 /√2
3π/10√(10 - 2√5) /4
π/31 /2
3π/8√(2 − √2) /2
2π/5(√5 − 1) /4
5π/12(√6 − √2) /4
π/20
Table 1. Cosine for some angles.

4. Support

Trigonometric cosine function cos of the real argument is supported by free version of the Librow calculator.

Trigonometric cosine function cos of the complex argument is supported by professional version of the Librow calculator.

5. How to use

To calculate cosine of the number:

cos(-1);

To calculate cosine of the current result:

cos(rslt);

To calculate cosine of the angle φ in memory:

cos(mem[φ]);