Cos

Cos[z]

gives the cosine of z.

Details

  • Mathematical function, suitable for both symbolic and numerical manipulation.
  • Unless explicitly given as a Quantity object, the argument of Cos is assumed to be in radians. (Multiply by Degree to convert from degrees.) »
  • Cos is automatically evaluated when its argument is a simple rational multiple of ; for more complicated rational multiples, FunctionExpand can sometimes be used. »
  • For certain special arguments, Cos automatically evaluates to exact values.
  • Cos can be evaluated to arbitrary numerical precision.
  • Cos automatically threads over lists. »
  • Cos can be used with Interval and CenteredInterval objects. »

Background & Context

  • Cos is the cosine function, which is one of the basic functions encountered in trigonometry. It is defined for real numbers by letting be a radian angle measured counterclockwise from the axis along the circumference of the unit circle. Cos[x] then gives the horizontal coordinate of the arc endpoint. The equivalent schoolbook definition of the cosine of an angle in a right triangle is the ratio of the length of the leg adjacent to to the length of the hypotenuse.
  • Cos automatically evaluates to exact values when its argument is a simple rational multiple of . For more complicated rational multiples, FunctionExpand can sometimes be used to obtain an explicit exact value. To specify an argument using an angle measured in degrees, the symbol Degree can be used as a multiplier (e.g. Cos[30 Degree]). When given exact numeric expressions as arguments, Cos may be evaluated to arbitrary numeric precision. Other operations useful for manipulation of symbolic expressions involving Cos include TrigToExp, TrigExpand, Simplify, and FullSimplify.
  • Cos threads elementwise over lists and matrices. In contrast, MatrixFunction can be used to give the cosine of a square matrix (i.e. the power series for the cosine function with ordinary powers replaced by matrix powers) as opposed to the cosines of the individual matrix elements.
  • Cos is periodic with period , as reported by FunctionPeriod. Cos satisfies the identity , which is equivalent to the Pythagorean theorem. The definition of the cosine function is extended to complex arguments using the definition , where is the base of the natural logarithm. The cosine function is entire, meaning it is complex differentiable at all finite points of the complex plane. Cos[z] has series expansion about the origin.
  • The inverse function of Cos is ArcCos. The hyperbolic cosine is given by Cosh. Other related mathematical functions include Sec and Sin.

Examples

open allclose all

Basic Examples  (5)

The argument is given in radians:

Use Degree to specify an argument in degrees:

Plot over a subset of the reals:

Plot over a subset of the complexes:

Series expansion at 0:

Scope  (51)

Numerical Evaluation  (6)

Evaluate numerically:

Evaluate to high precision:

The precision of the output tracks the precision of the input:

Cos can take complex number inputs:

Evaluate Cos efficiently at high precision:

Compute the elementwise values of an array using automatic threading:

Or compute the matrix Cos function using MatrixFunction:

Compute worst-case guaranteed intervals using Interval and CenteredInterval objects:

Or compute average-case statistical intervals using Around:

Specific Values  (5)

Values of Cos at fixed points:

Values at infinity:

Zeros of Cos:

Extrema of Cos:

Find a minimum of Cos as the root of in the minimum's neighborhood:

Substitute in the result:

Visualize the result:

Simple exact values are generated automatically:

More complicated cases require explicit use of FunctionExpand:

Visualization  (3)

Plot the Cos function:

Plot the real part of :

Plot the imaginary part of :

Polar plot with :

Function Properties  (13)

Cos is defined for all real and complex values:

Cos achieves all real values between -1 and 1:

The range for complex values is the whole plane:

Cos is a periodic function with a period :

Cos is an even function:

Cos has the mirror property cos(TemplateBox[{z}, Conjugate])=TemplateBox[{{cos, (, z, )}}, Conjugate]:

Cos is an analytic function of x:

Cos is monotonic in a specific range:

Cos is not injective:

Cos is not surjective:

Cos is neither non-negative nor non-positive:

Cos has no singularities or discontinuities:

Cos is neither convex nor concave:

It is concave for x in [0,π]:

TraditionalForm formatting:

Differentiation  (3)

First derivative:

Higher derivatives:

Formula for the ^(th) derivative:

Integration  (3)

Indefinite integral of Cos:

Definite integral of Cos over a period is 0:

More integrals:

Series Expansions  (4)

Find the Taylor expansion using Series:

Plot the first three approximations for Cos around :

General term in the series expansion of Cos:

Fourier series:

Cos can be applied to power series:

Integral Transforms  (3)

Compute the Fourier transform using FourierTransform:

LaplaceTransform:

MellinTransform:

Function Identities and Simplifications  (6)

Cos of a double angle:

Cos of a sum:

Convert multipleangle expressions:

Convert sums of trigonometric functions to products:

Expand assuming real variables and :

Convert to complex exponentials:

Function Representations  (5)

Representation through Sin:

Representation through Bessel functions:

Representation through SphericalHarmonicY:

Representation in terms of MeijerG:

Cos can be represented as a DifferentialRoot:

Applications  (14)

Draw a circle:

Lissajous figure:

Equiangular (logarithmic) spiral:

Circular motion:

Solve an equation for harmonic motion:

Rotation matrix:

Apply to a horizontally aligned vector:

Plot a sphere:

Plot a torus:

2D waves:

Tripleperiodic surface:

Approximate the almost nowhere differentiable RiemannWeierstrass function:

A triangle with two equal angles is an isosceles triangle:

Visualize it:

Find the area:

Check the Sommerfeld radiation condition for a combination of Airy functions:

There is only an outgoing plane wave:

Find a point in the circle using Cos and Sin functions:

Properties & Relations  (12)

Basic parity and periodicity properties of the cosine function get applied automatically:

Complicated expressions containing trigonometric functions do not simplify automatically:

Compose with inverse functions:

1 radian is degrees:

Solve a trigonometric equation:

Numerically find a root of a transcendental equation:

Reduce a trigonometric equation:

Integrals:

Cos appears in special cases of many mathematical functions:

Cos is a numeric function:

The generating function for Cos:

The exponential generating function for Cos:

Possible Issues  (5)

Machine-precision input is insufficient to give a correct answer:

With exact input, the answer is correct:

A larger setting for $MaxExtraPrecision can be needed:

Machine-number inputs can give highprecision results:

Continuous functions involving Cos[x] can give discontinuous indefinite integrals:

In TraditionalForm, parentheses are needed around the argument:

Neat Examples  (5)

Noncommensurate waves (quasiperiodic function):

Some arguments can be expressed as a finite sequence of nested radicals:

Indefinite integral of :

Chladni figure:

Plot Cos at integer points:

Wolfram Research (1988), Cos, Wolfram Language function, https://reference.wolfram.com/language/ref/Cos.html (updated 2021).

Text

Wolfram Research (1988), Cos, Wolfram Language function, https://reference.wolfram.com/language/ref/Cos.html (updated 2021).

CMS

Wolfram Language. 1988. "Cos." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/Cos.html.

APA

Wolfram Language. (1988). Cos. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Cos.html

BibTeX

@misc{reference.wolfram_2024_cos, author="Wolfram Research", title="{Cos}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/Cos.html}", note=[Accessed: 06-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_cos, organization={Wolfram Research}, title={Cos}, year={2021}, url={https://reference.wolfram.com/language/ref/Cos.html}, note=[Accessed: 06-October-2024 ]}