TOPICS
Search

Cosine


Trigonometry
Cos

The cosine function cosx is one of the basic functions encountered in trigonometry (the others being the cosecant, cotangent, secant, sine, and tangent). Let theta be an angle measured counterclockwise from the x-axis along the arc of the unit circle. Then costheta is the horizontal coordinate of the arc endpoint.

CosineDiagram

The common schoolbook definition of the cosine of an acute angle theta in a right triangle (which is equivalent to the definition just given) is as the ratio of the lengths of the side of the triangle adjacent to the angle and the hypotenuse, i.e.,

 costheta=(adjacent)/(hypotenuse).
(1)

A convenient mnemonic for remembering the definition of the sine, cosine, and tangent is SOHCAHTOA (sine equals opposite over hypotenuse, cosine equals adjacent over hypotenuse, tangent equals opposite over adjacent).

As a result of its definition, the cosine function is a periodic function with period 2pi. By the Pythagorean theorem, costheta also obeys the Pythagorean identity

 sin^2theta+cos^2theta=1.
(2)
CosReIm
CosContours

The definition of the cosine function can be extended to complex numbers z using the definition

 cosz=1/2(e^(iz)+e^(-iz)),
(3)

where e is the base of the natural logarithm and i is the imaginary unit. Cosine is an entire function and is implemented in the Wolfram Language as Cos[z].

A related function known as the hyperbolic cosine is similarly defined,

 coshz=1/2(e^z+e^(-z)).
(4)

The cosine function has a fixed point at 0.739085... (OEIS A003957), a value sometimes known as the Dottie number (Kaplan 2007).

The cosine function can be defined analytically using the infinite sum

cosx=sum_(n=0)^(infty)((-1)^nx^(2n))/((2n)!)
(5)
=1-(x^2)/(2!)+(x^4)/(4!)-(x^6)/(6!)+...,
(6)

or the infinite product

 cosx=product_(n=1)^infty[1-(4x^2)/(pi^2(2n-1)^2)].
(7)
CosineHardy

A close approximation to cos(pix/2) for x in [0,1] is

H(x)=1-(x^2)/(x+(1-x)sqrt((2-x)/3))
(8)
 approx cos(pi/2x)
(9)

(Hardy 1959), where the difference between cos(pix/2) and Hardy's approximation is plotted above.

The cosine obeys the identity

 cos(ntheta)=2costhetacos[(n-1)theta]-cos[(n-2)theta]
(10)

and the multiple-angle formula

 cos(nx)=sum_(k=0)^n(n; k)cos^kxsin^(n-k)xcos[1/2(n-k)pi],
(11)

where (n; k) is a binomial coefficient and n is a nonnegative integer. It is related to tan(x/2) via

 cosx=(1-tan^2(1/2x))/(1+tan^2(1/2x))
(12)

where tan(x/2) is defined (Trott 2006, p. 39).

For a nonnegative integer N and a real number x with sin(x/2)!=0, summation of cos(nx) from n=0 to N can be done in closed form as

sum_(n=0)^(N)cos(nx)=Re[sum_(n=0)^(N)e^(inx)]
(13)
=Re[(e^(i(N+1)x)-1)/(e^(ix)-1)]
(14)
=Re[(e^(i(N+1)x/2))/(e^(ix/2))(e^(i(N+1)x/2)-e^(-i(N+1)x/2))/(e^(ix/2)-e^(-ix/2))]
(15)
=(sin[1/2(N+1)x])/(sin(1/2x))Re[e^(iNx/2)]
(16)
=(cos(1/2Nx)sin[1/2(N+1)x])/(sin(1/2x)).
(17)

When x and p are real numbers,

 sum_(n=0)^inftyp^ncos(nx)=Re[sum_(n=0)^inftyp^ne^(inx)],
(18)

where |p|<1. The exponential sum formula gives

sum_(n=0)^(infty)p^ncos(nx)=Re[(1-pe^(-ix))/(1-2pcosx+p^2)]
(19)
=(1-pcosx)/(1-2pcosx+p^2).
(20)

At x=2jpi for an integer j, the finite sum equals N+1. For a nonnegative integer N and a real number x with sinx!=0, the sum of cos^2(kx) can also be done in closed form,

 sum_(k=0)^Ncos^2(kx)=1/4{3+2N+cscxsin[x(1+2N)]}.
(21)

At x=jpi for an integer j, this sum equals N+1.

For a real number k_0, the Fourier transform of cos(2pik_0x), interpreted in the sense of generalized functions, is given by

F_x[cos(2pik_0x)](k)=int_(-infty)^inftye^(-2piikx)cos(2pik_0x)dx
(22)
=1/2[delta(k-k_0)+delta(k+k_0)],
(23)

where delta(k) is the delta function.

For a real number nu>1 and alpha on the real axis, Cvijović and Klinowski (1995) consider the series

 C_nu(alpha)=sum_(k=0)^infty(cos[(2k+1)alpha])/((2k+1)^nu)
(24)

which has the following closed form for nu=2n with n a positive integer and 0<=alpha<=pi,

 C_(2n)(alpha)=((-1)^n)/(4(2n-1)!)pi^(2n)E_(2n-1)(alpha/pi),
(25)

where E_n(x) is an Euler polynomial.

A definite integral involving cosx is given by

 int_0^inftycos(x^n)dx=Gamma(1+1/n)cos(pi/(2n))
(26)

for a real number n>1, where Gamma(z) is the gamma function (T. Drane, pers. comm., Apr. 21, 2006).

Zang et al. (2026) determined the minimum proportion of a period on which four cosines with distinct positive integer frequencies all have the same sign. For the functions cos(a_it) with no phase shifts and uniformly distributed t in [0,2pi), this proportion is at least 1/33, with equality exactly when the frequency set is a positive integer multiple of {1,3,11,33}. If both odd and even frequencies occur, the minimum is 1/24, attained exactly at odd multiples of {1,3,4,12} or {2,4,5,15}. More generally, if p_n is the infimum of the same-sign proportions for n distinct positive integer frequencies, then

 4^(1-n)<=p_n<=16n^(log_2(3/2))4^(-n).
(27)

Zang et al. (2026) report AI assistance with mathematical discovery and verification.


See also

Cis, Dottie Number, Elementary Function, Euler Polynomial, Exponential Sum Formulas, Fourier Transform--Cosine, Hyperbolic Cosine, Inverse Cosine, Secant, Sine, SOHCAHTOA, Tangent, Trigonometric Functions, Trigonometry Explore this topic in the MathWorld classroom

Related Wolfram sites

https://functions.wolfram.com/ElementaryFunctions/Cos/

Explore with Wolfram|Alpha

References

Abramowitz, M. and Stegun, I. A. (Eds.). "Circular Functions." §4.3 in Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, pp. 71-79, 1972.Beyer, W. H. CRC Standard Mathematical Tables, 28th ed. Boca Raton, FL: CRC Press, p. 215, 1987.Cvijović, D. and Klinowski, J. "Closed-Form Summation of Some Trigonometric Series." Math. Comput. 64, 205-210, 1995. https://doi.org/10.1090/S0025-5718-1995-1270616-8.Hansen, E. R. A Table of Series and Products. Englewood Cliffs, NJ: Prentice-Hall, 1975.Hardy, G. H. Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work, 3rd ed. New York: Chelsea, p. 68, 1959.Jeffrey, A. "Trigonometric Identities." §2.4 in Handbook of Mathematical Formulas and Integrals, 2nd ed. Orlando, FL: Academic Press, pp. 111-117, 2000.Kaplan, S. R. "The Dottie Number." Math. Mag. 80, 73-74, 2007.Project Mathematics. "Sines and Cosines, Parts I-III." Videotape. http://www.projectmathematics.com/sincos1.htm.Sloane, N. J. A. Sequence A003957 in "The On-Line Encyclopedia of Integer Sequences."Spanier, J. and Oldham, K. B. "The Sine sin(x) and Cosine cos(x) Functions." Ch. 32 in An Atlas of Functions. Washington, DC: Hemisphere, pp. 295-310, 1987.Tropfke, J. Teil IB, §1. "Die Begriffe des Sinus und Kosinus eines Winkels." In Geschichte der Elementar-Mathematik in systematischer Darstellung mit besonderer Berücksichtigung der Fachwörter, fünfter Band, zweite aufl. Berlin, Germany and Leipzig, Germany: de Gruyter, pp. 11-23, 1923.Trott, M. The Mathematica GuideBook for Symbolics. New York: Springer-Verlag, 2006. https://www.mathematicaguidebooks.org/.Zang, S.; Zhao, Y.; Zhao, Y.; and Zhou, C. "Extremal Cosine Sign Correlations." 23 Oct 2026. https://arxiv.org/abs/2610.33190.Zwillinger, D. (Ed.). "Trigonometric or Circular Functions." §6.1 in CRC Standard Mathematical Tables and Formulae. Boca Raton, FL: CRC Press, pp. 452-460, 1995.

Referenced on Wolfram|Alpha

Cosine

Cite this as:

Weisstein, Eric W. "Cosine." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/Cosine.html

Subject classifications