<s>[INST] Complicated integration How can this be integrated? :
$$\int_{b}^{a} x \left ( \frac{D}{a-b} \right ) \left ( \frac{a-x}{a-b} \right )^{D-1}dx$$
The solution is :
$$\frac{a+(D)(b)}{D+1}$$
 [/INST] Let $u = (a - x)/(a - b)$. Then $(a - b)u = a - x$, thus $(a - b)\, du = -\, dx$. When $x = b$, $u = 1$ and when $x = a$, $u = 0$. Thus 
$$\int_b^a x\left(\frac{D}{a - b}\right) \left(\frac{a - x}{a - b}\right)^{D - 1}\, dx = D\int_0^1 [a - (a - b)u]u^{D - 1}\, du$$
Now 
$$\int_0^1 [a - (a - b)u]u^{D - 1}\, du = \int_0^1 [au^{D - 1} - (a - b)u^D]\, du = \frac{a}{D} - \frac{a - b}{D+1} = \frac{a + Db}{D(D + 1)}$$
Hence
$$\int_b^a x\left(\frac{D}{a - b}\right) \left(\frac{a - x}{a - b}\right)^{D - 1}\, dx = D\frac{a + Db}{D(D + 1)} = \frac{a + Db}{D + 1}$$
</s>