What is the integral of x sin(x) dx?

Find the following integral: ∫ x sin(x) dx

This question is a good candidate for the integration by parts method, as it is the product of two different 'parts'.

Recall that if you have an integral of the form

∫ u(dv/dx) dx

it can be written as

uv – ∫ v(du/dx) dx.

We need to decide which part we will differentiate (as in, which part is u), and which part we will integrate (as in, which part is dv/dx). 

We can note that continuously differentiating sin(x) results in a loop of cos(x), –sin(x), –cos(x), sin(x)..., whereas differentiating x once gives 1.

From this, it seems to make sense that we would want to differentiate the x part (so u is x) and therefore integrate the sin(x) part (so dv/dx is sin(x) ). So, let

u = x, which implies du/dx = 1

and let

dv/dx = sin(x). Integrating this to get v gives v = –cos(x).

So our integral is now of the form required for integration by parts.

∫ x sin(x) dx 

=  ∫ u(dv/dx) dx

= uv –  ∫ v(du/dx) dx

= –x cos(x) –  ∫ –cos(x)*1 dx

= –x cos(x) –  ∫ –cos(x) dx

= –x cos(x) +  ∫ cos(x) dx

The integral of cos(x) is equal to sin(x). We can check this by differentiating sin(x), which does indeed give cos(x). Finally, as with all integration without limits, there must be a constant added, which I'll call c. So the final answer is 

∫ x sin(x) dx = –x cos(x) +  sin(x) + c

Shaun F. GCSE Maths tutor, A Level Maths tutor

1 year ago

Answered by Shaun, an A Level Maths tutor with MyTutor

Still stuck? Get one-to-one help from a personally interviewed subject specialist


£26 /hr

Dylan P.

Degree: Chemical Engineering (Masters) - Birmingham University

Subjects offered:Maths, Science+ 3 more

-Personal Statements-

“I am a third-year student at the University of Birmingham studying my passion, Chemical Engineering. I hope to be able to inspire a similar passion in the sciences and mathematics to help you master the concepts. I am friendly and pat...”

£22 /hr

Josh M.

Degree: Biological Natural Sciences (Bachelors) - Cambridge University

Subjects offered:Maths, Physics+ 3 more

-Oxbridge Preparation-

“Who am I? I'm currently studying Natural Sciences in my third year at Cambridge University, with a focus on Neuroscience. Science is my passion, I've loved it at every level I've studied it, and a desire to pass on my passion is part ...”

£24 /hr

Ayyub A.

Degree: Mathematics Msci (Bachelors) - Bristol University

Subjects offered:Maths, Further Mathematics + 1 more

Further Mathematics

“Hi I'm Ayyub, current student at Bristol university studying Maths. I have significant tutoring experience in maths and hopefully i'll be able to help you out.”

About the author

£20 /hr

Shaun F.

Degree: Mathematics with International Study (Masters) - Exeter University

Subjects offered:Maths, Further Mathematics

Further Mathematics

“Hi, I'm Shaun! I'm currently studying for a masters in Mathematics at the University of Exeter..”

MyTutor guarantee

You may also like...

Other A Level Maths questions

What is the integral of x^x?

give the coordinates of the stationary points of the curve y = x^4 - 4x^3 + 27 and state with reason if they are minumum, maximum, or points of inflection.

Which Real values of x satisfy 3/ln(x) = ln(x) + 2?

For what values of k does the graph y=x^(2)+2kx+5 not intersect the x-axis

View A Level Maths tutors

We use cookies to improve your site experience. By continuing to use this website, we'll assume that you're OK with this. Dismiss