I came across a problem of the form $\int(x+a)(x+b)^n~dx$ where $n$ is a constant and $n\in\mathbb{N}$. I was able to find its antiderivatives as well as generalize the result $$\int(x+a)(x+b)^n~dx=(a-b)\dfrac{(x+b)^{n+1}}{n+1}+\dfrac{(x+b)^{n+2}}{n+2}+C$$ However, I came across another problem of the form $\int(x+a)^m(x+b)^n~dx$ where $m$ and $n$ are constants and $m,n\in\mathbb{N}$. I was able to find its solution by using integration by substitution. However, I could not generalize my result. Instinctively, I tried using substitution as I used for the previous expression but could not distribute the factors.
Here is the integral computed on Wolfram Alpha.
The solution on Wolfram Alpha uses hypergeometric function but I can't figure out how to compute the solution. Any hints would appreciated.