\(\int \frac {(a+b \log (c x^n))^2}{d+e x^2} \, dx\) [2]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [F(-2)]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 22, antiderivative size = 193 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{d+e x^2} \, dx=\frac {\arctan \left (\frac {\sqrt {e} x}{\sqrt {d}}\right ) \left (a+b \log \left (c x^n\right )\right )^2}{\sqrt {d} \sqrt {e}}-\frac {b n \left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {\sqrt {e} x}{\sqrt {-d}}\right )}{\sqrt {-d} \sqrt {e}}+\frac {b n \left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (2,\frac {\sqrt {e} x}{\sqrt {-d}}\right )}{\sqrt {-d} \sqrt {e}}+\frac {b^2 n^2 \operatorname {PolyLog}\left (3,-\frac {\sqrt {e} x}{\sqrt {-d}}\right )}{\sqrt {-d} \sqrt {e}}-\frac {b^2 n^2 \operatorname {PolyLog}\left (3,\frac {\sqrt {e} x}{\sqrt {-d}}\right )}{\sqrt {-d} \sqrt {e}} \] Output:

arctan(e^(1/2)*x/d^(1/2))*(a+b*ln(c*x^n))^2/d^(1/2)/e^(1/2)-b*n*(a+b*ln(c* 
x^n))*polylog(2,-e^(1/2)*x/(-d)^(1/2))/(-d)^(1/2)/e^(1/2)+b*n*(a+b*ln(c*x^ 
n))*polylog(2,e^(1/2)*x/(-d)^(1/2))/(-d)^(1/2)/e^(1/2)+b^2*n^2*polylog(3,- 
e^(1/2)*x/(-d)^(1/2))/(-d)^(1/2)/e^(1/2)-b^2*n^2*polylog(3,e^(1/2)*x/(-d)^ 
(1/2))/(-d)^(1/2)/e^(1/2)
 

Mathematica [A] (verified)

Time = 0.20 (sec) , antiderivative size = 185, normalized size of antiderivative = 0.96 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{d+e x^2} \, dx=\frac {-\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+\frac {\sqrt {e} x}{\sqrt {-d}}\right )+\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+\frac {d \sqrt {e} x}{(-d)^{3/2}}\right )+2 b n \left (\left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (2,\frac {\sqrt {e} x}{\sqrt {-d}}\right )-b n \operatorname {PolyLog}\left (3,\frac {\sqrt {e} x}{\sqrt {-d}}\right )\right )-2 b n \left (\left (a+b \log \left (c x^n\right )\right ) \operatorname {PolyLog}\left (2,\frac {d \sqrt {e} x}{(-d)^{3/2}}\right )-b n \operatorname {PolyLog}\left (3,\frac {d \sqrt {e} x}{(-d)^{3/2}}\right )\right )}{2 \sqrt {-d} \sqrt {e}} \] Input:

Integrate[(a + b*Log[c*x^n])^2/(d + e*x^2),x]
 

Output:

(-((a + b*Log[c*x^n])^2*Log[1 + (Sqrt[e]*x)/Sqrt[-d]]) + (a + b*Log[c*x^n] 
)^2*Log[1 + (d*Sqrt[e]*x)/(-d)^(3/2)] + 2*b*n*((a + b*Log[c*x^n])*PolyLog[ 
2, (Sqrt[e]*x)/Sqrt[-d]] - b*n*PolyLog[3, (Sqrt[e]*x)/Sqrt[-d]]) - 2*b*n*( 
(a + b*Log[c*x^n])*PolyLog[2, (d*Sqrt[e]*x)/(-d)^(3/2)] - b*n*PolyLog[3, ( 
d*Sqrt[e]*x)/(-d)^(3/2)]))/(2*Sqrt[-d]*Sqrt[e])
 

Rubi [A] (verified)

Time = 0.50 (sec) , antiderivative size = 248, normalized size of antiderivative = 1.28, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {2767, 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 \frac {\left (a+b \log \left (c x^n\right )\right )^2}{d+e x^2} \, dx\)

\(\Big \downarrow \) 2767

\(\displaystyle \int \left (\frac {\sqrt {-d} \left (a+b \log \left (c x^n\right )\right )^2}{2 d \left (\sqrt {-d}-\sqrt {e} x\right )}+\frac {\sqrt {-d} \left (a+b \log \left (c x^n\right )\right )^2}{2 d \left (\sqrt {-d}+\sqrt {e} x\right )}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {b n \operatorname {PolyLog}\left (2,-\frac {\sqrt {e} x}{\sqrt {-d}}\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt {-d} \sqrt {e}}+\frac {b n \operatorname {PolyLog}\left (2,\frac {\sqrt {e} x}{\sqrt {-d}}\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt {-d} \sqrt {e}}+\frac {\log \left (1-\frac {\sqrt {e} x}{\sqrt {-d}}\right ) \left (a+b \log \left (c x^n\right )\right )^2}{2 \sqrt {-d} \sqrt {e}}-\frac {\log \left (\frac {\sqrt {e} x}{\sqrt {-d}}+1\right ) \left (a+b \log \left (c x^n\right )\right )^2}{2 \sqrt {-d} \sqrt {e}}+\frac {b^2 n^2 \operatorname {PolyLog}\left (3,-\frac {\sqrt {e} x}{\sqrt {-d}}\right )}{\sqrt {-d} \sqrt {e}}-\frac {b^2 n^2 \operatorname {PolyLog}\left (3,\frac {\sqrt {e} x}{\sqrt {-d}}\right )}{\sqrt {-d} \sqrt {e}}\)

Input:

Int[(a + b*Log[c*x^n])^2/(d + e*x^2),x]
 

Output:

((a + b*Log[c*x^n])^2*Log[1 - (Sqrt[e]*x)/Sqrt[-d]])/(2*Sqrt[-d]*Sqrt[e]) 
- ((a + b*Log[c*x^n])^2*Log[1 + (Sqrt[e]*x)/Sqrt[-d]])/(2*Sqrt[-d]*Sqrt[e] 
) - (b*n*(a + b*Log[c*x^n])*PolyLog[2, -((Sqrt[e]*x)/Sqrt[-d])])/(Sqrt[-d] 
*Sqrt[e]) + (b*n*(a + b*Log[c*x^n])*PolyLog[2, (Sqrt[e]*x)/Sqrt[-d]])/(Sqr 
t[-d]*Sqrt[e]) + (b^2*n^2*PolyLog[3, -((Sqrt[e]*x)/Sqrt[-d])])/(Sqrt[-d]*S 
qrt[e]) - (b^2*n^2*PolyLog[3, (Sqrt[e]*x)/Sqrt[-d]])/(Sqrt[-d]*Sqrt[e])
 

Defintions of rubi rules used

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

rule 2767
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_)^(r_.))^( 
q_.), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (d + e*x 
^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n, p, q, r}, x] 
&& IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[r]))
 
Maple [F]

\[\int \frac {{\left (a +b \ln \left (c \,x^{n}\right )\right )}^{2}}{e \,x^{2}+d}d x\]

Input:

int((a+b*ln(c*x^n))^2/(e*x^2+d),x)
 

Output:

int((a+b*ln(c*x^n))^2/(e*x^2+d),x)
 

Fricas [F]

\[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{d+e x^2} \, dx=\int { \frac {{\left (b \log \left (c x^{n}\right ) + a\right )}^{2}}{e x^{2} + d} \,d x } \] Input:

integrate((a+b*log(c*x^n))^2/(e*x^2+d),x, algorithm="fricas")
 

Output:

integral((b^2*log(c*x^n)^2 + 2*a*b*log(c*x^n) + a^2)/(e*x^2 + d), x)
 

Sympy [F]

\[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{d+e x^2} \, dx=\int \frac {\left (a + b \log {\left (c x^{n} \right )}\right )^{2}}{d + e x^{2}}\, dx \] Input:

integrate((a+b*ln(c*x**n))**2/(e*x**2+d),x)
 

Output:

Integral((a + b*log(c*x**n))**2/(d + e*x**2), x)
 

Maxima [F(-2)]

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

integrate((a+b*log(c*x^n))^2/(e*x^2+d),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 \frac {\left (a+b \log \left (c x^n\right )\right )^2}{d+e x^2} \, dx=\int { \frac {{\left (b \log \left (c x^{n}\right ) + a\right )}^{2}}{e x^{2} + d} \,d x } \] Input:

integrate((a+b*log(c*x^n))^2/(e*x^2+d),x, algorithm="giac")
 

Output:

integrate((b*log(c*x^n) + a)^2/(e*x^2 + d), x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{d+e x^2} \, dx=\int \frac {{\left (a+b\,\ln \left (c\,x^n\right )\right )}^2}{e\,x^2+d} \,d x \] Input:

int((a + b*log(c*x^n))^2/(d + e*x^2),x)
 

Output:

int((a + b*log(c*x^n))^2/(d + e*x^2), x)
 

Reduce [F]

\[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{d+e x^2} \, dx=\frac {\sqrt {e}\, \sqrt {d}\, \mathit {atan} \left (\frac {e x}{\sqrt {e}\, \sqrt {d}}\right ) a^{2}+\left (\int \frac {\mathrm {log}\left (x^{n} c \right )^{2}}{e \,x^{2}+d}d x \right ) b^{2} d e +2 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )}{e \,x^{2}+d}d x \right ) a b d e}{d e} \] Input:

int((a+b*log(c*x^n))^2/(e*x^2+d),x)
 

Output:

(sqrt(e)*sqrt(d)*atan((e*x)/(sqrt(e)*sqrt(d)))*a**2 + int(log(x**n*c)**2/( 
d + e*x**2),x)*b**2*d*e + 2*int(log(x**n*c)/(d + e*x**2),x)*a*b*d*e)/(d*e)