# General formula for $\int_a^b(x-a)^m(x-b)^ndx$

Recently, I stumbled upon this:

$$\int_a^b (x-a)^3(x-b)^4dx$$

I did this in many ways - using IBP multiple times and by even expanding both terms like a madman.

The result was: $$\frac{(a-b)^8}{280}$$ I was astonished by this cute little result. So I started wondering about evaluating the following:

$$\int_a^b(x-a)^m(x-b)^ndx$$

I wanted to use reduction to obtain a result similar to Wallis' formula for sine and cosine

Any other method is always welcome

## 3 Answers

Start using IBP:

$$I_{(m,n)}=\int_a^b(x-a)^m(x-b)^ndx=0-\int_a^b m(x-a)^{m-1}\frac{(x-b)^{n+1}}{n+1}dx=-\frac{m}{n+1}I_{(m-1,n+1)}$$

Applying IBP multiple times, we obtain $$I_{(m,n)}=(-1)^{m+1}\frac{m!.n!}{(n+m)!}I_{(0,n+m)}$$

$$\boxed{I_{(m,n)}=(-1)^{m+1}\frac{m!.n!}{(n+m+1)!}(a-b)^{n+m+1}}$$

• I think you got the sign wrong. Take for example in the question $a=0$, $b=1$. So the integral of $x^3(x-1)^4$ should be positive. For $m=3$ and $n=4$ your result is negative. Nov 4 '20 at 6:51
• @Andrei thank you for pointing it out. I hope its fixed now. Nov 4 '20 at 6:58
• Your second line was right before, but you got the limits on the integral in reverse order. $I_{(0,n+m)}=\int_a^b(x-b)^{n+m}dx=\int_{a-b}^0u^{n+m}du=-(a-b)^{n+m+1}/(n+m+1)$ Nov 4 '20 at 7:10
• Oh yes I got it, thank you so much Nov 4 '20 at 7:13
• You are welcome. Nov 4 '20 at 7:14

Let $$u=(x-a)/(b-a)$$ so that \begin{align} \int_a^b(x-a)^m(x-b)^ndx=(-1)^m(b-a)^{m+n+1}\int_0^1u^m\left(1-u\right)^ndx \end{align} and latter integral is a well-known quantity.

• Is the latter integral related to beta/gamma functions? I don't know much about them. Nov 4 '20 at 7:09
• You are right: this is the beta function. Nov 4 '20 at 7:48

I liked your method the best.But if you are fine with using wallis formula,here is a hint;

Hint use the substituition $$x=a+({b-a})\sin^2 \theta$$ $$dx=2(b-a)\sin \theta \cos \theta d\theta$$

can you take it from here?