Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

$$\int^L_{-L} x \sin(\frac{\pi nx}{L})$$

I've seen something like this in Fourier theory, but I'm still not sure how to approach this integral. Wolfram Alpha gives me the answer, but no method. Integrate by parts? Substitution?

share|cite|improve this question
I suggest substitution: $$t=\frac{\pi n x}{L}.$$ – Siminore May 17 '13 at 13:50
up vote 2 down vote accepted

If $n=0,$ this is simple, so suppose not. Use the substitution $$u=\frac{n\pi}lx,$$ so that $$x=\frac{l}{n\pi}u,$$ and so $$\int_{-l}^lx\sin\left(\frac{n\pi}lx\right)\,dx=\frac{l^2}{n^2\pi^2}\int_{-n\pi}^{n\pi}u\sin u\,du,$$ then integrate by parts.

share|cite|improve this answer

Integrate by parts letting $u = x, dv = \sin(ax) dx$, and so $du = dx, v = -\cos (ax)/a$ and you have

$$\int x \sin(ax) dx = \int u \cdot dv = uv - \int v \cdot du = \frac{-x\cos(ax)}{a} + \frac{1}{a} \int \cos(ax) dx,$$

which should be much easier.

share|cite|improve this answer

Whenever you have $p(x)f(x)$, where $p(x)$ is a polynomial, and $f(x)$ is a function like $\sin(x)$ or $e^x$, such that differentiating doesn't increase its "order," integration by parts is always a good technique. Differentiate the polynomial so it becomes "less complicated," and integrate the other function.

$$\int_{-L}^Lx\sin\left(\frac{n\pi x}{L}\right)\,dx$$ Let $u = x, dv=\sin\left(\frac{n\pi x}{L}\right)dx$. Then $du = dx$ and $v = \frac{-L}{n\pi}\cos\left(\frac{n\pi x}{L}\right)$.

$$\int_{-L}^Lx\sin\left(\frac{n\pi x}{L}\right)\,dx = \frac{-xL}{n\pi}\cos\left(\frac{n\pi x}{L}\right)\Bigg|_{-L}^L - \int_{-L}^L\frac{-L}{n\pi}\cos\left(\frac{n\pi x}{L}\right)\,dx$$

share|cite|improve this answer

For what it's worth, WolframAlpha will show you the steps to evaluate the indefinite integral associated with this definite integral. It's then just a matter of plugging in the limits and subtracting.

Here are the steps returned by WolframAlpha via the Mathematica interface:

enter image description here

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.