Cosine

DOWNLOAD Mathematica Notebook EXPLORE THIS TOPIC IN the MathWorld Classroom
TrigonometryCos

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 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=(adjacenct)/(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 periodic with period 2pi. By the Pythagorean theorem, costheta also obeys the identity

 sin^2theta+cos^2theta=1.
(2)
CosReImAbs
Min Max
Re
Im Powered by webMathematica

The definition of the cosine function can be extended to complex arguments 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 number. 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. It is related to tan(x/2) via

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

(Trott 2006, p. 39).

Summation of cos(nx) from n=0 to N can be done in closed form as

sum_(n=0)^(N)cos(nx)=R[sum_(n=0)^(N)e^(inx)]
(13)
=R[(e^(i(N+1)x)-1)/(e^(ix)-1)]
(14)
=R[(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))R[e^(iNx/2)]
(16)
=(cos(1/2Nx)sin[1/2(N+1)x])/(sin(1/2x)).
(17)

Similarly,

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

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

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

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)

The Fourier transform of cos(2pik_0x) 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.

Cvijović and Klinowski (1995) note that the following series

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

has closed form for nu=2n,

 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 n>1 where Gamma(z) is the gamma function (T. Drane, pers. comm., Apr. 21, 2006).

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.