\(\int (f+g x^2) \log ^2(c (d+e x^2)^p) \, dx\) [274]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [C] (warning: unable to verify)
Fricas [F]
Sympy [F]
Maxima [F(-2)]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 22, antiderivative size = 548 \[ \int \left (f+g x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=8 f p^2 x-\frac {32 d g p^2 x}{9 e}+\frac {8}{27} g p^2 x^3-\frac {8 \sqrt {d} f p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {e}}+\frac {32 d^{3/2} g p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{9 e^{3/2}}+\frac {4 i \sqrt {d} f p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )^2}{\sqrt {e}}-\frac {4 i d^{3/2} g p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )^2}{3 e^{3/2}}+\frac {8 \sqrt {d} f p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \log \left (\frac {2 \sqrt {d}}{\sqrt {d}+i \sqrt {e} x}\right )}{\sqrt {e}}-\frac {8 d^{3/2} g p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \log \left (\frac {2 \sqrt {d}}{\sqrt {d}+i \sqrt {e} x}\right )}{3 e^{3/2}}-4 f p x \log \left (c \left (d+e x^2\right )^p\right )+\frac {4 d g p x \log \left (c \left (d+e x^2\right )^p\right )}{3 e}-\frac {4}{9} g p x^3 \log \left (c \left (d+e x^2\right )^p\right )+\frac {4 \sqrt {d} f p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \log \left (c \left (d+e x^2\right )^p\right )}{\sqrt {e}}-\frac {4 d^{3/2} g p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \log \left (c \left (d+e x^2\right )^p\right )}{3 e^{3/2}}+f x \log ^2\left (c \left (d+e x^2\right )^p\right )+\frac {1}{3} g x^3 \log ^2\left (c \left (d+e x^2\right )^p\right )+\frac {4 i \sqrt {d} f p^2 \operatorname {PolyLog}\left (2,1-\frac {2 \sqrt {d}}{\sqrt {d}+i \sqrt {e} x}\right )}{\sqrt {e}}-\frac {4 i d^{3/2} g p^2 \operatorname {PolyLog}\left (2,1-\frac {2 \sqrt {d}}{\sqrt {d}+i \sqrt {e} x}\right )}{3 e^{3/2}} \] Output:

8*f*p^2*x-32/9*d*g*p^2*x/e+8/27*g*p^2*x^3-8*d^(1/2)*f*p^2*arctan(e^(1/2)*x 
/d^(1/2))/e^(1/2)+32/9*d^(3/2)*g*p^2*arctan(e^(1/2)*x/d^(1/2))/e^(3/2)-4/3 
*I*d^(3/2)*g*p^2*arctan(e^(1/2)*x/d^(1/2))^2/e^(3/2)+4*I*d^(1/2)*f*p^2*pol 
ylog(2,1-2*d^(1/2)/(d^(1/2)+I*e^(1/2)*x))/e^(1/2)+8*d^(1/2)*f*p^2*arctan(e 
^(1/2)*x/d^(1/2))*ln(2*d^(1/2)/(d^(1/2)+I*e^(1/2)*x))/e^(1/2)-8/3*d^(3/2)* 
g*p^2*arctan(e^(1/2)*x/d^(1/2))*ln(2*d^(1/2)/(d^(1/2)+I*e^(1/2)*x))/e^(3/2 
)-4*f*p*x*ln(c*(e*x^2+d)^p)+4/3*d*g*p*x*ln(c*(e*x^2+d)^p)/e-4/9*g*p*x^3*ln 
(c*(e*x^2+d)^p)+4*d^(1/2)*f*p*arctan(e^(1/2)*x/d^(1/2))*ln(c*(e*x^2+d)^p)/ 
e^(1/2)-4/3*d^(3/2)*g*p*arctan(e^(1/2)*x/d^(1/2))*ln(c*(e*x^2+d)^p)/e^(3/2 
)+f*x*ln(c*(e*x^2+d)^p)^2+1/3*g*x^3*ln(c*(e*x^2+d)^p)^2+4*I*d^(1/2)*f*p^2* 
arctan(e^(1/2)*x/d^(1/2))^2/e^(1/2)-4/3*I*d^(3/2)*g*p^2*polylog(2,1-2*d^(1 
/2)/(d^(1/2)+I*e^(1/2)*x))/e^(3/2)
 

Mathematica [A] (verified)

Time = 0.30 (sec) , antiderivative size = 281, normalized size of antiderivative = 0.51 \[ \int \left (f+g x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=\frac {-36 i \sqrt {d} (-3 e f+d g) p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )^2-12 \sqrt {d} p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \left (2 (9 e f-4 d g) p+6 (-3 e f+d g) p \log \left (\frac {2 \sqrt {d}}{\sqrt {d}+i \sqrt {e} x}\right )+(-9 e f+3 d g) \log \left (c \left (d+e x^2\right )^p\right )\right )+\sqrt {e} x \left (8 p^2 \left (27 e f-12 d g+e g x^2\right )-12 p \left (9 e f-3 d g+e g x^2\right ) \log \left (c \left (d+e x^2\right )^p\right )+9 e \left (3 f+g x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right )\right )-36 i \sqrt {d} (-3 e f+d g) p^2 \operatorname {PolyLog}\left (2,\frac {i \sqrt {d}+\sqrt {e} x}{-i \sqrt {d}+\sqrt {e} x}\right )}{27 e^{3/2}} \] Input:

Integrate[(f + g*x^2)*Log[c*(d + e*x^2)^p]^2,x]
 

Output:

((-36*I)*Sqrt[d]*(-3*e*f + d*g)*p^2*ArcTan[(Sqrt[e]*x)/Sqrt[d]]^2 - 12*Sqr 
t[d]*p*ArcTan[(Sqrt[e]*x)/Sqrt[d]]*(2*(9*e*f - 4*d*g)*p + 6*(-3*e*f + d*g) 
*p*Log[(2*Sqrt[d])/(Sqrt[d] + I*Sqrt[e]*x)] + (-9*e*f + 3*d*g)*Log[c*(d + 
e*x^2)^p]) + Sqrt[e]*x*(8*p^2*(27*e*f - 12*d*g + e*g*x^2) - 12*p*(9*e*f - 
3*d*g + e*g*x^2)*Log[c*(d + e*x^2)^p] + 9*e*(3*f + g*x^2)*Log[c*(d + e*x^2 
)^p]^2) - (36*I)*Sqrt[d]*(-3*e*f + d*g)*p^2*PolyLog[2, (I*Sqrt[d] + Sqrt[e 
]*x)/((-I)*Sqrt[d] + Sqrt[e]*x)])/(27*e^(3/2))
 

Rubi [A] (verified)

Time = 1.59 (sec) , antiderivative size = 548, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {2921, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \left (f+g x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx\)

\(\Big \downarrow \) 2921

\(\displaystyle \int \left (f \log ^2\left (c \left (d+e x^2\right )^p\right )+g x^2 \log ^2\left (c \left (d+e x^2\right )^p\right )\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {4 d^{3/2} g p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \log \left (c \left (d+e x^2\right )^p\right )}{3 e^{3/2}}+\frac {4 \sqrt {d} f p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \log \left (c \left (d+e x^2\right )^p\right )}{\sqrt {e}}-\frac {4 i d^{3/2} g p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )^2}{3 e^{3/2}}+\frac {32 d^{3/2} g p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{9 e^{3/2}}-\frac {8 d^{3/2} g p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \log \left (\frac {2 \sqrt {d}}{\sqrt {d}+i \sqrt {e} x}\right )}{3 e^{3/2}}+\frac {4 i \sqrt {d} f p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )^2}{\sqrt {e}}-\frac {8 \sqrt {d} f p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {e}}+\frac {8 \sqrt {d} f p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \log \left (\frac {2 \sqrt {d}}{\sqrt {d}+i \sqrt {e} x}\right )}{\sqrt {e}}+f x \log ^2\left (c \left (d+e x^2\right )^p\right )-4 f p x \log \left (c \left (d+e x^2\right )^p\right )+\frac {4 d g p x \log \left (c \left (d+e x^2\right )^p\right )}{3 e}+\frac {1}{3} g x^3 \log ^2\left (c \left (d+e x^2\right )^p\right )-\frac {4}{9} g p x^3 \log \left (c \left (d+e x^2\right )^p\right )-\frac {4 i d^{3/2} g p^2 \operatorname {PolyLog}\left (2,1-\frac {2 \sqrt {d}}{i \sqrt {e} x+\sqrt {d}}\right )}{3 e^{3/2}}+\frac {4 i \sqrt {d} f p^2 \operatorname {PolyLog}\left (2,1-\frac {2 \sqrt {d}}{i \sqrt {e} x+\sqrt {d}}\right )}{\sqrt {e}}-\frac {32 d g p^2 x}{9 e}+8 f p^2 x+\frac {8}{27} g p^2 x^3\)

Input:

Int[(f + g*x^2)*Log[c*(d + e*x^2)^p]^2,x]
 

Output:

8*f*p^2*x - (32*d*g*p^2*x)/(9*e) + (8*g*p^2*x^3)/27 - (8*Sqrt[d]*f*p^2*Arc 
Tan[(Sqrt[e]*x)/Sqrt[d]])/Sqrt[e] + (32*d^(3/2)*g*p^2*ArcTan[(Sqrt[e]*x)/S 
qrt[d]])/(9*e^(3/2)) + ((4*I)*Sqrt[d]*f*p^2*ArcTan[(Sqrt[e]*x)/Sqrt[d]]^2) 
/Sqrt[e] - (((4*I)/3)*d^(3/2)*g*p^2*ArcTan[(Sqrt[e]*x)/Sqrt[d]]^2)/e^(3/2) 
 + (8*Sqrt[d]*f*p^2*ArcTan[(Sqrt[e]*x)/Sqrt[d]]*Log[(2*Sqrt[d])/(Sqrt[d] + 
 I*Sqrt[e]*x)])/Sqrt[e] - (8*d^(3/2)*g*p^2*ArcTan[(Sqrt[e]*x)/Sqrt[d]]*Log 
[(2*Sqrt[d])/(Sqrt[d] + I*Sqrt[e]*x)])/(3*e^(3/2)) - 4*f*p*x*Log[c*(d + e* 
x^2)^p] + (4*d*g*p*x*Log[c*(d + e*x^2)^p])/(3*e) - (4*g*p*x^3*Log[c*(d + e 
*x^2)^p])/9 + (4*Sqrt[d]*f*p*ArcTan[(Sqrt[e]*x)/Sqrt[d]]*Log[c*(d + e*x^2) 
^p])/Sqrt[e] - (4*d^(3/2)*g*p*ArcTan[(Sqrt[e]*x)/Sqrt[d]]*Log[c*(d + e*x^2 
)^p])/(3*e^(3/2)) + f*x*Log[c*(d + e*x^2)^p]^2 + (g*x^3*Log[c*(d + e*x^2)^ 
p]^2)/3 + ((4*I)*Sqrt[d]*f*p^2*PolyLog[2, 1 - (2*Sqrt[d])/(Sqrt[d] + I*Sqr 
t[e]*x)])/Sqrt[e] - (((4*I)/3)*d^(3/2)*g*p^2*PolyLog[2, 1 - (2*Sqrt[d])/(S 
qrt[d] + I*Sqrt[e]*x)])/e^(3/2)
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2921
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*((f_) + 
 (g_.)*(x_)^(s_))^(r_.), x_Symbol] :> With[{t = ExpandIntegrand[(a + b*Log[ 
c*(d + e*x^n)^p])^q, (f + g*x^s)^r, x]}, Int[t, x] /; SumQ[t]] /; FreeQ[{a, 
 b, c, d, e, f, g, n, p, q, r, s}, x] && IntegerQ[n] && IGtQ[q, 0] && Integ 
erQ[r] && IntegerQ[s] && (EqQ[q, 1] || (GtQ[r, 0] && GtQ[s, 1]) || (LtQ[s, 
0] && LtQ[r, 0]))
 
Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 1.15 (sec) , antiderivative size = 729, normalized size of antiderivative = 1.33

method result size
risch \(\text {Expression too large to display}\) \(729\)

Input:

int((g*x^2+f)*ln(c*(e*x^2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/e^2/ 
(d*e)^(1/2)*arctan(x*e/(d*e)^(1/2))))+1/4*(I*Pi*csgn(I*(e*x^2+d)^p)*csgn(I 
*c*(e*x^2+d)^p)^2-I*Pi*csgn(I*(e*x^2+d)^p)*csgn(I*c*(e*x^2+d)^p)*csgn(I*c) 
-I*Pi*csgn(I*c*(e*x^2+d)^p)^3+I*Pi*csgn(I*c*(e*x^2+d)^p)^2*csgn(I*c)+2*ln( 
c))^2*(1/3*g*x^3+f*x)
 

Fricas [F]

\[ \int \left (f+g x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=\int { {\left (g x^{2} + f\right )} \log \left ({\left (e x^{2} + d\right )}^{p} c\right )^{2} \,d x } \] Input:

integrate((g*x^2+f)*log(c*(e*x^2+d)^p)^2,x, algorithm="fricas")
 

Output:

integral((g*x^2 + f)*log((e*x^2 + d)^p*c)^2, x)
 

Sympy [F]

\[ \int \left (f+g x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=\int \left (f + g x^{2}\right ) \log {\left (c \left (d + e x^{2}\right )^{p} \right )}^{2}\, dx \] Input:

integrate((g*x**2+f)*ln(c*(e*x**2+d)**p)**2,x)
 

Output:

Integral((f + g*x**2)*log(c*(d + e*x**2)**p)**2, x)
 

Maxima [F(-2)]

Exception generated. \[ \int \left (f+g x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=\text {Exception raised: ValueError} \] Input:

integrate((g*x^2+f)*log(c*(e*x^2+d)^p)^2,x, algorithm="maxima")
 

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(e>0)', see `assume?` for more de 
tails)Is e
 

Giac [F]

\[ \int \left (f+g x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=\int { {\left (g x^{2} + f\right )} \log \left ({\left (e x^{2} + d\right )}^{p} c\right )^{2} \,d x } \] Input:

integrate((g*x^2+f)*log(c*(e*x^2+d)^p)^2,x, algorithm="giac")
 

Output:

integrate((g*x^2 + f)*log((e*x^2 + d)^p*c)^2, x)
                                                                                    
                                                                                    
 

Mupad [F(-1)]

Timed out. \[ \int \left (f+g x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=\int {\ln \left (c\,{\left (e\,x^2+d\right )}^p\right )}^2\,\left (g\,x^2+f\right ) \,d x \] Input:

int(log(c*(d + e*x^2)^p)^2*(f + g*x^2),x)
 

Output:

int(log(c*(d + e*x^2)^p)^2*(f + g*x^2), x)
 

Reduce [F]

\[ \int \left (f+g x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=\frac {96 \sqrt {e}\, \sqrt {d}\, \mathit {atan} \left (\frac {e x}{\sqrt {e}\, \sqrt {d}}\right ) d g \,p^{2}-216 \sqrt {e}\, \sqrt {d}\, \mathit {atan} \left (\frac {e x}{\sqrt {e}\, \sqrt {d}}\right ) e f \,p^{2}-36 \left (\int \frac {\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right )}{e \,x^{2}+d}d x \right ) d^{2} e g p +108 \left (\int \frac {\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right )}{e \,x^{2}+d}d x \right ) d \,e^{2} f p +27 {\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right )}^{2} e^{2} f x +9 {\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right )}^{2} e^{2} g \,x^{3}+36 \,\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right ) d e g p x -108 \,\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right ) e^{2} f p x -12 \,\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right ) e^{2} g p \,x^{3}-96 d e g \,p^{2} x +216 e^{2} f \,p^{2} x +8 e^{2} g \,p^{2} x^{3}}{27 e^{2}} \] Input:

int((g*x^2+f)*log(c*(e*x^2+d)^p)^2,x)
 

Output:

(96*sqrt(e)*sqrt(d)*atan((e*x)/(sqrt(e)*sqrt(d)))*d*g*p**2 - 216*sqrt(e)*s 
qrt(d)*atan((e*x)/(sqrt(e)*sqrt(d)))*e*f*p**2 - 36*int(log((d + e*x**2)**p 
*c)/(d + e*x**2),x)*d**2*e*g*p + 108*int(log((d + e*x**2)**p*c)/(d + e*x** 
2),x)*d*e**2*f*p + 27*log((d + e*x**2)**p*c)**2*e**2*f*x + 9*log((d + e*x* 
*2)**p*c)**2*e**2*g*x**3 + 36*log((d + e*x**2)**p*c)*d*e*g*p*x - 108*log(( 
d + e*x**2)**p*c)*e**2*f*p*x - 12*log((d + e*x**2)**p*c)*e**2*g*p*x**3 - 9 
6*d*e*g*p**2*x + 216*e**2*f*p**2*x + 8*e**2*g*p**2*x**3)/(27*e**2)