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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [F]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 32 \[ \int \frac {1}{a x+b x \log ^2\left (c x^n\right )} \, dx=\frac {\arctan \left (\frac {\sqrt {b} \log \left (c x^n\right )}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b} n} \]

[Out]

arctan(ln(c*x^n)*b^(1/2)/a^(1/2))/n/a^(1/2)/b^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.059, Rules used = {211} \[ \int \frac {1}{a x+b x \log ^2\left (c x^n\right )} \, dx=\frac {\arctan \left (\frac {\sqrt {b} \log \left (c x^n\right )}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b} n} \]

[In]

Int[(a*x + b*x*Log[c*x^n]^2)^(-1),x]

[Out]

ArcTan[(Sqrt[b]*Log[c*x^n])/Sqrt[a]]/(Sqrt[a]*Sqrt[b]*n)

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\log \left (c x^n\right )\right )}{n} \\ & = \frac {\tan ^{-1}\left (\frac {\sqrt {b} \log \left (c x^n\right )}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b} n} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00 \[ \int \frac {1}{a x+b x \log ^2\left (c x^n\right )} \, dx=\frac {\arctan \left (\frac {\sqrt {b} \log \left (c x^n\right )}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {b} n} \]

[In]

Integrate[(a*x + b*x*Log[c*x^n]^2)^(-1),x]

[Out]

ArcTan[(Sqrt[b]*Log[c*x^n])/Sqrt[a]]/(Sqrt[a]*Sqrt[b]*n)

Maple [A] (verified)

Time = 0.66 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.75

method result size
default \(\frac {\arctan \left (\frac {b \ln \left (c \,x^{n}\right )}{\sqrt {a b}}\right )}{n \sqrt {a b}}\) \(24\)
risch \(-\frac {\ln \left (\ln \left (x^{n}\right )+\frac {-i \pi \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \sqrt {-a b}+i \pi \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \sqrt {-a b}+i \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \sqrt {-a b}-i \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3} \sqrt {-a b}+2 \ln \left (c \right ) \sqrt {-a b}-2 a}{2 \sqrt {-a b}}\right )}{2 \sqrt {-a b}\, n}+\frac {\ln \left (\ln \left (x^{n}\right )+\frac {-i \pi \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \sqrt {-a b}+i \pi \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \sqrt {-a b}+i \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \sqrt {-a b}-i \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3} \sqrt {-a b}+2 \ln \left (c \right ) \sqrt {-a b}+2 a}{2 \sqrt {-a b}}\right )}{2 \sqrt {-a b}\, n}\) \(284\)

[In]

int(1/(a*x+b*x*ln(c*x^n)^2),x,method=_RETURNVERBOSE)

[Out]

1/n/(a*b)^(1/2)*arctan(b*ln(c*x^n)/(a*b)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 121, normalized size of antiderivative = 3.78 \[ \int \frac {1}{a x+b x \log ^2\left (c x^n\right )} \, dx=\left [-\frac {\sqrt {-a b} \log \left (\frac {b n^{2} \log \left (x\right )^{2} + 2 \, b n \log \left (c\right ) \log \left (x\right ) + b \log \left (c\right )^{2} - 2 \, \sqrt {-a b} {\left (n \log \left (x\right ) + \log \left (c\right )\right )} - a}{b n^{2} \log \left (x\right )^{2} + 2 \, b n \log \left (c\right ) \log \left (x\right ) + b \log \left (c\right )^{2} + a}\right )}{2 \, a b n}, \frac {\sqrt {a b} \arctan \left (\frac {\sqrt {a b} {\left (n \log \left (x\right ) + \log \left (c\right )\right )}}{a}\right )}{a b n}\right ] \]

[In]

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

[Out]

[-1/2*sqrt(-a*b)*log((b*n^2*log(x)^2 + 2*b*n*log(c)*log(x) + b*log(c)^2 - 2*sqrt(-a*b)*(n*log(x) + log(c)) - a
)/(b*n^2*log(x)^2 + 2*b*n*log(c)*log(x) + b*log(c)^2 + a))/(a*b*n), sqrt(a*b)*arctan(sqrt(a*b)*(n*log(x) + log
(c))/a)/(a*b*n)]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 99 vs. \(2 (29) = 58\).

Time = 2.21 (sec) , antiderivative size = 99, normalized size of antiderivative = 3.09 \[ \int \frac {1}{a x+b x \log ^2\left (c x^n\right )} \, dx=\begin {cases} \frac {\tilde {\infty } \log {\left (x \right )}}{\log {\left (c \right )}^{2}} & \text {for}\: a = 0 \wedge b = 0 \wedge n = 0 \\\frac {\log {\left (x \right )}}{a} & \text {for}\: b = 0 \\\frac {\log {\left (x \right )}}{a + b \log {\left (c \right )}^{2}} & \text {for}\: n = 0 \\- \frac {1}{b n \log {\left (c x^{n} \right )}} & \text {for}\: a = 0 \\\frac {\log {\left (- \sqrt {- \frac {a}{b}} + \log {\left (c x^{n} \right )} \right )}}{2 b n \sqrt {- \frac {a}{b}}} - \frac {\log {\left (\sqrt {- \frac {a}{b}} + \log {\left (c x^{n} \right )} \right )}}{2 b n \sqrt {- \frac {a}{b}}} & \text {otherwise} \end {cases} \]

[In]

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

[Out]

Piecewise((zoo*log(x)/log(c)**2, Eq(a, 0) & Eq(b, 0) & Eq(n, 0)), (log(x)/a, Eq(b, 0)), (log(x)/(a + b*log(c)*
*2), Eq(n, 0)), (-1/(b*n*log(c*x**n)), Eq(a, 0)), (log(-sqrt(-a/b) + log(c*x**n))/(2*b*n*sqrt(-a/b)) - log(sqr
t(-a/b) + log(c*x**n))/(2*b*n*sqrt(-a/b)), True))

Maxima [F]

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

[In]

integrate(1/(a*x+b*x*log(c*x^n)^2),x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.81 \[ \int \frac {1}{a x+b x \log ^2\left (c x^n\right )} \, dx=\frac {\arctan \left (\frac {b n \log \left (x\right ) + b \log \left (c\right )}{\sqrt {a b}}\right )}{\sqrt {a b} n} \]

[In]

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

[Out]

arctan((b*n*log(x) + b*log(c))/sqrt(a*b))/(sqrt(a*b)*n)

Mupad [B] (verification not implemented)

Time = 1.63 (sec) , antiderivative size = 71, normalized size of antiderivative = 2.22 \[ \int \frac {1}{a x+b x \log ^2\left (c x^n\right )} \, dx=-\frac {\ln \left (\frac {1}{b\,x}+\frac {\ln \left (c\,x^n\right )}{\sqrt {-a}\,\sqrt {b}\,x}\right )-\ln \left (\frac {1}{b\,x}-\frac {\ln \left (c\,x^n\right )}{\sqrt {-a}\,\sqrt {b}\,x}\right )}{2\,\sqrt {-a}\,\sqrt {b}\,n} \]

[In]

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

[Out]

-(log(1/(b*x) + log(c*x^n)/((-a)^(1/2)*b^(1/2)*x)) - log(1/(b*x) - log(c*x^n)/((-a)^(1/2)*b^(1/2)*x)))/(2*(-a)
^(1/2)*b^(1/2)*n)