How to integrate a function of form f (x)/g (x) $\frac {(ax^n+b) dx}{cx^m+d}$ How to find $\int \frac {(ax^n+b) dx}{cx^m+d}$ (where m>n and m,n are natural numbers,and a,b,c,d are integers) ?
 A: While this post doesn't quite answer the specific question, it hopefully will provide some insight into the challenge of carrying out the indefinite integral
$$\int \frac{ax^n+b}{cx^m+d}dx =\int \frac{ax^n}{cx^m+d}dx +\frac{b}{c} \int \frac{1}{x^m+d/c}dx \tag 1$$

In this answer here, I showed that the integral of 
$$\bbox[5px,border:2px solid #C0A000]{\int\frac{1}{x^n+1}dx=-\frac1n\sum_{k=1}^n\left(\frac12 x_{kr}\log(x^2-2x_{kr}x+1)-x_{ki}\arctan\left(\frac{x-x_{kr}}{x_{ki}}\right)\right)+C'}
$$
where $x_{kr}$ and $x_{ki}$ are the real and imaginary parts of $x_k$, respectively, and are given by
$$x_{kr}=\text{Re}\left(x_k\right)=\cos \left(\frac{(2k-1)\pi}{n}\right)$$
$$x_{ki}=\text{Im}\left(x_k\right)=\sin \left(\frac{(2k-1)\pi}{n}\right)$$
One could directly apply this same approach to the second integral of $(1)$.  The first integral still poses a challenge, but this is a start.

If one is satisfied with a series solution, then one can write
$$\int\frac{x^n}{x^m+d/c}dx=\frac{c}{d}\int x^n\sum_{k=0}^{\infty}(-1)^k\left(\frac{cx^m}{d}\right)^{k}dx=\sum_{k=0}^{\infty}(-1)^k\left(\frac{c}{d}\right)^{k+1}\frac{x^{n+mk+1}}{n+mk+1}$$
for $\left|\frac{cx^m}{d}\right|<1$.  If $\left|\frac{cx^m}{d}\right|>1$, a similar procedure can easily be executed.
A: The general approach will involve:


*

*If $n\geq m$, use long division to get a polynomial plus a fraction of two polynomials where the degree of the numerator is smaller than $m$.

*Factoring $cx^m+d$ in factors with linear and quadratic terms.

*Applying partial fraction decomposition.

*Seperating all partial fractions in individual integrals.

*Applying either the ln method or the arctan method. 



$m=1$, $n=1$. Then \begin{align*} \int \frac{ax+b}{cx+d} dx &= \int \frac{a}{c} + \frac{b-\frac{da}{c}}{cx+d} dx \\ &= \int \frac{a}{c} + \frac{bc-da}{c^2x+cd} dx \\ &= \int \frac{a}{c}dx + \int  \frac{bc-da}{c^2x+cd} dx \\ &=  \frac{a}{c}x + \frac{bc-da}{c}\int  \frac{1}{cx+d} dx\end{align*}
Substitution $u=cx+d$. 
\begin{align*}\\ \frac{a}{c}x + \frac{bc-da}{c}\int  \frac{1}{cu} du &= \frac{a}{c}x + \frac{bc-da}{c^2}\int  \frac{1}{u} du \\  &= \frac{a}{c}x + \frac{bc-da}{c^2}\ln(u) \\  &= \frac{a}{c}x + \frac{bc-da}{c^2}\ln(cx+d)  \end{align*}
