Skip to main content
Graphing Calculator

Function library

Cosine Function

f(x) = cos(x)

The even, wave-shaped sibling of sine — cosine starts at its peak and repeats every 2π.

Cosine is the horizontal counterpart of sine: on the unit circle it gives the x-coordinate of the point at angle x, while sine gives the y-coordinate. That single difference shapes everything about its graph — it starts at its maximum value of 1 when x = 0, dips to −1 at x = π, and returns to 1 at x = 2π, tracing the same smooth wave as sine but shifted a quarter-turn sideways. Like sine, it oscillates forever between −1 and 1 and repeats every 2π radians.

Cosine shows up wherever something projects onto a horizontal axis or starts from a maximum: the shadow of a rotating wheel, the voltage in an AC circuit measured from its peak, or the x-coordinate of uniform circular motion. Because cos(x) = sin(x + π/2), anything you can say about sine waves applies to cosine waves with a phase shift — type cos(x) into the calculator and drag the viewport to watch it repeat.

Computed properties

Calculated by the graphing calculator's own math engine at build time for cos(x).

Roots in [−10, 10]
-7.8540, -4.7124, -1.5708, 1.5708, 4.7124, 7.8540
y-intercept f(0)
1.0000
Local extrema in [−10, 10]
  • local minimum at (-9.4248, -1.0000)
  • local maximum at (-6.2832, 1.0000)
  • local minimum at (-3.1416, -1.0000)
  • local maximum at (0.0000, 1.0000)
  • local minimum at (3.1416, -1.0000)
  • local maximum at (6.2832, 1.0000)
  • …and 1 more
Sample values
f(-2) = -0.4161 · f(-1) = 0.5403 · f(0) = 1 · f(1) = 0.5403 · f(2) = -0.4161
Derivative f′(1)
-0.8415
Integral ∫₀¹ f(x) dx
0.8415

Key facts

  • Domain: all real numbers; range: −1 ≤ cos(x) ≤ 1.
  • Period 2π: cos(x + 2π) = cos(x) for every x.
  • Even function: cos(−x) = cos(x); the graph is symmetric about the y-axis.
  • Zeros at x = π/2 + nπ; maxima of 1 at x = 2πn; minima of −1 at x = π + 2πn.
  • y-intercept at (0, 1); derivative is −sin(x); an antiderivative is sin(x).

What cosine is

Imagine a point traveling counterclockwise around the unit circle, starting at (1, 0). At angle x its position is (cos x, sin x): cosine tracks how far right or left the point is. At x = 0 the point is at the far right, so cos(0) = 1 — the y-intercept of the graph. As the angle grows the point swings left, and cosine falls smoothly through 0 at x = π/2 to −1 at x = π, the far left of the circle.

Cosine is an even function, cos(−x) = cos(x), so its graph is a mirror image across the y-axis: the left side exactly reflects the right. It crosses zero at x = π/2 + nπ, halfway between each peak and trough, and its maxima of 1 occur at x = 2πn while minima of −1 occur at x = π + 2πn. The familiar wave shape comes from the same circular geometry as sine, viewed from the side.

Cosine, sine, and phase shifts

The identity cos(x) = sin(x + π/2) says the two functions are one wave seen from two starting points: cosine is what sine looks like a quarter-period earlier. This matters when modeling real oscillations, because the choice between sine and cosine is just a choice of when you start your clock — a spring released from rest at maximum stretch follows a cosine in time, while one pushed through equilibrium follows a sine.

Phase shifts also explain sums like sin(x) + cos(x): combining two waves of the same frequency always produces another wave of that frequency, here √2·sin(x + π/4), a fact that falls out of the angle-addition formulas. In the calculator, plot sin(x) and cos(x) together and add a third expression sin(x) + cos(x) to see the sum remain a perfect wave.

Where cosine appears

In physics, cosine describes any oscillation measured from its extreme: simple harmonic motion x(t) = A·cos(ωt) for a mass released from rest, the real part of the complex exponential e^(iθ) = cos θ + i·sin θ that underpins AC circuit analysis and quantum wavefunctions, and the even basis functions of Fourier series. When engineers write a periodic signal as a sum of cosines, each term captures the symmetric part of the wave.

Cosine also appears far from waves. The dot product of two vectors is |a||b|cos θ, where θ is the angle between them, so cosine measures alignment: 1 for parallel, 0 for perpendicular, −1 for opposite. The law of cosines, c² = a² + b² − 2ab·cos(C), generalizes Pythagoras to any triangle.

Frequently asked questions

Is cosine just a shifted sine?

Exactly — cos(x) = sin(x + π/2), so the cosine graph is the sine graph moved left by a quarter period. They share the same amplitude, period, and range; only the starting point differs. On the unit circle they are the x- and y-coordinates of the same rotating point.

Why is cos(0) = 1?

At angle 0 the rotating point on the unit circle sits at (1, 0), the far right of the circle, so its x-coordinate — the cosine — is 1 and its y-coordinate — the sine — is 0. That is also why the cosine graph begins at its peak.

What does cosine have to do with the dot product?

The dot product formula a·b = |a||b|cos θ uses cosine of the angle between the vectors to measure how much they point in the same direction. Cosine is 1 when they are parallel, 0 when perpendicular, and −1 when opposite — so it acts as an alignment score between −1 and 1.

Related pages