Skip to content
ihateDesmos

Derivative of x cot x

Updated 6 November 2026 · Checked numerically by the ihateDesmos engine
The derivative of x cot x
ddx(xcot(x))=cot(x)−xcsc(x)2

The derivative of x cot x is cot x − x csc²x. It is a direct use of the product rule, with the derivative of cot x being −csc²x.

0.51.01.52.02.5−10−5
Open in calculator
y=xcot(x)
in blue and its derivative
y=cot(x)−xcsc(x)2
in red. Defined for x ≠ nπ.

How to find the derivative of x cot x

Method: product rule.

  1. 1
    Use the product rule, with f = x and g = cot x.
  2. 2
    f′ = 1 and g′ = −csc²x.
  3. 3
    So the derivative is 1 · cot x + x · (−csc²x).
  4. 4
    That is cot x − x csc²x.

What it means on the graph

x cot x approaches 1 as x approaches 0, even though cot x itself blows up there. The function falls on each branch from x = 0 up to the asymptote at π.

Table of values

The derivative column uses the formula. The last column estimates the slope directly from the original function, as an independent check.

Values of x cot x and its derivative
xx cot xcot x − x csc²xSlope, measured
1/20.915244−0.344855−0.344855
10.642093−0.77019−0.77019
π/20−π/2−π/2
2−0.915315−2.87656−2.87656
5/2−3.34662−8.3186−8.3186

Common mistakes

  • Dropping the minus sign in the derivative of cot x.

Frequently asked questions

What is the derivative of x cot x?
The derivative of x cot x is cot x − x csc²x, for x ≠ nπ.

Keep going

Differentiate any function

Type your own function into the derivative calculator and see every rule applied, step by step.

Open the derivative calculator