Derivative of $x\,\cot\left(x\right)$

Differentiated with respect to x. Edit the function · Differentiation rules

Step-by-step solution

Input function
$$x\,\cot\left(x\right)$$

Start of the differentiation
$$\frac{d}{dx}{\left[x\,\cot\left(x\right)\right]}$$

Yellow: the expression being replaced. Green: its replacement.

Step 1 — Product Rule Differentiation rule
📖 Rule
$$\frac{d}{dx}(u \cdot v)=u'v+uv'$$
With:
  • $u = x$
  • $v = \cot\left(x\right)$

Why: First, differentiate the first factor and multiply by the unchanged second factor. Add the unchanged first factor times the derivative of the second. Do not simply multiply the two derivatives.

🧮 Current expression
$$\bbox[#fff1b8, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,\frac{d}{dx}{\left[x\,\cot\left(x\right)\right]}\,}}}$$
✨ After: Product Rule
$$\bbox[#d6f5df, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,\frac{d}{dx}{\left[x\right]}\,\cot\left(x\right) + x\,\frac{d}{dx}{\left[\cot\left(x\right)\right]}\,}}}$$
Step 2 — Derivative of a Variable Differentiation rule
📖 Rule
$$\frac{d}{dx}(x)=1$$

Why: When x increases by one, the value of this term also increases by one. Its derivative is therefore one.

Changed part: $\frac{d}{dx}{\left[x\right]} \;\Longrightarrow\; 1$
🧮 Current expression
$$\bbox[#fff1b8, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,\frac{d}{dx}{\left[x\right]}\,}}}\,\cot\left(x\right) + x\,\frac{d}{dx}{\left[\cot\left(x\right)\right]}$$
✨ After: Derivative of a Variable
$$\bbox[#d6f5df, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,1\,}}}\,\cot\left(x\right) + x\,\frac{d}{dx}{\left[\cot\left(x\right)\right]}$$
Step 3 — Remove a factor of one Simplification
📖 Rule
$$1\cdot a=a,\quad \frac{a}{1}=a$$

Why: Multiplication or division by one leaves the value unchanged.

Changed part: $1\,\cot\left(x\right) \;\Longrightarrow\; \cot\left(x\right)$
🧮 Current expression
$$\bbox[#fff1b8, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,1\,\cot\left(x\right)\,}}} + x\,\frac{d}{dx}{\left[\cot\left(x\right)\right]}$$
✨ After: Remove a factor of one
$$\bbox[#d6f5df, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,\cot\left(x\right)\,}}} + x\,\frac{d}{dx}{\left[\cot\left(x\right)\right]}$$
Step 4 — Derivative of the cotangent Differentiation rule
📖 Rule
$$\frac{d}{dx}\cot\left(x\right)=-\frac{1}{\sin\left(x\right)^{2}}$$

Why: The argument is exactly x. Apply the known elementary derivative.

Changed part: $\frac{d}{dx}{\left[\cot\left(x\right)\right]} \;\Longrightarrow\; -\frac{1}{\sin\left(x\right)^{2}}$
🧮 Current expression
$$\cot\left(x\right) + x\,\bbox[#fff1b8, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,\frac{d}{dx}{\left[\cot\left(x\right)\right]}\,}}}$$
✨ After: Derivative of the cotangent
$$\cot\left(x\right) + x\,\bbox[#d6f5df, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,\left(-\frac{1}{\sin\left(x\right)^{2}}\right)\,}}}$$
Step 5 — Determine the sign of the product Simplification
📖 Rule
$$a\cdot(-b)=-(a\cdot b),\quad (-a)\cdot(-b)=a\cdot b$$

Why: Move the minus signs of the factors in front of the product. An even number of minus signs gives plus, an odd number gives minus.

Changed part: $x\,\left(-\frac{1}{\sin\left(x\right)^{2}}\right) \;\Longrightarrow\; -x \cdot \frac{1}{\sin\left(x\right)^{2}}$
🧮 Current expression
$$\cot\left(x\right) + \bbox[#fff1b8, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,x\,\left(-\frac{1}{\sin\left(x\right)^{2}}\right)\,}}}$$
✨ After: Determine the sign of the product
$$\cot\left(x\right) + \bbox[#d6f5df, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,\left(-x \cdot \frac{1}{\sin\left(x\right)^{2}}\right)\,}}}$$
Step 6 — Combine into one fraction Simplification
📖 Rule
$$a\cdot\frac{b}{c}=\frac{a\cdot b}{c}$$

Why: A factor in front of a fraction multiplies its numerator, giving a single fraction.

Changed part: $-x \cdot \frac{1}{\sin\left(x\right)^{2}} \;\Longrightarrow\; -\frac{x}{\sin\left(x\right)^{2}}$
🧮 Current expression
$$\cot\left(x\right) + \bbox[#fff1b8, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,\left(-x \cdot \frac{1}{\sin\left(x\right)^{2}}\right)\,}}}$$
✨ After: Combine into one fraction
$$\cot\left(x\right) + \bbox[#d6f5df, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,\left(-\frac{x}{\sin\left(x\right)^{2}}\right)\,}}}$$
Step 7 — Combine plus and minus Simplification
📖 Rule
$$a+(-b)=a-b$$

Why: Adding a negative expression is the same as subtracting the positive expression.

🧮 Current expression
$$\bbox[#fff1b8, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,\cot\left(x\right) + \left(-\frac{x}{\sin\left(x\right)^{2}}\right)\,}}}$$
✨ After: Combine plus and minus
$$\bbox[#d6f5df, padding:0.15em]{{\color{black}{\vphantom{\dfrac{d}{dx}}\,\cot\left(x\right) - \frac{x}{\sin\left(x\right)^{2}}\,}}}$$
Final result
$$\cot\left(x\right) - \frac{x}{\sin\left(x\right)^{2}}$$
Valid where:
  • $\sin\left(x\right)\ne0$ – The function and its derivative are undefined at poles.

The derivative is only valid where the original function is defined.

Copy link to this solution
Cross-check with a computer algebra system

The derivative computed directly by the computer algebra system Maxima:

$$\cot\left(x\right) - x\,\csc\left(x\right)^{2}$$

Step-by-step result ↔ Maxima: identical ✓