Skip to content
ihateDesmos

Graph of x cos x

Updated 20 October 2026 · Values computed by the ihateDesmos engine

The graph of y = x cos x is an oscillation whose amplitude grows with distance from the origin, trapped between the lines y = x and y = −x. Unlike x sin x, it is odd, so it passes through the origin with slope 1.

−10−5510−550
Open in calculator
The graph of
y=xcos(x)
for −15 ≤ x ≤ 15. Dots mark its roots, turning points and y-intercept.

Key features

Domain
All real numbers
Range
All real numbers
Zeros
x = 0 and x = π/2 + nπ
Envelope
−|x| ≤ y ≤ |x|
Symmetry
Odd
Slope at the origin
1
y-intercept
None
Derivative
cos(x)−xsin(x)
Antiderivative
xsin(x)+cos(x)+C

Derivative and antiderivative from the calculator’s algebra system. Domain, range and asymptotes are stated for real x.

What the graph of x cos x looks like

cos x is even and x is odd, so x cos x is odd: the graph has rotational symmetry about the origin. It starts out like y = x, since cos x ≈ 1 near 0.

It touches the upper envelope y = x where cos x = 1 (x = 2nπ) and the lower one where cos x = −1, with zeros halfway between.

The area under x cos x has the closed form x sin x + cos x, found by integration by parts.

Points of interest

Found numerically to about twelve digits in the window −15 ≤ x ≤ 15, then shown in exact form where one exists.

x-intercepts (roots)
x = −14.1372, x = −10.9956, x = −7.854, x = −4.7124, x = −1.5708, x = 0 … (11 in view)
Local maxima
(−3.4256, 3.2884), (0.8603, 0.5611), (6.4373, 6.361)
Local minima
(−6.4373, −6.361), (−0.8603, −0.5611), (3.4256, −3.2884)
Inflection points
(−14.2764, 1.98066), (−11.1727, −1.96871), (−8.09616, 1.94163), (−5.08699, −1.86131), (−2.28893, 1.50607), (0, 0) … (11 in view)

Table of values

A few points to plot, with exact values where they are simple.

Values of x cos x
xy = x cos x
00
π/20
π−π
3π/20
2π2π
5π/20
3π−3π

How to graph x cos x by hand

  1. 1
    Draw the envelope lines y = ±x.
  2. 2
    Mark the zeros at 0 and odd multiples of π/2.
  3. 3
    Draw waves touching y = x at 2π, 4π, … and y = −x at π, 3π, …
  4. 4
    Rotate the right half about the origin to get the left half.

Transformations

How the graph moves when you change the formula. The original is x cos x in blue.

−10−5510−10100
  • y = x The upper envelope.
  • y = -x The lower envelope.
  • y = x sin(x) The even counterpart.

Frequently asked questions

Is x cos x odd or even?
Odd: x is odd and cos x is even, and their product is odd.
What is the integral of x cos x?
x sin x + cos x + C, by integration by parts.

Related graphs

Graph x cos x your way

Change the window, add sliders for a, b, h and k, trace the curve with your keyboard, or overlay its derivative.

Open in the calculator