Integral of x sin x
The integral of x sin x is sin x − x cos x + C. Choose u = x, because differentiating it removes the x.
How to integrate x sin x
Method: integration by parts.
- 1Choose u = x and dv = sin x dx.
- 2Then du = dx and v = −cos x.
- 3Integration by parts gives −x cos x − ∫(−cos x) dx.
- 4That is −x cos x + ∫cos x dx = −x cos x + sin x.
- 5So the result is sin x − x cos x + C.
What it means
x sin x oscillates with growing size. Its integral does too, and the x cos x term grows with x.
The integral from 0 to π
Using the antiderivative: F(π) − F(0) = π, which is about π. A direct numerical integration of x sin x gives π, which agrees.
Check by differentiating
The derivative of the answer should give back the original function. The last column measures that slope directly from the answer, and it matches.
| x | x sin x | Slope of the answer |
|---|---|---|
| −π | 0 | −0 |
| −π/2 | π/2 | π/2 |
| 0 | 0 | 0 |
| π/2 | π/2 | π/2 |
| π | 0 | −0 |
Common mistakes
- Choosing u = sin x and dv = x dx, which leaves a harder integral.
- A sign error with −cos x. Writing each step out helps.
Frequently asked questions
What is the integral of x sin x?
What is the integral of x sin x from 0 to π?
Keep going
It is sin x + x cos x.
Oscillations that grow, trapped between y = ±x.
It is x ln x − x + C.
It is (x ln x − x)/ln 10 + C.
It is 2x ln|x| − 2x + C.
Every standard integral and technique, with examples.
Type your own function into the integral calculator for the steps, the answer and a graph.