# Math Help - Question about efficient integration

1. ## Question about efficient integration

Hi,

In the provided answers for a question set on PDE's, the following integral was solved really quickly:

Any ideas what he's actually doing? Integration by parts?

2. Integration by parts twice, in quick succession. The first one (slowed down just a bit) goes like this:

\begin{aligned}\frac2a\int_0^a\!\!\!(ax-x^2)\sin\tfrac{n\pi x}a\,dx &= \frac2a\biggl[(ax-x^2)\frac{\bigl(-\cos\tfrac{n\pi x}a\bigr)}{n\pi/a}\biggr]_0^a-\frac2a\int_0^a\!\!\!(a-2x)\frac{\bigl(-\cos\tfrac{n\pi x}a\bigr)}{n\pi/a}dx \\ &=\frac2{n\pi}\int_0^a\!\!\!(a-2x)\cos\tfrac{n\pi x}a\,dx,\end{aligned}

because the expression in square brackets vanishes at both ends of the interval. Now you have to integrate by parts again, and the same thing happens to the expression in brackets.

3. Thanks very much