24.27 Problem number 623

\[ \int (d+e x)^2 \sqrt {f+g x} \sqrt {a+c x^2} \, dx \]

Optimal antiderivative \[ \frac {4 \left (7 a \,e^{2} g^{2}-c \left (21 d^{2} g^{2}-24 d e f g +8 e^{2} f^{2}\right )\right ) \left (g x +f \right )^{\frac {3}{2}} \sqrt {c \,x^{2}+a}}{315 c \,g^{3}}+\frac {2 e \left (-3 d g +e f \right ) \left (g x +f \right )^{\frac {5}{2}} \sqrt {c \,x^{2}+a}}{63 g^{3}}-\frac {2 \left (6 a \,e^{2} g^{2} \left (-10 d g +e f \right )-c \left (-35 d^{3} g^{3}+63 d^{2} e f \,g^{2}-57 d \,e^{2} f^{2} g +19 e^{3} f^{3}\right )\right ) \sqrt {g x +f}\, \sqrt {c \,x^{2}+a}}{315 c e \,g^{3}}+\frac {2 \left (e x +d \right )^{3} \sqrt {g x +f}\, \sqrt {c \,x^{2}+a}}{9 e}+\frac {4 \left (21 a^{2} e^{2} g^{4}+3 a c \,g^{2} \left (-21 d^{2} g^{2}-16 d e f g +3 e^{2} f^{2}\right )+c^{2} f^{2} \left (21 d^{2} g^{2}-24 d e f g +8 e^{2} f^{2}\right )\right ) \EllipticE \left (\frac {\sqrt {1-\frac {x \sqrt {c}}{\sqrt {-a}}}\, \sqrt {2}}{2}, \sqrt {-\frac {2 a g}{-a g +f \sqrt {-a}\, \sqrt {c}}}\right ) \sqrt {-a}\, \sqrt {g x +f}\, \sqrt {1+\frac {c \,x^{2}}{a}}}{315 c^{\frac {3}{2}} g^{4} \sqrt {c \,x^{2}+a}\, \sqrt {\frac {\left (g x +f \right ) \sqrt {c}}{g \sqrt {-a}+f \sqrt {c}}}}-\frac {4 \left (a \,g^{2}+c \,f^{2}\right ) \left (3 a e \,g^{2} \left (-10 d g +e f \right )+c f \left (21 d^{2} g^{2}-24 d e f g +8 e^{2} f^{2}\right )\right ) \EllipticF \left (\frac {\sqrt {1-\frac {x \sqrt {c}}{\sqrt {-a}}}\, \sqrt {2}}{2}, \sqrt {-\frac {2 a g}{-a g +f \sqrt {-a}\, \sqrt {c}}}\right ) \sqrt {-a}\, \sqrt {1+\frac {c \,x^{2}}{a}}\, \sqrt {\frac {\left (g x +f \right ) \sqrt {c}}{g \sqrt {-a}+f \sqrt {c}}}}{315 c^{\frac {3}{2}} g^{4} \sqrt {g x +f}\, \sqrt {c \,x^{2}+a}} \]

command

integrate((e*x+d)^2*(g*x+f)^(1/2)*(c*x^2+a)^(1/2),x, algorithm="fricas")

Fricas 1.3.8 (sbcl 2.2.11.debian) via sagemath 9.6 output

\[ \frac {2 \, {\left (2 \, {\left (21 \, c^{2} d^{2} f^{3} g^{2} + 189 \, a c d^{2} f g^{4} + {\left (8 \, c^{2} f^{5} + 15 \, a c f^{3} g^{2} - 33 \, a^{2} f g^{4}\right )} e^{2} - 6 \, {\left (4 \, c^{2} d f^{4} g + 11 \, a c d f^{2} g^{3} + 15 \, a^{2} d g^{5}\right )} e\right )} \sqrt {c g} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (c f^{2} - 3 \, a g^{2}\right )}}{3 \, c g^{2}}, -\frac {8 \, {\left (c f^{3} + 9 \, a f g^{2}\right )}}{27 \, c g^{3}}, \frac {3 \, g x + f}{3 \, g}\right ) + 6 \, {\left (21 \, c^{2} d^{2} f^{2} g^{3} - 63 \, a c d^{2} g^{5} + {\left (8 \, c^{2} f^{4} g + 9 \, a c f^{2} g^{3} + 21 \, a^{2} g^{5}\right )} e^{2} - 24 \, {\left (c^{2} d f^{3} g^{2} + 2 \, a c d f g^{4}\right )} e\right )} \sqrt {c g} {\rm weierstrassZeta}\left (\frac {4 \, {\left (c f^{2} - 3 \, a g^{2}\right )}}{3 \, c g^{2}}, -\frac {8 \, {\left (c f^{3} + 9 \, a f g^{2}\right )}}{27 \, c g^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (c f^{2} - 3 \, a g^{2}\right )}}{3 \, c g^{2}}, -\frac {8 \, {\left (c f^{3} + 9 \, a f g^{2}\right )}}{27 \, c g^{3}}, \frac {3 \, g x + f}{3 \, g}\right )\right ) + 3 \, {\left (63 \, c^{2} d^{2} g^{5} x + 21 \, c^{2} d^{2} f g^{4} + {\left (35 \, c^{2} g^{5} x^{3} + 5 \, c^{2} f g^{4} x^{2} + 8 \, c^{2} f^{3} g^{2} + 8 \, a c f g^{4} - 2 \, {\left (3 \, c^{2} f^{2} g^{3} - 7 \, a c g^{5}\right )} x\right )} e^{2} + 6 \, {\left (15 \, c^{2} d g^{5} x^{2} + 3 \, c^{2} d f g^{4} x - 4 \, c^{2} d f^{2} g^{3} + 10 \, a c d g^{5}\right )} e\right )} \sqrt {c x^{2} + a} \sqrt {g x + f}\right )}}{945 \, c^{2} g^{5}} \]

Fricas 1.3.7 via sagemath 9.3 output

\[ {\rm integral}\left ({\left (e^{2} x^{2} + 2 \, d e x + d^{2}\right )} \sqrt {c x^{2} + a} \sqrt {g x + f}, x\right ) \]