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

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 = 395 \[ \int \left (f+g x^3\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=8 f p^2 x-\frac {d g p^2 x^2}{e}+\frac {g p^2 \left (d+e x^2\right )^2}{8 e^2}-\frac {8 \sqrt {d} f p^2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {e}}+\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 ) \log \left (\frac {2 \sqrt {d}}{\sqrt {d}+i \sqrt {e} x}\right )}{\sqrt {e}}-4 f p x \log \left (c \left (d+e x^2\right )^p\right )+\frac {d g p \left (d+e x^2\right ) \log \left (c \left (d+e x^2\right )^p\right )}{e^2}-\frac {g p \left (d+e x^2\right )^2 \log \left (c \left (d+e x^2\right )^p\right )}{4 e^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}}+f x \log ^2\left (c \left (d+e x^2\right )^p\right )-\frac {d g \left (d+e x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right )}{2 e^2}+\frac {g \left (d+e x^2\right )^2 \log ^2\left (c \left (d+e x^2\right )^p\right )}{4 e^2}+\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}} \] Output:

8*f*p^2*x-d*g*p^2*x^2/e+1/8*g*p^2*(e*x^2+d)^2/e^2-8*d^(1/2)*f*p^2*arctan(e 
^(1/2)*x/d^(1/2))/e^(1/2)+4*I*d^(1/2)*f*p^2*arctan(e^(1/2)*x/d^(1/2))^2/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)-4*f*p*x*ln(c*(e*x^2+d)^p)+d*g*p*(e*x^2+d)*ln(c*(e*x^2+d) 
^p)/e^2-1/4*g*p*(e*x^2+d)^2*ln(c*(e*x^2+d)^p)/e^2+4*d^(1/2)*f*p*arctan(e^( 
1/2)*x/d^(1/2))*ln(c*(e*x^2+d)^p)/e^(1/2)+f*x*ln(c*(e*x^2+d)^p)^2-1/2*d*g* 
(e*x^2+d)*ln(c*(e*x^2+d)^p)^2/e^2+1/4*g*(e*x^2+d)^2*ln(c*(e*x^2+d)^p)^2/e^ 
2+4*I*d^(1/2)*f*p^2*polylog(2,1-2*d^(1/2)/(d^(1/2)+I*e^(1/2)*x))/e^(1/2)
 

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 398, normalized size of antiderivative = 1.01 \[ \int \left (f+g x^3\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=f x \log ^2\left (c \left (d+e x^2\right )^p\right )+\frac {1}{4} g x^4 \log ^2\left (c \left (d+e x^2\right )^p\right )-\frac {1}{2} g p \left (\frac {3 d p x^2}{2 e}-\frac {p x^4}{4}-\frac {d^2 p \log \left (d+e x^2\right )}{2 e^2}-\frac {d^2 \log \left (c \left (d+e x^2\right )^p\right )}{e^2}-\frac {d x^2 \log \left (c \left (d+e x^2\right )^p\right )}{e}+\frac {1}{2} x^4 \log \left (c \left (d+e x^2\right )^p\right )+\frac {d^2 \log ^2\left (c \left (d+e x^2\right )^p\right )}{2 e^2 p}\right )-4 e f p \left (-\frac {2 p x}{e}+\frac {2 \sqrt {d} p \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{e^{3/2}}+\frac {x \log \left (c \left (d+e x^2\right )^p\right )}{e}-\frac {\sqrt {d} \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \log \left (c \left (d+e x^2\right )^p\right )}{e^{3/2}}-\frac {\sqrt {d} p \left (\frac {i \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right )^2}{e}+\frac {2 \arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \log \left (\frac {2 i \sqrt {d}}{i \sqrt {d}-\sqrt {e} x}\right )}{e}+\frac {i \operatorname {PolyLog}\left (2,-\frac {i \sqrt {d}+\sqrt {e} x}{i \sqrt {d}-\sqrt {e} x}\right )}{e}\right )}{\sqrt {e}}\right ) \] Input:

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

Output:

f*x*Log[c*(d + e*x^2)^p]^2 + (g*x^4*Log[c*(d + e*x^2)^p]^2)/4 - (g*p*((3*d 
*p*x^2)/(2*e) - (p*x^4)/4 - (d^2*p*Log[d + e*x^2])/(2*e^2) - (d^2*Log[c*(d 
 + e*x^2)^p])/e^2 - (d*x^2*Log[c*(d + e*x^2)^p])/e + (x^4*Log[c*(d + e*x^2 
)^p])/2 + (d^2*Log[c*(d + e*x^2)^p]^2)/(2*e^2*p)))/2 - 4*e*f*p*((-2*p*x)/e 
 + (2*Sqrt[d]*p*ArcTan[(Sqrt[e]*x)/Sqrt[d]])/e^(3/2) + (x*Log[c*(d + e*x^2 
)^p])/e - (Sqrt[d]*ArcTan[(Sqrt[e]*x)/Sqrt[d]]*Log[c*(d + e*x^2)^p])/e^(3/ 
2) - (Sqrt[d]*p*((I*ArcTan[(Sqrt[e]*x)/Sqrt[d]]^2)/e + (2*ArcTan[(Sqrt[e]* 
x)/Sqrt[d]]*Log[((2*I)*Sqrt[d])/(I*Sqrt[d] - Sqrt[e]*x)])/e + (I*PolyLog[2 
, -((I*Sqrt[d] + Sqrt[e]*x)/(I*Sqrt[d] - Sqrt[e]*x))])/e))/Sqrt[e])
 

Rubi [A] (verified)

Time = 1.27 (sec) , antiderivative size = 395, 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^3\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^3 \log ^2\left (c \left (d+e x^2\right )^p\right )\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \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 \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}}+\frac {g \left (d+e x^2\right )^2 \log ^2\left (c \left (d+e x^2\right )^p\right )}{4 e^2}-\frac {d g \left (d+e x^2\right ) \log ^2\left (c \left (d+e x^2\right )^p\right )}{2 e^2}-\frac {g p \left (d+e x^2\right )^2 \log \left (c \left (d+e x^2\right )^p\right )}{4 e^2}+\frac {d g p \left (d+e x^2\right ) \log \left (c \left (d+e x^2\right )^p\right )}{e^2}+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 {g p^2 \left (d+e x^2\right )^2}{8 e^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 {d g p^2 x^2}{e}+8 f p^2 x\)

Input:

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

Output:

8*f*p^2*x - (d*g*p^2*x^2)/e + (g*p^2*(d + e*x^2)^2)/(8*e^2) - (8*Sqrt[d]*f 
*p^2*ArcTan[(Sqrt[e]*x)/Sqrt[d]])/Sqrt[e] + ((4*I)*Sqrt[d]*f*p^2*ArcTan[(S 
qrt[e]*x)/Sqrt[d]]^2)/Sqrt[e] + (8*Sqrt[d]*f*p^2*ArcTan[(Sqrt[e]*x)/Sqrt[d 
]]*Log[(2*Sqrt[d])/(Sqrt[d] + I*Sqrt[e]*x)])/Sqrt[e] - 4*f*p*x*Log[c*(d + 
e*x^2)^p] + (d*g*p*(d + e*x^2)*Log[c*(d + e*x^2)^p])/e^2 - (g*p*(d + e*x^2 
)^2*Log[c*(d + e*x^2)^p])/(4*e^2) + (4*Sqrt[d]*f*p*ArcTan[(Sqrt[e]*x)/Sqrt 
[d]]*Log[c*(d + e*x^2)^p])/Sqrt[e] + f*x*Log[c*(d + e*x^2)^p]^2 - (d*g*(d 
+ e*x^2)*Log[c*(d + e*x^2)^p]^2)/(2*e^2) + (g*(d + e*x^2)^2*Log[c*(d + e*x 
^2)^p]^2)/(4*e^2) + ((4*I)*Sqrt[d]*f*p^2*PolyLog[2, 1 - (2*Sqrt[d])/(Sqrt[ 
d] + I*Sqrt[e]*x)])/Sqrt[e]
 

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 = 2.38 (sec) , antiderivative size = 724, normalized size of antiderivative = 1.83

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

Input:

int((g*x^3+f)*ln(c*(e*x^2+d)^p)^2,x,method=_RETURNVERBOSE)
 

Output:

1/4*ln((e*x^2+d)^p)^2*x^4*g+ln((e*x^2+d)^p)^2*x*f-1/4*p*g*x^4*ln((e*x^2+d) 
^p)+1/2/e*p*d*g*x^2*ln((e*x^2+d)^p)-4*p*f*x*ln((e*x^2+d)^p)+1/2/e^2*p^2*d^ 
2*g*ln(e*x^2+d)^2-1/2/e^2*p*d^2*g*ln(e*x^2+d)*ln((e*x^2+d)^p)-4*p^2*d/(d*e 
)^(1/2)*arctan(x*e/(d*e)^(1/2))*f*ln(e*x^2+d)+4*p*d/(d*e)^(1/2)*arctan(x*e 
/(d*e)^(1/2))*f*ln((e*x^2+d)^p)+1/8*p^2*g*x^4-3/4*d*g*p^2*x^2/e+3/4/e^2*p^ 
2*d^2*g*ln(e*x^2+d)+8*f*p^2*x-8*p^2*d/(d*e)^(1/2)*arctan(x*e/(d*e)^(1/2))* 
f-e*p^2*Sum(1/2*(ln(x-_alpha)*ln(e*x^2+d)-2*e*(1/4/_alpha/e*ln(x-_alpha)^2 
+1/2*_alpha/d*ln(x-_alpha)*ln(1/2*(x+_alpha)/_alpha)+1/2*_alpha/d*dilog(1/ 
2*(x+_alpha)/_alpha)))*d*(_alpha*d*g-4*e*f)/e^3/_alpha,_alpha=RootOf(_Z^2* 
e+d))+(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*c 
sgn(I*c*(e*x^2+d)^p)^2*csgn(I*c)+2*ln(c))*(1/4*ln((e*x^2+d)^p)*x^4*g+ln((e 
*x^2+d)^p)*x*f-1/2*e*p*(1/e^2*(1/4*e*g*x^4-1/2*d*g*x^2+4*e*f*x)+d/e^2*(1/2 
*d*g/e*ln(e*x^2+d)-4*e*f/(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/4*g*x^4+f*x)
 

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F(-2)]

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

integrate((g*x^3+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^3\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=\int { {\left (g x^{3} + f\right )} \log \left ({\left (e x^{2} + d\right )}^{p} c\right )^{2} \,d x } \] Input:

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

Output:

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

Mupad [F(-1)]

Timed out. \[ \int \left (f+g x^3\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^3+f\right ) \,d x \] Input:

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

Output:

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

Reduce [F]

\[ \int \left (f+g x^3\right ) \log ^2\left (c \left (d+e x^2\right )^p\right ) \, dx=\frac {-64 \sqrt {e}\, \sqrt {d}\, \mathit {atan} \left (\frac {e x}{\sqrt {e}\, \sqrt {d}}\right ) e f \,p^{2}+32 \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 -2 {\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right )}^{2} d^{2} g +8 {\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right )}^{2} e^{2} f x +2 {\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right )}^{2} e^{2} g \,x^{4}+6 \,\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right ) d^{2} g p +4 \,\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right ) d e g p \,x^{2}-32 \,\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right ) e^{2} f p x -2 \,\mathrm {log}\left (\left (e \,x^{2}+d \right )^{p} c \right ) e^{2} g p \,x^{4}-6 d e g \,p^{2} x^{2}+64 e^{2} f \,p^{2} x +e^{2} g \,p^{2} x^{4}}{8 e^{2}} \] Input:

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

Output:

( - 64*sqrt(e)*sqrt(d)*atan((e*x)/(sqrt(e)*sqrt(d)))*e*f*p**2 + 32*int(log 
((d + e*x**2)**p*c)/(d + e*x**2),x)*d*e**2*f*p - 2*log((d + e*x**2)**p*c)* 
*2*d**2*g + 8*log((d + e*x**2)**p*c)**2*e**2*f*x + 2*log((d + e*x**2)**p*c 
)**2*e**2*g*x**4 + 6*log((d + e*x**2)**p*c)*d**2*g*p + 4*log((d + e*x**2)* 
*p*c)*d*e*g*p*x**2 - 32*log((d + e*x**2)**p*c)*e**2*f*p*x - 2*log((d + e*x 
**2)**p*c)*e**2*g*p*x**4 - 6*d*e*g*p**2*x**2 + 64*e**2*f*p**2*x + e**2*g*p 
**2*x**4)/(8*e**2)