gives the cosine of z.
- 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 can be used with Interval and CenteredInterval objects. »
- Cos automatically threads over lists.
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.
Examplesopen 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:
Numerical Evaluation (6)
The precision of the output tracks the precision of the input:
Cos can take complex number inputs:
Evaluate Cos efficiently at high precision:
Cos threads elementwise over lists and matrices:
Cos can be used with Interval and CenteredInterval objects:
Specific Values (5)
Values of Cos at fixed points:
Zeros of Cos:
Extrema of Cos:
Find a minimum of Cos as the root of in the minimum's neighborhood:
Simple exact values are generated automatically:
More complicated cases require explicit use of FunctionExpand:
Plot the Cos function:
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 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:
Series Expansions (4)
Integral Transforms (3)
Compute the Fourier transform using FourierTransform:
Function Identities and Simplifications (6)
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:
Equiangular (logarithmic) spiral:
Solve an equation for harmonic motion:
Apply to a horizontally aligned vector:
Approximate the almost nowhere differentiable Riemann–Weierstrass function:
A triangle with two equal angles is an isosceles triangle:
Check the Sommerfeld radiation condition for a combination of Airy functions:
There is only an outgoing plane wave:
Properties & Relations (11)
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:
Solve a trigonometric equation:
Numerically find a root of a transcendental equation:
Reduce a trigonometric equation:
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 high‐precision 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:
Plot Cos at integer points:
Wolfram Research (1988), Cos, Wolfram Language function, https://reference.wolfram.com/language/ref/Cos.html (updated 2021).
Wolfram Language. 1988. "Cos." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/Cos.html.
Wolfram Language. (1988). Cos. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Cos.html