Let: {{begin-eqn}} {{eqn | l = u       | r = \sqrt{a x + b}       | c =  }} {{eqn | ll= \implies       | l = x       | r = \frac {u^2 - b} a       | c =  }} {{eqn | ll= \implies       | l = \sqrt{p x + q}       | r = \sqrt{p \left({\frac {u^2 - b} a}\right) + q}       | c =  }} {{eqn | r = \sqrt{\frac {p \left({u^2 - b}\right) + a q} a}       | c =  }} {{eqn | r = \sqrt{\frac {p u^2 - b p + a q} a}       | c =  }} {{eqn | n = 1       | r = \sqrt {\frac p a} \sqrt{u^2 - \left({\frac {b p - a q} p}\right)}       | c =  }} {{end-eqn}} Let $c^2 = \dfrac {b p - a q} p$. Then: {{begin-eqn}} {{eqn | o =        | r = \int \frac {x \ \mathrm d x} {\sqrt{\left({a x + b}\right) \left({p x + q}\right)} } }} {{eqn | r = \int \frac {2 u} a \left({\frac {u^2 - b} a}\right) \frac {\mathrm d u} {u \sqrt {\frac p a} \sqrt{u^2 - c^2} }       | c = Primitive of Function of Root of $a x + b$ }} {{eqn | r = \frac 2 {a \sqrt {a p} } \int \frac {u^2 \ \mathrm d u} {\sqrt{u^2 - c^2} } - \frac {2 b} {a \sqrt {a p} } \int \frac {\mathrm d u} {\sqrt{u^2 - c^2} }       | c = Linear Combination of Integrals }} {{eqn | r = \frac 2 {a \sqrt {a p} } \left({\frac {u \sqrt{u^2 - c^2} } 2 + \frac {c^2} 2 \ln \left({u + \sqrt {u^2 - c^2} }\right) }\right)       | c = Primitive of $\dfrac {x^2}{\sqrt{x^2 - a^2} }$ }} {{eqn | ro= -       | r = \frac {2 b} {a \sqrt {a p} } \ln \left({u + \sqrt {u^2 - c^2} }\right)       | c = ... and Primitive of $\dfrac 1 {\sqrt{x^2 - a^2} }$: Logarithm Form }} {{eqn | r = \frac 2 {a \sqrt {a p} } \left({\frac {u \sqrt{u^2 - c^2} } 2 + \left({\frac {c^2} 2 - b}\right) \ln \left({u + \sqrt {u^2 - c^2} }\right) }\right)       | c = common factor }} {{eqn | r = \frac 2 {a \sqrt {a p} } \left({\frac {\sqrt{a x + b} \sqrt {\frac a p} \sqrt{p x + q} } 2 + \left({\frac {c^2} 2 - b}\right) \ln \left({\sqrt{a x + b} + \sqrt {\frac a p} \sqrt{p x + q} }\right)}\right)       | c = substituting for $u$, noting that $\sqrt{p x + q} = \sqrt {\frac p a} \sqrt{u^2 - c^2}$ }} {{eqn | r = \frac {\sqrt{\left({a x + b}\right) \left({p x + q}\right)} } {a p} + \left({\frac {b p - a q} {a p \sqrt {a p} }  - \frac {2 b} {a \sqrt {a p} } }\right) \ln \left({\frac {\sqrt {p \left({a x + b}\right)} + \sqrt {a \left({p x + q}\right)} } {\sqrt p} }\right)       | c = substituting for $c^2$ and simplifying }} {{eqn | r = \frac {\sqrt{\left({a x + b}\right) \left({p x + q}\right)} } {a p} + \left({\frac {b p - a q - 2 b p} {a p \sqrt {a p} } }\right) \ln \left({\frac {\sqrt {p \left({a x + b}\right)} + \sqrt {a \left({p x + q}\right)} } {\sqrt p} }\right)       | c = common denominator }} {{eqn | r = \frac {\sqrt{\left({a x + b}\right) \left({p x + q}\right)} } {a p} - \left({\frac {b p + a q} {a p \sqrt {a p} } }\right) \frac {\sqrt {a p} } 2 \int \frac {\mathrm d x} {\sqrt{\left({a x + b}\right) \left({p x + q}\right)} }       | c = Primitive of Reciprocal of $\sqrt{\left({a x + b}\right) \left({p x + q}\right)}$ }} {{eqn | r = \frac {\sqrt{\left({a x + b}\right) \left({p x + q}\right)} } {a p} - \left({\frac {b p + a q} {2 a p} }\right) \int \frac {\mathrm d x} {\sqrt{\left({a x + b}\right) \left({p x + q}\right)} }       | c = simplifying }} {{end-eqn}} {{qed}} {{improve|This is messy -- open to anyone else to write a better version}}