Aiming for an expression in the form: : $\displaystyle \int u \frac {\mathrm d v} {\mathrm d x} \ \mathrm d x = u v - \int v \ \frac {\mathrm d u} {\mathrm d x} \ \mathrm d x$ in order to use the technique of Integration by Parts, let: {{begin-eqn}} {{eqn | l = v       | r = \left({a x + b}\right)^s       | c =  }} {{eqn | ll= \implies       | l = \frac {\mathrm d v} {\mathrm d x}       | r = a s \left({a x + b}\right)^{s-1}       | c = Derivative of Power and Derivative of Function of Constant Multiple: Corollary }} {{end-eqn}} In order to make $u \dfrac {\mathrm d v} {\mathrm d x}$ equal to the integrand, let: {{begin-eqn}} {{eqn | l = u       | r = \frac {\left({a x + b}\right)^{m - s + 1} } {a s} \left({p x + q}\right)^n       | c =  }} {{eqn | ll= \implies       | l = \frac {\mathrm d u} {\mathrm d x}       | r = \frac {a \left({m - s + 1}\right) \left({a x + b}\right)^{m - s} \left({p x + q}\right)^n + p n \left({a x + b}\right)^{m - s + 1} \left({p x + q}\right)^{n-1} } {a s}        | c = Product Rule for Derivatives and above }} {{eqn | r = \frac {\left({a x + b}\right)^{m - s} \left({p x + q}\right)^{n-1} } {a s} \left({a \left({m - s + 1}\right) \left({p x + q}\right) + p n \left({a x + b}\right) }\right)       | c = extracting common factor }} {{eqn | r = \frac {\left({a x + b}\right)^{m - s} \left({p x + q}\right)^{n-1} } {a s} \left({a p x \left({m - s + 1 + n}\right) + a q \left({m - s + 1}\right) + p b n}\right)       | c = separating out terms in $x$ }} {{end-eqn}} Select $s$ such that $m - s + n + 1 = 0$, and so $s = m + n + 1$: {{begin-eqn}} {{eqn | l = \frac {\mathrm d u} {\mathrm d x}       | r = \frac {\left({a x + b}\right)^{m - s} \left({p x + q}\right)^{n-1} } {a \left({m + n + 1}\right)} \left({a q \left({m - \left({m + n + 1}\right) + 1}\right) + p b n}\right)       | c = term in $x$ vanishes }} {{eqn | r = \frac {\left({a x + b}\right)^{m - s} \left({p x + q}\right)^{n-1} } {a \left({m + n + 1}\right)} \left({n \left({p b - a q}\right)}\right)       | c = simplifying }} {{end-eqn}} Other instances of $s$ are left as they are, anticipating that they will cancel out later. Thus: {{begin-eqn}} {{eqn | o =        | r = \int \left({a x + b}\right)^m \left({p x + q}\right)^n \ \mathrm d x       | c =  }} {{eqn | r = \int \frac {\left({a x + b}\right)^{m - s + 1} } {a s} \left({p x + q}\right)^n a s \left({a x + b}\right)^{s-1} \ \mathrm d x       | c = in the form $\displaystyle \int u \frac {\mathrm d v} {\mathrm d x} \ \mathrm d x$ }} {{eqn | r = \frac {\left({a x + b}\right)^{m - s + 1} } {a s} \left({p x + q}\right)^n \left({a x + b}\right)^s       | c = in the form $\displaystyle u v - \int v \frac {\mathrm d u} {\mathrm d x} \ \mathrm d x$ }} {{eqn | o =        | ro= -       | r = \int \left({a x + b}\right)^s \frac {\left({a x + b}\right)^{m - s} \left({p x + q}\right)^{n-1} } {a \left({m + n + 1}\right)} \left({n \left({p b - a q}\right)}\right) \ \mathrm d x       | c =  }} {{eqn | r = \frac {\left({a x + b}\right)^{m+1} \left({p x + q}\right)^n} {\left({m + n + 1}\right) a} - \frac {n \left({b p - a q}\right)} {\left({m + n + 1}\right) a} \int \left({a x + b}\right)^m \left({p x + q}\right)^{n-1} \ \mathrm d x       | c = Primitive of Constant Multiple of Function }} {{end-eqn}} {{qed}}