---
title: "Cos"
language: "en"
type: "Symbol"
summary: "Cos[z] gives the cosine of z."
keywords: 
- cos
- COS
- ccos
- ccosf
- ccoshl
- ccosl
- cos
- cosf
- cosl
- cos
- cos
- cos
- cos
- cos
- cosd
canonical_url: "https://reference.wolfram.com/language/ref/Cos.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Trigonometric Functions"
    link: "https://reference.wolfram.com/language/guide/TrigonometricFunctions.en.md"
  - 
    title: "GPU Computing"
    link: "https://reference.wolfram.com/language/guide/GPUComputing.en.md"
  - 
    title: "Precollege Education"
    link: "https://reference.wolfram.com/language/guide/PrecollegeEducation.en.md"
  - 
    title: "GPU Computing with NVIDIA"
    link: "https://reference.wolfram.com/language/guide/GPUComputing-NVIDIA.en.md"
  - 
    title: "GPU Computing with Apple"
    link: "https://reference.wolfram.com/language/guide/GPUComputing-Apple.en.md"
  - 
    title: "Mathematical Functions"
    link: "https://reference.wolfram.com/language/guide/MathematicalFunctions.en.md"
  - 
    title: "Elementary Functions"
    link: "https://reference.wolfram.com/language/guide/ElementaryFunctions.en.md"
  - 
    title: "Functions for Separable Coordinate Systems"
    link: "https://reference.wolfram.com/language/guide/FunctionsForSeparableCoordinateSystems.en.md"
related_functions: 
  - 
    title: "AngleVector"
    link: "https://reference.wolfram.com/language/ref/AngleVector.en.md"
  - 
    title: "ArcCos"
    link: "https://reference.wolfram.com/language/ref/ArcCos.en.md"
  - 
    title: "Sec"
    link: "https://reference.wolfram.com/language/ref/Sec.en.md"
  - 
    title: "Sin"
    link: "https://reference.wolfram.com/language/ref/Sin.en.md"
  - 
    title: "CosDegrees"
    link: "https://reference.wolfram.com/language/ref/CosDegrees.en.md"
  - 
    title: "Degree"
    link: "https://reference.wolfram.com/language/ref/Degree.en.md"
  - 
    title: "FromDMS"
    link: "https://reference.wolfram.com/language/ref/FromDMS.en.md"
  - 
    title: "TrigToExp"
    link: "https://reference.wolfram.com/language/ref/TrigToExp.en.md"
  - 
    title: "TrigExpand"
    link: "https://reference.wolfram.com/language/ref/TrigExpand.en.md"
  - 
    title: "CirclePoints"
    link: "https://reference.wolfram.com/language/ref/CirclePoints.en.md"
related_tutorials: 
  - 
    title: "Some Mathematical Functions"
    link: "https://reference.wolfram.com/language/tutorial/SomeMathematicalFunctions.en.md"
  - 
    title: "Elementary Transcendental Functions"
    link: "https://reference.wolfram.com/language/tutorial/MathematicalFunctions.en.md#10797"
---
# 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 $\pi$; 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 $x$ be a radian angle measured counterclockwise from the $x$ 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 $\theta$ in a right triangle is the ratio of the length of the leg adjacent to $\theta$ to the length of the hypotenuse.

``Cos`` automatically evaluates to exact values when its argument is a simple rational multiple of $\pi$. 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 $2\pi$, as reported by ``FunctionPeriod``. ``Cos`` satisfies the identity $\sin ^2(x)+\cos ^2(x)=1$, which is equivalent to the Pythagorean theorem. The definition of the cosine function is extended to complex arguments $z$ using the definition $\cos (z)=\frac{1}{2} \left(e^{i z}+e^{-i z}\right)$, where $e$ 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 $\sum _{k=0}^{\infty } \frac{(-1)^k }{(2 k)!}z^{2 k}$ 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 (92)

### Basic Examples (5)

The argument is given in radians:

```wl
In[1]:= Cos[Pi / 6]

Out[1]= (Sqrt[3]/2)
```

---

Use ``Degree`` to specify an argument in degrees:

```wl
In[1]:= Cos[30Degree]

Out[1]= (Sqrt[3]/2)
```

---

Plot over a subset of the reals:

```wl
In[1]:= Plot[Cos[x], {x, 0, 2Pi}]

Out[1]= [image]
```

---

Plot over a subset of the complexes:

```wl
In[1]:= ComplexPlot3D[Cos[z], {z, -2 π - 2 I, 2 π + 2 I}, PlotLegends -> Automatic]

Out[1]= [image]
```

---

Series expansion at ``0`` :

```wl
In[1]:= Series[Cos[x], {x, 0, 10}]

Out[1]=
SeriesData[x, 0, {1, 0, Rational[-1, 2], 0, Rational[1, 24], 0, Rational[-1, 720], 0, 
  Rational[1, 40320], 0, Rational[-1, 3628800]}, 0, 11, 1]
```

### Scope (51)

#### Numerical Evaluation (6)

Evaluate numerically:

```wl
In[1]:= Cos[1.2]

Out[1]= 0.362358
```

---

Evaluate to high precision:

```wl
In[1]:= N[Cos[12 / 10], 50]

Out[1]= 0.36235775447667357763837335562307602033994778557665
```

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

```wl
In[2]:= Cos[1.20000000000000000000000]

Out[2]= 0.36235775447667357763837
```

---

``Cos`` can take complex number inputs:

```wl
In[1]:= Cos[2.5 + I]

Out[1]= -1.23623 - 0.703325 I
```

---

Evaluate ``Cos`` efficiently at high precision:

```wl
In[1]:= Cos[1.2`500]//Timing

Out[1]= {0., 0.3623577544766735776383733556230760203399477855766486264877497209361354423102041880854636319361822220680517146821191313593727550700463210945293184170573108615463292358551718427052279427519439743246504882851135179323438593676454512560347889081 ... 755420009454934798804902854084849566192219755448197282163926437299647959462068788805515967465970133458507457149187351797556673215661379498994521739061582793459853192510935080370458566353679126396462533512556427644308483435724493988875098525893441}

In[2]:= Cos[1.2`100000];//Timing

Out[2]= {0.171875, Null}
```

---

Compute the elementwise values of an array using automatic threading:

```wl
In[1]:= Cos[ {{5π / 6, 0}, {3π / 2, -π / 2}}]

Out[1]= {{-(Sqrt[3]/2), 1}, {0, 0}}
```

Or compute the matrix ``Cos`` function using ``MatrixFunction``:

```wl
In[2]:= MatrixFunction[Cos[#]&, {{5π / 6, 0}, {3π / 2, -π / 2}}]

Out[2]= {{-(Sqrt[3]/2), 0}, {-(9 Sqrt[3]/16), 0}}
```

---

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

```wl
In[1]:= Cos[Interval[{π / 2, π / 3}]]

Out[1]= Interval[{0, (1/2)}]

In[2]:= Cos[CenteredInterval[1, 1 / 100]]

Out[2]= CenteredInterval[{{608295899781413, -50, 578244885, -36}, 30}]

In[3]:= Cos[CenteredInterval[2 + 3I, (1 + I) / 100]]

Out[3]=
CenteredInterval[{{{-2532473334111448523012525, -79, 576155606, -32}, 
   {-5506190395615819376111267, -79, 574028463, -32}}, 30}]
```

Or compute average-case statistical intervals using ``Around``:

```wl
In[4]:= Cos[Around[2, 0.01]]

Out[4]= Around[-0.4161468365471424, 0.009092974268256818]
```

#### Specific Values (5)

Values of ``Cos`` at fixed points:

```wl
In[1]:= Table[Cos[n (π/6)], {n, 0, 6}]

Out[1]= {1, (Sqrt[3]/2), (1/2), 0, -(1/2), -(Sqrt[3]/2), -1}
```

---

Values at infinity:

```wl
In[1]:= Cos[Infinity]

Out[1]= Interval[{-1, 1}]

In[2]:= Cos[ComplexInfinity]

Out[2]= Indeterminate
```

---

Zeros of ``Cos`` :

```wl
In[1]:= Assuming[m∈Integers, Refine[Cos[π ((1/2) + m)]]]

Out[1]= 0
```

---

Extrema of ``Cos`` :

```wl
In[1]:= Assuming[m∈Integers, FullSimplify[Refine[Cos[π m]]]]

Out[1]= (-1)^m
```

Find a minimum of ``Cos`` as the root of $\frac{d \cos (x)}{d x}=0$ in the minimum's neighborhood:

```wl
In[2]:= sol = Solve[D[Cos[x], x] == 0 && 0 < x < 2π, x]

Out[2]= {{x -> π}}
```

Substitute in the result:

```wl
In[3]:= xmin = x /. First[sol]

Out[3]= π
```

Visualize the result:

```wl
In[4]:= Plot[Cos[x], {x, 0, 2π}, Epilog -> Style[Point[{xmin, Cos[xmin]}], PointSize[Large], Red]]

Out[4]= [image]
```

---

Simple exact values are generated automatically:

```wl
In[1]:= Cos[Pi / 5]

Out[1]= (1/4) (1 + Sqrt[5])
```

More complicated cases require explicit use of ``FunctionExpand`` :

```wl
In[2]:= Cos[Pi / 24]

Out[2]= Cos[(π/24)]

In[3]:= FunctionExpand[%]

Out[3]= (1/4) Sqrt[3 (2 - Sqrt[2])] (1 + Sqrt[2]) + (1/4) (-1 + Sqrt[2]) Sqrt[2 + Sqrt[2]]
```

#### Visualization (3)

Plot the ``Cos`` function:

```wl
In[1]:= Plot[Cos[x], {x, -2π, 2π}]

Out[1]= [image]
```

---

Plot the real part of $\cos (z)$ :

```wl
In[1]:= ComplexContourPlot[Re[Cos[z]], {z, -π - I, π + I}, IconizedObject[«PlotOptions»]]

Out[1]= [image]
```

Plot the imaginary part of $\cos (z)$ :

```wl
In[2]:= ComplexContourPlot[Im[Cos[z]], {z, -π - I, π + I}, IconizedObject[«PlotOptions»]]

Out[2]= [image]
```

---

Polar plot with $r=\cos (k \phi )$ :

```wl
In[1]:= Table[PolarPlot[Cos[k ϕ], {ϕ, 0, 2π}, Sequence[Frame -> True, FrameTicks -> {{{-1, -0.5, 0, 0.5, 1}, None}, {{-1, -0.5, 0, 0.5, 1}, None}}, PlotLabel -> "k=" <> ToString[k]]], {k, 1, 8}]

Out[1]= [image]
```

#### Function Properties (13)

``Cos`` is defined for all real and complex values:

```wl
In[1]:= FunctionDomain[Cos[x], x]

Out[1]= True

In[2]:= FunctionDomain[Cos[z], z, Complexes]

Out[2]= True
```

---

``Cos`` achieves all real values between -1 and 1:

```wl
In[1]:= FunctionRange[Cos[x], x, y]

Out[1]= -1 ≤ y ≤ 1
```

The range for complex values is the whole plane:

```wl
In[2]:= FunctionRange[Cos[z], z, y, Complexes]

Out[2]= True
```

---

``Cos`` is a periodic function with a period $2 \pi$ :

```wl
In[1]:= FunctionPeriod[Cos[x], x]

Out[1]= 2 π
```

---

``Cos`` is an even function:

```wl
In[1]:= Cos[-x]

Out[1]= Cos[x]
```

---

``Cos`` has the mirror property $\cos \left(z^*\right)=\cos (z)^*$ :

```wl
In[1]:= FullSimplify[Cos[Conjugate[z]] == Conjugate[Cos[z]]]

Out[1]= True
```

---

``Cos`` is an analytic function of ``x`` :

```wl
In[1]:= FunctionAnalytic[Cos[x], x]

Out[1]= True
```

---

``Cos`` is monotonic in a specific range:

```wl
In[1]:= FunctionMonotonicity[Cos[x], x]

Out[1]= Indeterminate

In[2]:= FunctionMonotonicity[{Cos[x], -π / 2 < x < 0}, x]

Out[2]= 1
```

---

``Cos`` is not injective:

```wl
In[1]:= FunctionInjective[Cos[x], x]

Out[1]= False

In[2]:= Plot[{Cos[x], 1 / 2}, {x, -2π, 2π}]

Out[2]= [image]
```

---

``Cos`` is not surjective:

```wl
In[1]:= FunctionSurjective[Cos[x], x]

Out[1]= False

In[2]:= Plot[{Cos[x], 1.5}, {x, -2π, 2π}]

Out[2]= [image]
```

---

``Cos`` is neither non-negative nor non-positive:

```wl
In[1]:= FunctionSign[Cos[x], x]

Out[1]= Indeterminate
```

---

``Cos`` has no singularities or discontinuities:

```wl
In[1]:= FunctionSingularities[Cos[x], x]

Out[1]= False

In[2]:= FunctionDiscontinuities[Cos[x], x]

Out[2]= False
```

---

``Cos`` is neither convex nor concave:

```wl
In[1]:= FunctionConvexity[Cos[x], x]

Out[1]= Indeterminate
```

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

```wl
In[2]:= FunctionConvexity[{Cos[x], -π / 2 < x < π / 2}, x]

Out[2]= -1

In[3]:= Plot[Cos[x], {x, -π / 2, π / 2}]

Out[3]= [image]
```

---

``TraditionalForm`` formatting:

```wl
In[1]:= Cos[α]//TraditionalForm

Out[1]//TraditionalForm= $$\cos (\alpha )$$
```

#### Differentiation (3)

First derivative:

```wl
In[1]:= D[Cos[x], x]

Out[1]= -Sin[x]
```

---

Higher derivatives:

```wl
In[1]:= Table[D[Cos[x], {x, n}], {n, 1, 4}]

Out[1]= {-Sin[x], -Cos[x], Sin[x], Cos[x]}

In[2]:= Plot[Evaluate[%], {x, -π, π}, PlotLegends -> {"First Derivative", "Second Derivative", "Third Derivative", "Fourth Derivative"}]

Out[2]= [image]
```

---

Formula for the $n$$$^{\text{th}}$$ derivative:

```wl
In[1]:= D[Cos[x], {x, n}]

Out[1]= Cos[(n π/2) + x]
```

#### Integration (3)

Indefinite integral of ``Cos`` :

```wl
In[1]:= Integrate[Cos[x], x]

Out[1]= Sin[x]
```

---

Definite integral of ``Cos`` over a period is 0:

```wl
In[1]:= Integrate[Cos[x], {x, 0, 2 π}]

Out[1]= 0
```

---

More integrals:

```wl
In[1]:= Integrate[Sin[x]Cos[x], x]

Out[1]= -(1/2) Cos[x]^2

In[2]:= Integrate[Cos[x] ^ a, x]

Out[2]= -(Cos[x]^1 + a Hypergeometric2F1[(1/2), (1 + a/2), (3 + a/2), Cos[x]^2] Sin[x]/(1 + a) Sqrt[Sin[x]^2])
```

#### Series Expansions (4)

Find the Taylor expansion using ``Series`` :

```wl
In[1]:= Series[Cos[x], {x, 0, 8}]

Out[1]=
SeriesData[x, 0, {1, 0, Rational[-1, 2], 0, Rational[1, 24], 0, Rational[-1, 720], 0, 
  Rational[1, 40320]}, 0, 9, 1]
```

Plot the first three approximations for ``Cos`` around $x=0$ :

```wl
In[2]:=
terms = Normal@Table[Series[Cos[x], {x, 0, m}], {m, 2, 6, 2}];
Plot[{Cos[x], terms}, {x, -2π, 2π}, PlotRange -> {-1.5, 1.5}]

Out[2]= [image]
```

---

General term in the series expansion of ``Cos`` :

```wl
In[1]:= SeriesCoefficient[Cos[x], {x, 0, n}]

Out[1]= Piecewise[{{(I^n*(1 + (-1)^n))/(2*n!), n >= 0}}, 0]
```

---

Fourier series:

```wl
In[1]:= FourierSeries[Cos[z], z, 1]

Out[1]= (E^-I z/2) + (E^I z/2)
```

---

``Cos`` can be applied to power series:

```wl
In[1]:= Cos[(π/2) + x + (x^2/2) + (x^3/3) + O[x]^4]

Out[1]= SeriesData[x, 0, {-1, Rational[-1, 2], Rational[-1, 6]}, 1, 4, 1]
```

#### Integral Transforms (3)

Compute the Fourier transform using ``FourierTransform`` :

```wl
In[1]:= FourierTransform[Cos[t], t, ω ]

Out[1]= Sqrt[(π/2)] DiracDelta[-1 + ω] + Sqrt[(π/2)] DiracDelta[1 + ω]
```

---

``LaplaceTransform`` :

```wl
In[1]:= LaplaceTransform[Cos[t], t, s ]

Out[1]= (s/1 + s^2)
```

---

``MellinTransform`` :

```wl
In[1]:= MellinTransform[Cos[x], x, s ]

Out[1]= Cos[(π s/2)] Gamma[s]
```

#### Function Identities and Simplifications (6)

``Cos`` of a double angle:

```wl
In[1]:= Expand[Cos[2x] , Trig -> True]

Out[1]= Cos[x]^2 - Sin[x]^2
```

---

``Cos`` of a sum:

```wl
In[1]:= Expand[Cos[x + y] , Trig -> True]

Out[1]= Cos[x] Cos[y] - Sin[x] Sin[y]
```

---

Convert multiple‐angle expressions:

```wl
In[1]:= TrigExpand[Cos[4x]]

Out[1]= Cos[x]^4 - 6 Cos[x]^2 Sin[x]^2 + Sin[x]^4

In[2]:= TrigReduce[%]

Out[2]= Cos[4 x]
```

---

Convert sums of trigonometric functions to products:

```wl
In[1]:= TrigFactor[Cos[x] + Cos[y]]

Out[1]= 2 Cos[(x/2) - (y/2)] Cos[(x/2) + (y/2)]
```

---

Expand assuming real variables $x$ and $y$ :

```wl
In[1]:= ComplexExpand[Cos[x + I y]]

Out[1]= Cos[x] Cosh[y] - I Sin[x] Sinh[y]
```

---

Convert to complex exponentials:

```wl
In[1]:= TrigToExp[Cos[z]]

Out[1]= (E^-I z/2) + (E^I z/2)
```

#### Function Representations (5)

Representation through ``Sin`` :

```wl
In[1]:= Simplify[Sin[(Pi/2) - x]]

Out[1]= Cos[x]
```

---

Representation through Bessel functions:

```wl
In[1]:= Simplify[Sqrt[( π x/2)]BesselJ[-(1/2), x]]

Out[1]= Cos[x]

In[2]:= Simplify[Sqrt[( π I x/2)]BesselI[-(1/2), I x]]

Out[2]= Cos[x]
```

---

Representation through ``SphericalHarmonicY`` :

```wl
In[1]:= Simplify[Sqrt[4 π / 3]SphericalHarmonicY[1, 0, θ, 0]]

Out[1]= Cos[θ]
```

---

Representation in terms of ``MeijerG`` :

```wl
In[1]:= MeijerGReduce[Cos[x], x]

Out[1]= Sqrt[π] Inactive[MeijerG][{{}, {}}, {{0}, {(1/2)}}, (x/2), (1/2)]

In[2]:= Activate[%]

Out[2]= Cos[x]
```

---

``Cos`` can be represented as a ``DifferentialRoot`` :

```wl
In[1]:= DifferentialRootReduce[Cos[x], x]

Out[1]=
DifferentialRoot[Function[{\[FormalY], \[FormalX]}, {\[FormalY][\[FormalX]] + Derivative[2][\[FormalY]][\[FormalX]] == 0, \[FormalY][0] == 1, 
   Derivative[1][\[FormalY]][0] == 0}]][x]
```

### Applications (14)

Draw a circle:

```wl
In[1]:= ParametricPlot[{Cos[t], Sin[t]}, {t, 0, 2Pi}]

Out[1]= [image]
```

---

Lissajous figure:

```wl
In[1]:= ParametricPlot[{Cos[2t], Cos[5t]}, {t, 0, 2Pi}]

Out[1]= [image]
```

---

Equiangular (logarithmic) spiral:

```wl
In[1]:= ParametricPlot[Exp[t / 10]{Cos[t], Sin[t]}, {t, 0, 10Pi}, PlotRange -> All]

Out[1]= [image]
```

---

Circular motion:

```wl
In[1]:= Animate[Graphics[Line[{{0, 0}, {Cos[t], Sin[t]}}], PlotRange -> 1.2], {t, 0, 10Pi}]

Out[1]= DynamicModule[«8»]
```

---

Solve an equation for harmonic motion:

```wl
In[1]:= DSolve[x''[t] + ω^2x[t] == 0, x[t], t]

Out[1]= {{x[t] -> C[1] Cos[t ω] + C[2] Sin[t ω]}}
```

---

Rotation matrix:

```wl
In[1]:= RotationMatrix[θ]

Out[1]= {{Cos[θ], -Sin[θ]}, {Sin[θ], Cos[θ]}}
```

Apply to a horizontally aligned vector:

```wl
In[2]:= %.{1, 0}

Out[2]= {Cos[θ], Sin[θ]}
```

---

Plot a sphere:

```wl
In[1]:= ParametricPlot3D[{Cos[ϕ] Sin[θ], Sin[θ] Sin[ϕ], Cos[θ]}, {ϕ, -π, π}, {θ, 0, π}]

Out[1]= [image]
```

---

Plot a torus:

```wl
In[1]:= ParametricPlot3D[{Cos[ϕ] + 1 / 2 Cos[θ] Cos[ϕ], Sin[ϕ] + 1 / 2 Cos[θ] Sin[ϕ], Sin[θ] / 2}, {ϕ, -π, π}, {θ, 0, 2 π}]

Out[1]= [image]
```

---

2D waves:

```wl
In[1]:= Plot3D[Cos[x]Cos[y], {x, 0, 10Pi}, {y, 0, 10Pi}]

Out[1]= [image]
```

---

Triple‐periodic surface:

```wl
In[1]:=
ContourPlot3D[Cos[x] + Cos[y] + Cos[z], {x, -2Pi, 2Pi}, {y, -2Pi, 2Pi}, {z, -2Pi, 2Pi}, Contours -> {0}, Mesh -> False, BoundaryStyle -> None, 
	ContourStyle -> {Opacity[0.8]}]

Out[1]= [image]
```

---

Approximate the almost nowhere differentiable Riemann–Weierstrass function:

```wl
In[1]:= Plot[Sum[N[Cos[j ^ 2 x] / j ^ 2], {j, 12}], {x, 0, 2Pi}]

Out[1]= [image]
```

---

A triangle with two equal angles is an isosceles triangle:

```wl
In[1]:= IsoscelesTriangle[α_, s_] := AASTriangle[α, α, s]

In[2]:= t = IsoscelesTriangle[5π / 13, 1]

Out[2]= Triangle[{{0, 0}, {Sec[(3 π/26)] Sin[(3 π/13)], 0}, {Sin[(3 π/26)], Cos[(3 π/26)]}}]
```

Visualize it:

```wl
In[3]:= Graphics[t]

Out[3]= [image]
```

Find the area:

```wl
In[4]:= FullSimplify[Area@IsoscelesTriangle[α, s], s > 0 && 0 < α < π]

Out[4]= s^2 Abs[Cos[α]] Sin[α]
```

---

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

```wl
In[1]:= Series[AiryBi[z]  - I AiryAi[z], {z, -∞, 2}]

Out[1]= Cos[(π/4) + (2 Sqrt[-z] z/3)] (SeriesData[z, -Infinity, {(-(-1)^(Rational[1, 4]))*1/Sqrt[Pi]}, 1, 9, 4]) + Cos[(π/4) + (2 Sqrt[-z] z/3)] (SeriesData[z, -Infinity, {(Rational[5, 48]*(-1)^(Rational[1, 4]))*1/Sqrt[Pi]}, 7, 9, 4]) + (SeriesData[z, -Infinity, {(-(-1)^(Rational[3, 4]))*1/Sqrt[Pi]}, 1, 9, 4]) Sin[(π/4) + (2 Sqrt[-z] z/3)] + (SeriesData[z, -Infinity, {(Rational[5, 48]*(-1)^(Rational[3, 4]))*1/Sqrt[Pi]}, 7, 9, 4]) Sin[(π/4) + (2 Sqrt[-z] z/3)]
```

There is only an outgoing plane wave:

```wl
In[2]:= Simplify[Normal[%]//TrigToExp]

Out[2]= (I E^(2/3) I Sqrt[-z] z (5 Sqrt[(1/z)] - 48 z) ((1/z))^5 / 4/48 Sqrt[π])
```

---

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

```wl
In[1]:= ContourPlot[x ^ 2 + y ^ 2 == 1, {x, -1.5, 1.5}, {y, -1.5, 1.5}, Epilog -> Style[Point[{Cos[π / 4], Sin[π / 4]}], PointSize[Large], Red], Axes -> True, Frame -> False, AxesLabel -> {x, y}]

Out[1]= [image]
```

### Properties & Relations (12)

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

```wl
In[1]:= Cos[x + 2Pi]

Out[1]= Cos[x]

In[2]:= {Cos[-x], Cos[I x]}

Out[2]= {Cos[x], Cosh[x]}

In[3]:= 1 / Cos[x]

Out[3]= Sec[x]
```

---

Complicated expressions containing trigonometric functions do not simplify automatically:

```wl
In[1]:= Cos[3z]^2 - (Cos[z]^3 - 3 Cos[z] Sin[z]^2)^2

Out[1]= Cos[3 z]^2 - (Cos[z]^3 - 3 Cos[z] Sin[z]^2)^2

In[2]:= Simplify[%]

Out[2]= 0

In[3]:= Cos[(x + y/2)]Cos[(x - y/2)] + ((1/2) Cos[(x/2)]^2 + (1/2) Cos[(y/2)]^2 - (1/2) Sin[(x/2)]^2 - (1/2) Sin[(y/2)]^2)

Out[3]= (1/2) Cos[(x/2)]^2 + (1/2) Cos[(y/2)]^2 + Cos[(x - y/2)] Cos[(x + y/2)] - (1/2) Sin[(x/2)]^2 - (1/2) Sin[(y/2)]^2

In[4]:= Simplify[%]

Out[4]= Cos[x] + Cos[y]
```

---

Compose with inverse functions:

```wl
In[1]:= {Cos[ArcCos[z]], Cos[2ArcCos[z]], Cos[3ArcCos[z]]}

Out[1]= {z, Cos[2 ArcCos[z]], Cos[3 ArcCos[z]]}

In[2]:= FunctionExpand[%]

Out[2]= {z, -1 + 2 z^2, -3 z + 4 z^3}
```

---

1 radian is $\frac{180}{\pi }$ degrees:

```wl
In[1]:= Cos[1] == CosDegrees[180 / π]//Simplify

Out[1]= True
```

---

Solve a trigonometric equation:

```wl
In[1]:= Reduce[Cos[z]^2 + 3 Cos[z + Pi / 6] == 4, z]

Out[1]= C[1]∈ℤ && (z == 2 ArcTan[Root[{-3 + #1^2 & , 6 - 3*#1 + 6*#2 + 20*#2^2 + 6*#2^3 + 6*#2^4 + (3*#1)*#2^4 & }, {2, 1}]] + 2 π C[1] || z == 2 ArcTan[Root[{-3 + #1^2 & , 6 - 3*#1 + 6*#2 + 20*#2^2 + 6*#2^3 + 6*#2^4 + (3*#1)*#2^4 & }, {2, 2}]] + 2 π C[1] || z == 2 ArcTan[Root[{-3 + #1^2 & , 6 - 3*#1 + 6*#2 + 20*#2^2 + 6*#2^3 + 6*#2^4 + (3*#1)*#2^4 & }, {2, 3}]] + 2 π C[1] || z == 2 ArcTan[Root[{-3 + #1^2 & , 6 - 3*#1 + 6*#2 + 20*#2^2 + 6*#2^3 + 6*#2^4 + (3*#1)*#2^4 & }, {2, 4}]] + 2 π C[1])
```

---

Numerically find a root of a transcendental equation:

```wl
In[1]:= FindRoot[Cos[z]^2 + 3 Cos[z + Pi / 6] + z == 4, {z, 4}]

Out[1]= {z -> 4.0456}
```

---

Reduce a trigonometric equation:

```wl
In[1]:= Reduce[Cos[α x + β] == 0, x]

Out[1]= C[1]∈ℤ && ((α == 0 && (β == -(π/2) + 2 π C[1] || β == (π/2) + 2 π C[1])) || (α ≠ 0 && (x == (-(π/2) - β + 2 π C[1]/α) || x == ((π/2) - β + 2 π C[1]/α))))
```

---

Integrals:

```wl
In[1]:= ∫Cos[z]^a\[DifferentialD]z

Out[1]= -(Cos[z]^1 + a Hypergeometric2F1[(1 + a/2), (1/2), (3 + a/2), Cos[z]^2] Sin[z]/(1 + a) Sqrt[Sin[z]^2])
```

---

``Cos`` appears in special cases of many mathematical functions:

```wl
In[1]:= {BesselJ[-(1/2), z], MathieuC[1, 0, z], JacobiCD[z, 0], Hypergeometric0F1[(1/2), -z], MeijerG[{{}, {}}, {{0}, {(1/2)}}, z]}

Out[1]= {(Sqrt[(2/π)] Cos[z]/Sqrt[z]), Cos[z], Cos[z], Cos[2 Sqrt[z]], (Cos[2 Sqrt[z]]/Sqrt[π])}
```

---

``Cos`` is a numeric function:

```wl
In[1]:= Attributes[Cos]

Out[1]= {Listable, NumericFunction, Protected}

In[2]:= NumericQ[Cos[2 + E]]

Out[2]= True
```

---

The generating function for ``Cos`` :

```wl
In[1]:= GeneratingFunction[Cos[n], n, x]

Out[1]= (1 - x Cos[1]/1 + x^2 - 2 x Cos[1])

In[2]:= Series[%, {x, 0, 5}]//FullSimplify

Out[2]= SeriesData[x, 0, {1, Cos[1], Cos[2], Cos[3], Cos[4], Cos[5]}, 0, 6, 1]
```

---

The exponential generating function for ``Cos`` :

```wl
In[1]:= ExponentialGeneratingFunction[Cos[n], n, x]

Out[1]= Cos[x Sin[1]] (Cosh[x Cos[1]] + Sinh[x Cos[1]])
```

### Possible Issues (5)

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

```wl
In[1]:= Cos[10. ^ 45]

Out[1]= -0.99743
```

With exact input, the answer is correct:

```wl
In[2]:= N[Cos[10 ^ 45], 20]

Out[2]= -0.059927972406049978206
```

---

A larger setting for ``\$MaxExtraPrecision`` can be needed:

```wl
In[1]:= N[Cos[10 ^ 100], 20]
```

N::meprec: Internal precision limit \$MaxExtraPrecision = 50.\` reached while evaluating Cos[10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000].

```wl
Out[1]= 0``0

In[2]:= Block[{$MaxExtraPrecision = 200}, N[Cos[10 ^ 100], 20]]

Out[2]= -0.92808190507465534346
```

---

Machine-number inputs can give high‐precision results:

```wl
In[1]:= Cos[10. ^ 3I]

Out[1]= 9.8503555700852349694443967612`15.954589770191005*^433 + 0. I

In[2]:= MachineNumberQ[%]

Out[2]= False
```

---

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

```wl
In[1]:= Integrate[(1/2 + Cos[x]), x]

Out[1]= (2 ArcTan[(Tan[(x/2)]/Sqrt[3])]/Sqrt[3])

In[2]:= Plot[%, {x, 0, 2Pi}]

Out[2]= [image]
```

---

In ``TraditionalForm``, parentheses are needed around the argument:

```wl
In[1]:= $$\cos  x$$

Out[1]= cos x

In[2]:= $$\cos (x)$$

Out[2]= Cos[x]
```

### Neat Examples (5)

Noncommensurate waves (quasiperiodic function):

```wl
In[1]:= Plot[Cos[x] + Cos[Sqrt[2]x], {x, 0, 40Pi}]

Out[1]= [image]
```

---

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

```wl
In[1]:= Cos[(π/2^12)]//FunctionExpand

Out[1]= (1/2) Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2 + Sqrt[2]]]]]]]]]]]
```

---

Indefinite integral of $\cos \left(x^n\right)$ :

```wl
In[1]:= Table[Integrate[Cos[x ^ n], x], {n, 3}]

Out[1]= {Sin[x], Sqrt[(π/2)] FresnelC[Sqrt[(2/π)] x], -(x ((I x^3)^1 / 3 Gamma[(1/3), -I x^3] + (-I x^3)^1 / 3 Gamma[(1/3), I x^3])/6 (x^6)^1 / 3)}
```

---

Chladni figure:

```wl
In[1]:= DensityPlot[Cos[4x]Cos[3y] + 1 / 2Cos[3x]Cos[4y], {x, 0, 2Pi}, {y, 0, 2Pi}]

Out[1]= [image]
```

---

Plot ``Cos`` at integer points:

```wl
In[1]:= ArrayPlot[Table[Cos[x y], {x, -20, 20}, {y, -20, 20}]]

Out[1]= [image]
```

## See Also

* [`AngleVector`](https://reference.wolfram.com/language/ref/AngleVector.en.md)
* [`ArcCos`](https://reference.wolfram.com/language/ref/ArcCos.en.md)
* [`Sec`](https://reference.wolfram.com/language/ref/Sec.en.md)
* [`Sin`](https://reference.wolfram.com/language/ref/Sin.en.md)
* [`CosDegrees`](https://reference.wolfram.com/language/ref/CosDegrees.en.md)
* [`Degree`](https://reference.wolfram.com/language/ref/Degree.en.md)
* [`FromDMS`](https://reference.wolfram.com/language/ref/FromDMS.en.md)
* [`TrigToExp`](https://reference.wolfram.com/language/ref/TrigToExp.en.md)
* [`TrigExpand`](https://reference.wolfram.com/language/ref/TrigExpand.en.md)
* [`CirclePoints`](https://reference.wolfram.com/language/ref/CirclePoints.en.md)

## Tech Notes

* [Some Mathematical Functions](https://reference.wolfram.com/language/tutorial/SomeMathematicalFunctions.en.md)
* [Elementary Transcendental Functions](https://reference.wolfram.com/language/tutorial/MathematicalFunctions.en.md#10797)

## Related Guides

* [Trigonometric Functions](https://reference.wolfram.com/language/guide/TrigonometricFunctions.en.md)
* [GPU Computing](https://reference.wolfram.com/language/guide/GPUComputing.en.md)
* [Precollege Education](https://reference.wolfram.com/language/guide/PrecollegeEducation.en.md)
* [GPU Computing with NVIDIA](https://reference.wolfram.com/language/guide/GPUComputing-NVIDIA.en.md)
* [GPU Computing with Apple](https://reference.wolfram.com/language/guide/GPUComputing-Apple.en.md)
* [Mathematical Functions](https://reference.wolfram.com/language/guide/MathematicalFunctions.en.md)
* [Elementary Functions](https://reference.wolfram.com/language/guide/ElementaryFunctions.en.md)
* [Functions for Separable Coordinate Systems](https://reference.wolfram.com/language/guide/FunctionsForSeparableCoordinateSystems.en.md)

## Related Links

* [MathWorld](http://mathworld.wolfram.com/Cosine.html)
* [An Elementary Introduction to the Wolfram Language: More about Numbers](https://www.wolfram.com/language/elementary-introduction/23-more-about-numbers.html)
* [NKS\|Online](http://www.wolframscience.com/nks/search/?q=Cos)
* [A New Kind of Science](http://www.wolframscience.com/nks/)

## History

* Introduced in 1988 (1.0) \| Updated in 1999 (4.0) ▪ [2014 (10.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn100.en.md) ▪ [2015 (10.1)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn101.en.md) ▪ [2021 (13.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn130.en.md)