DerivCalc
Written by SilverCodeLabs · Mathematically reviewed · Revised September 17, 2026 · How answers are verified

Derivative of x·sin(x)

x·sin(x) is the classic first product-rule problem: two variable factors multiplied, so the product rule is the direct approach.

Answer
d/dx [x·sin(x)]  =  sin(x) + x cos(x)
Rule used: Product rule
Open x·sin(x) in the calculator →

Step-by-step solution

1
Recognize a true product

Both factors depend on x: u = x and v = sin(x). Neither is a constant, so apply the product rule.

2
Apply the product rule

(uv)′ = u′v + uv′: differentiate one factor at a time, keeping the other frozen, then add.

3
Substitute and combine

u′ = 1 and v′ = cos(x), so f′(x) = 1·sin(x) + x·cos(x) = sin(x) + x cos(x).

Why it works

The two-term answer reflects two separate ways the product can change: the x factor growing while the wave holds still (contributing sin(x)), and the wave moving while x holds still (contributing x·cos(x)). The product rule is exactly this accounting — total change equals the sum of each factor's contribution with the other momentarily frozen.

The graph of x·sin(x) is a sine wave inside an ever-widening envelope of ±x, and the derivative explains its behavior: for large |x| the x·cos(x) term controls the growing slope envelope, so the oscillations get steeper and steeper while the original function is zero at every multiple of π. It's the standard example of oscillation with growing amplitude.

Domain and slopes at the zeros

The product x sin(x) is differentiable for all real x, with the sine argument in radians. At x = kπ, where k is an integer, the function is zero but its derivative is kπ(−1)ᵏ. Thus the nonzero multiples of π are not stationary points merely because the function crosses zero there.

At x = π the slope is −π and the tangent line is y = −π(x − π). At x = 0 both the function and derivative are zero. The product rule produces two terms because both factors change; it does not multiply their derivatives together.

Common mistakes

Practice problems

Differentiate x·cos(x)

Answer: cos(x) − x sin(x).

Differentiate x² sin(x)

Answer: 2x sin(x) + x² cos(x).

Differentiate x ex

Answer: ex(1 + x).

Related derivatives

sin(x)x²sin(2x)e^x