# How to better spot the right integration by parts

I was having trouble integrating $$\int_0^{\pi/2}\sin^{n}\left(x\right)\cos^{2}\left(x\right)\,{\rm d}x$$ and someone pointed out to me that it was a somewhat simple integration by parts. Does anyone have some tips for me to better spot integrations by parts? I feel like I often miss them. Do you just proceed by trial and error, looking for $dv$ and $u$?

One general tip I heard was in choosing $u$, use LIATE, that is, the best things to make $u$, in order, are 1. Logs 2. Inverse trig functions 3. Algebraic functions 4. Trig functions 5. Exponential. But that's if you already know you have to use integration by parts, and doesn't help you to recognize it.

Alternately, if someone has a reference for good practice, I'd love to hear it. Thanks!

-
Spivak's Calculus and Apostol's Volume I calculus are good practice . –  Ayesha Jan 12 '14 at 3:07
Eric: In general, the strategy is always to reduce the problem to an easier one (unless we're in the situation where we go around a loop and return to the original, with a different constant). If this problem had been $\int \sin^n x\,dx$ you probably would have realized you wanted a reduction formula to reduce the exponent somehow. –  Ted Shifrin Jan 12 '14 at 3:54
We often look for the simplest one among a few cases. Sometimes, it's pretty obvious and sometimes it's difficult or/and we arrive to a more complicated expression. Also, it depends on the expression type ( trigonometric, rationals, etc... ). Just try to practice and everything will be easier. –  Felix Marin Jan 12 '14 at 10:35
@FelixMarin Is this an empty comment or what? –  Did Jan 17 '14 at 15:38

Here are three typical situations where you should try to use integration by parts.

You want to apply integration by parts if

• your integrand has one factor which gets simpler by differentiation and a second factor which can be easily integrated.

Typical examples: $\int_{a}^b x^ke^x dx$, $\int_{0}^1 x^a(1-x)^b dx$,

because powers of $x$ eventually disappear when differentiated.

• your integrand has one factor which stays the same or will eventually be the same upon differentiation and a second factor which can be easily integrated.

Typical example: $\int_{a}^{b}e^x\sin x dx$

because integrating (or differentiating) the sine twice essentially gets you back the same function which allows for combining it with the original integral on the left.

• your integrand has one factor whose derivative will cancel or combine with all or part of the rest of the integrand, and a second factor which can be easily integrated

Typical examples: $\int_{a}^b x\ln x dx$, $\int_{0}^{\frac{\pi}2}(\sin x)^n dx$.

because the derivative of the logarithm will cancel with the $x$ and give you a trivial integral. (Note especially that you will not derive the $x$ unless you already know the integral of the logarithm from somewhere else.) and because the derivative of a power of sine combines with the derivative of sine to give again only integrals of powers of sine.

Note that your example is of the third kind which is the most difficult to spot because you have to know identities for your functions to determine that they cancel/combine judiciously. However, there are not that many examples that one encounters regularly, so after some practice, you will just know typical situations.

-
I've come back to this answer over and over for guidance. Thank you. –  Eric Auld Aug 31 '14 at 9:49

As with so many things in Mathematics, the actual identification of the right way to figure something out is actually more of an art than a science (although trial and error will often get you there).

A good rule of thumb with integration of functions that are products of trig is that, if you can't see an obvious substitution, try integration by parts. Pattern recognition is also useful a lot of the time - for instance, how might you solve the case where $n=0$? $n=1$? $n=2$? Can you generalise the approach, either for all $n$, all integer $n$, or all even (or odd) integer $n$?

-


\begin{align} {\cal I}_{n} &= {1 \over n + 1}\int_{x\ =\ 0}^{x\ =\ \pi/2}\cos\pars{x} \,\dd\bracks{\sin^{n + 1}\pars{x}} = -\,{1 \over n+ 1}\int_{0}^{\pi/2}\sin^{n + 1}\pars{x}\bracks{-\sin\pars{x}}\,\dd x \\[3mm]&={1 \over n+ 1}\int_{0}^{\pi/2} \sin^{n}\pars{x}\bracks{1 -\cos^{2}\pars{x}}\,\dd x ={1 \over n+ 1}\int_{0}^{\pi/2} \sin^{n}\pars{x}\,\dd x - {1 \over n + 1}\,{\cal I}_{n} \end{align}

\begin{align} {\cal I}_{n}&={1 \over n + 2}\int_{0}^{\pi/2}\sin^{n}\pars{x}\,\dd x ={n \over n + 2}\bracks{{1 \over n}\int_{0}^{\pi/2}\sin^{n - 2}\pars{x}\,\dd x} - {1 \over n + 2}\int_{0}^{\pi/2}\sin^{n - 2}\pars{x}\cos^{2}\pars{x}\,\dd x \\[3mm]&= {n \over n + 2}\,{\cal I}_{n - 2} - {1 \over n + 2}\,{\cal I}_{n - 2} = {n - 1 \over n + 2}\,{\cal I}_{n - 2} \end{align}

$$\color{#0000ff}{\large% {\cal I}_{n} = \int_{0}^{\pi/2}\sin^{n}\pars{x}\cos^{2}\pars{x} \,\dd x = {n - 1 \over n + 2}\,{\cal I}_{n - 2}\,,\quad n \geq 2\,,\qquad \left\vert% \begin{array}{rcl} {\cal I}_{0} & = & {\pi \over 4} \\[2mm] {\cal I}_{1} & = & {1 \over 3} \end{array}\right.}$$
-
(+1) nice answer. If you solve the recurrence relation you got and compare it with the solution using the beta function you will have the same answer. –  Mhenni Benghorbal Jan 12 '14 at 6:23
@MhenniBenghorbal Also, the recurrence can be solved via a generating function but I skipped that problem since it's a little bit long. Thanks. –  Felix Marin Jan 12 '14 at 6:58
You are welcome. –  Mhenni Benghorbal Jan 12 '14 at 7:05
-1. This does not answer the question. The question is: "Does anyone have some tips for me to better spot integrations by parts? I feel like I often miss them. Do you just proceed by trial and error, looking for dv and u?" // Upvoters who are not @Mhenni: why the upvote? –  Did Jan 12 '14 at 8:22