<s>[INST] How to solve$\int_0^a\frac{(a-x)^{n-1}}{(a+x)^{n+1}}\, dx$? How can I solve the following integral:
$$\int_0^a\frac{(a-x)^{n-1}}{(a+x)^{n+1}}\, dx.$$ I'm not posting my work because I don't even know where to start with this integral.
 [/INST] Integrating by parts:
$$I_n=\int_0^a\frac{(a-x)^{n-1}}{(a+x)^{n+1}}\, dx = $$
$$(a-x)^{n-1}\cdot \left(-\frac{1}{n(a+x)^n}\right) \bigg |_0^a-\int_0^a \left(-\frac{1}{n(a+x)^n}\right)\cdot (-1)(n-1)(a-x)^{n-2}dx=$$
$$\frac{1}{na}-\frac{n-1}{n} \cdot I_{n-1}, \ \ \ I_1=\frac{1}{2a}.$$
$$I_2=\frac{1}{2a}-\frac{1}{2}I_1=\frac{1}{2a}-\frac{1}{4a}=\frac{1}{4a}.$$
$$I_3=\frac{1}{3a}-\frac{2}{3}I_2=\frac{1}{3a}-\frac{1}{6a}=\frac{1}{6a}.$$
$$\cdots$$
$$I_n=\frac{1}{2an}.$$
</s>