\[ \int \left (f+g x^2\right )^3 \log \left (c \left (d+e x^2\right )^p\right ) \, dx \]
Optimal antiderivative \[ -2 f^{3} p x +\frac {2 d \,f^{2} g p x}{e}-\frac {6 d^{2} f \,g^{2} p x}{5 e^{2}}+\frac {2 d^{3} g^{3} p x}{7 e^{3}}-\frac {2 f^{2} g p \,x^{3}}{3}+\frac {2 d f \,g^{2} p \,x^{3}}{5 e}-\frac {2 d^{2} g^{3} p \,x^{3}}{21 e^{2}}-\frac {6 f \,g^{2} p \,x^{5}}{25}+\frac {2 d \,g^{3} p \,x^{5}}{35 e}-\frac {2 g^{3} p \,x^{7}}{49}-\frac {2 d^{\frac {3}{2}} f^{2} g p \arctan \left (\frac {x \sqrt {e}}{\sqrt {d}}\right )}{e^{\frac {3}{2}}}+\frac {6 d^{\frac {5}{2}} f \,g^{2} p \arctan \left (\frac {x \sqrt {e}}{\sqrt {d}}\right )}{5 e^{\frac {5}{2}}}-\frac {2 d^{\frac {7}{2}} g^{3} p \arctan \left (\frac {x \sqrt {e}}{\sqrt {d}}\right )}{7 e^{\frac {7}{2}}}+f^{3} x \ln \left (c \left (e \,x^{2}+d \right )^{p}\right )+f^{2} g \,x^{3} \ln \left (c \left (e \,x^{2}+d \right )^{p}\right )+\frac {3 f \,g^{2} x^{5} \ln \left (c \left (e \,x^{2}+d \right )^{p}\right )}{5}+\frac {g^{3} x^{7} \ln \left (c \left (e \,x^{2}+d \right )^{p}\right )}{7}+\frac {2 f^{3} p \arctan \left (\frac {x \sqrt {e}}{\sqrt {d}}\right ) \sqrt {d}}{\sqrt {e}} \]
command
integrate((g*x**2+f)**3*ln(c*(e*x**2+d)**p),x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \begin {cases} \left (f^{3} x + f^{2} g x^{3} + \frac {3 f g^{2} x^{5}}{5} + \frac {g^{3} x^{7}}{7}\right ) \log {\left (0^{p} c \right )} & \text {for}\: d = 0 \wedge e = 0 \\- 2 f^{3} p x + f^{3} x \log {\left (c \left (e x^{2}\right )^{p} \right )} - \frac {2 f^{2} g p x^{3}}{3} + f^{2} g x^{3} \log {\left (c \left (e x^{2}\right )^{p} \right )} - \frac {6 f g^{2} p x^{5}}{25} + \frac {3 f g^{2} x^{5} \log {\left (c \left (e x^{2}\right )^{p} \right )}}{5} - \frac {2 g^{3} p x^{7}}{49} + \frac {g^{3} x^{7} \log {\left (c \left (e x^{2}\right )^{p} \right )}}{7} & \text {for}\: d = 0 \\\left (f^{3} x + f^{2} g x^{3} + \frac {3 f g^{2} x^{5}}{5} + \frac {g^{3} x^{7}}{7}\right ) \log {\left (c d^{p} \right )} & \text {for}\: e = 0 \\- \frac {2 d^{4} g^{3} p \log {\left (x - \sqrt {- \frac {d}{e}} \right )}}{7 e^{4} \sqrt {- \frac {d}{e}}} + \frac {d^{4} g^{3} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{7 e^{4} \sqrt {- \frac {d}{e}}} + \frac {6 d^{3} f g^{2} p \log {\left (x - \sqrt {- \frac {d}{e}} \right )}}{5 e^{3} \sqrt {- \frac {d}{e}}} - \frac {3 d^{3} f g^{2} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{5 e^{3} \sqrt {- \frac {d}{e}}} + \frac {2 d^{3} g^{3} p x}{7 e^{3}} - \frac {2 d^{2} f^{2} g p \log {\left (x - \sqrt {- \frac {d}{e}} \right )}}{e^{2} \sqrt {- \frac {d}{e}}} + \frac {d^{2} f^{2} g \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{e^{2} \sqrt {- \frac {d}{e}}} - \frac {6 d^{2} f g^{2} p x}{5 e^{2}} - \frac {2 d^{2} g^{3} p x^{3}}{21 e^{2}} + \frac {2 d f^{3} p \log {\left (x - \sqrt {- \frac {d}{e}} \right )}}{e \sqrt {- \frac {d}{e}}} - \frac {d f^{3} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{e \sqrt {- \frac {d}{e}}} + \frac {2 d f^{2} g p x}{e} + \frac {2 d f g^{2} p x^{3}}{5 e} + \frac {2 d g^{3} p x^{5}}{35 e} - 2 f^{3} p x + f^{3} x \log {\left (c \left (d + e x^{2}\right )^{p} \right )} - \frac {2 f^{2} g p x^{3}}{3} + f^{2} g x^{3} \log {\left (c \left (d + e x^{2}\right )^{p} \right )} - \frac {6 f g^{2} p x^{5}}{25} + \frac {3 f g^{2} x^{5} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{5} - \frac {2 g^{3} p x^{7}}{49} + \frac {g^{3} x^{7} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{7} & \text {otherwise} \end {cases} \]
Sympy 1.8 under Python 3.8.8 output
\[ \text {Timed out} \]________________________________________________________________________________________