\[ \int \frac {\left (-2 q+p x^3\right ) \sqrt {q^2+2 p q x^3-2 p q x^4+p^2 x^6} \left (b x^{12}+a \left (q+p x^3\right )^6\right )}{x^{17}} \, dx \]
Optimal antiderivative \[ \frac {\sqrt {p^{2} x^{6}-2 p q \,x^{4}+2 p q \,x^{3}+q^{2}}\, \left (6 a \,p^{7} x^{21}-2 a \,p^{6} q \,x^{19}+42 a \,p^{6} q \,x^{18}-5 a \,p^{5} q^{2} x^{17}-10 a \,p^{5} q^{2} x^{16}+126 a \,p^{5} q^{2} x^{15}-15 a \,p^{4} q^{3} x^{15}-15 a \,p^{4} q^{3} x^{14}-20 a \,p^{4} q^{3} x^{13}+210 a \,p^{4} q^{3} x^{12}-15 a \,p^{3} q^{4} x^{12}-15 a \,p^{3} q^{4} x^{11}-20 a \,p^{3} q^{4} x^{10}+210 a \,p^{3} q^{4} x^{9}+24 b p \,x^{15}-5 a \,p^{2} q^{5} x^{8}-10 a \,p^{2} q^{5} x^{7}+126 a \,p^{2} q^{5} x^{6}+24 b q \,x^{12}-2 a p \,q^{6} x^{4}+42 a p \,q^{6} x^{3}+6 a \,q^{7}\right )}{48 x^{16}}+\frac {\left (5 a \,p^{4} q^{4}+8 b p q \right ) \ln \left (x \right )}{4}+\frac {\left (-5 a \,p^{4} q^{4}-8 b p q \right ) \ln \left (q +p \,x^{3}+\sqrt {p^{2} x^{6}-2 p q \,x^{4}+2 p q \,x^{3}+q^{2}}\right )}{8} \]
command
Integrate[((-2*q + p*x^3)*Sqrt[q^2 + 2*p*q*x^3 - 2*p*q*x^4 + p^2*x^6]*(b*x^12 + a*(q + p*x^3)^6))/x^17,x]
Mathematica 13.1 output
\[ \frac {1}{48} \left (\frac {\left (q+p x^3\right ) \sqrt {q^2-2 p q (-1+x) x^3+p^2 x^6} \left (24 b x^{12}+a \left (6 q^6-2 p q^5 (-18+x) x^3-2 p^5 q (-18+x) x^{15}+6 p^6 x^{18}+p^2 q^4 x^6 \left (90-8 x-5 x^2\right )+p^4 q^2 x^{12} \left (90-8 x-5 x^2\right )-p^3 q^3 x^9 \left (-120+12 x+10 x^2+15 x^3\right )\right )\right )}{x^{16}}-6 p q \left (8 b+5 a p^3 q^3\right ) \tanh ^{-1}\left (\frac {\sqrt {q^2-2 p q (-1+x) x^3+p^2 x^6}}{q+p x^3}\right )\right ) \]
Mathematica 12.3 output
\[ \int \frac {\left (-2 q+p x^3\right ) \sqrt {q^2+2 p q x^3-2 p q x^4+p^2 x^6} \left (b x^{12}+a \left (q+p x^3\right )^6\right )}{x^{17}} \, dx \]________________________________________________________________________________________