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

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

Optimal result

Integrand size = 18, antiderivative size = 60 \[ \int \frac {\log \left (c \left (1+x^2\right )^n\right )}{1+x^2} \, dx=i n \arctan (x)^2+2 n \arctan (x) \log \left (\frac {2}{1+i x}\right )+\arctan (x) \log \left (c \left (1+x^2\right )^n\right )+i n \operatorname {PolyLog}\left (2,1-\frac {2}{1+i x}\right ) \] Output:

I*n*arctan(x)^2+2*n*arctan(x)*ln(2/(1+I*x))+arctan(x)*ln(c*(x^2+1)^n)+I*n* 
polylog(2,1-2/(1+I*x))
 

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.03 \[ \int \frac {\log \left (c \left (1+x^2\right )^n\right )}{1+x^2} \, dx=i n \arctan (x)^2+2 n \arctan (x) \log \left (\frac {2 i}{i-x}\right )+\arctan (x) \log \left (c \left (1+x^2\right )^n\right )+i n \operatorname {PolyLog}\left (2,\frac {i+x}{-i+x}\right ) \] Input:

Integrate[Log[c*(1 + x^2)^n]/(1 + x^2),x]
 

Output:

I*n*ArcTan[x]^2 + 2*n*ArcTan[x]*Log[(2*I)/(I - x)] + ArcTan[x]*Log[c*(1 + 
x^2)^n] + I*n*PolyLog[2, (I + x)/(-I + x)]
 

Rubi [A] (verified)

Time = 0.43 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.08, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {2920, 5455, 5379, 2849, 2752}

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 {\log \left (c \left (x^2+1\right )^n\right )}{x^2+1} \, dx\)

\(\Big \downarrow \) 2920

\(\displaystyle \arctan (x) \log \left (c \left (x^2+1\right )^n\right )-2 n \int \frac {x \arctan (x)}{x^2+1}dx\)

\(\Big \downarrow \) 5455

\(\displaystyle \arctan (x) \log \left (c \left (x^2+1\right )^n\right )-2 n \left (-\int \frac {\arctan (x)}{i-x}dx-\frac {1}{2} i \arctan (x)^2\right )\)

\(\Big \downarrow \) 5379

\(\displaystyle \arctan (x) \log \left (c \left (x^2+1\right )^n\right )-2 n \left (\int \frac {\log \left (\frac {2}{i x+1}\right )}{x^2+1}dx-\frac {1}{2} i \arctan (x)^2-\arctan (x) \log \left (\frac {2}{1+i x}\right )\right )\)

\(\Big \downarrow \) 2849

\(\displaystyle \arctan (x) \log \left (c \left (x^2+1\right )^n\right )-2 n \left (-i \int \frac {\log \left (\frac {2}{i x+1}\right )}{1-\frac {2}{i x+1}}d\frac {1}{i x+1}-\frac {1}{2} i \arctan (x)^2-\arctan (x) \log \left (\frac {2}{1+i x}\right )\right )\)

\(\Big \downarrow \) 2752

\(\displaystyle \arctan (x) \log \left (c \left (x^2+1\right )^n\right )-2 n \left (-\frac {1}{2} i \arctan (x)^2-\arctan (x) \log \left (\frac {2}{1+i x}\right )-\frac {1}{2} i \operatorname {PolyLog}\left (2,1-\frac {2}{i x+1}\right )\right )\)

Input:

Int[Log[c*(1 + x^2)^n]/(1 + x^2),x]
 

Output:

ArcTan[x]*Log[c*(1 + x^2)^n] - 2*n*((-1/2*I)*ArcTan[x]^2 - ArcTan[x]*Log[2 
/(1 + I*x)] - (I/2)*PolyLog[2, 1 - 2/(1 + I*x)])
 

Defintions of rubi rules used

rule 2752
Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-e^(-1))*PolyLo 
g[2, 1 - c*x], x] /; FreeQ[{c, d, e}, x] && EqQ[e + c*d, 0]
 

rule 2849
Int[Log[(c_.)/((d_) + (e_.)*(x_))]/((f_) + (g_.)*(x_)^2), x_Symbol] :> Simp 
[-e/g   Subst[Int[Log[2*d*x]/(1 - 2*d*x), x], x, 1/(d + e*x)], x] /; FreeQ[ 
{c, d, e, f, g}, x] && EqQ[c, 2*d] && EqQ[e^2*f + d^2*g, 0]
 

rule 2920
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))/((f_) + (g_.) 
*(x_)^2), x_Symbol] :> With[{u = IntHide[1/(f + g*x^2), x]}, Simp[u*(a + b* 
Log[c*(d + e*x^n)^p]), x] - Simp[b*e*n*p   Int[u*(x^(n - 1)/(d + e*x^n)), x 
], x]] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && IntegerQ[n]
 

rule 5379
Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] 
 :> Simp[(-(a + b*ArcTan[c*x])^p)*(Log[2/(1 + e*(x/d))]/e), x] + Simp[b*c*( 
p/e)   Int[(a + b*ArcTan[c*x])^(p - 1)*(Log[2/(1 + e*(x/d))]/(1 + c^2*x^2)) 
, x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[c^2*d^2 + e^2, 0 
]
 

rule 5455
Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*(x_))/((d_) + (e_.)*(x_)^2), 
x_Symbol] :> Simp[(-I)*((a + b*ArcTan[c*x])^(p + 1)/(b*e*(p + 1))), x] - Si 
mp[1/(c*d)   Int[(a + b*ArcTan[c*x])^p/(I - c*x), x], x] /; FreeQ[{a, b, c, 
 d, e}, x] && EqQ[e, c^2*d] && IGtQ[p, 0]
 
Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 128 vs. \(2 (56 ) = 112\).

Time = 0.51 (sec) , antiderivative size = 129, normalized size of antiderivative = 2.15

method result size
parts \(\arctan \left (x \right ) \ln \left (c \left (x^{2}+1\right )^{n}\right )-2 n \left (\frac {\arctan \left (x \right ) \ln \left (x^{2}+1\right )}{2}+\frac {i \left (\ln \left (x -i\right ) \ln \left (x^{2}+1\right )-\frac {\ln \left (x -i\right )^{2}}{2}-\operatorname {dilog}\left (-\frac {i \left (x +i\right )}{2}\right )-\ln \left (x -i\right ) \ln \left (-\frac {i \left (x +i\right )}{2}\right )\right )}{4}-\frac {i \left (\ln \left (x +i\right ) \ln \left (x^{2}+1\right )-\frac {\ln \left (x +i\right )^{2}}{2}-\operatorname {dilog}\left (\frac {i \left (x -i\right )}{2}\right )-\ln \left (x +i\right ) \ln \left (\frac {i \left (x -i\right )}{2}\right )\right )}{4}\right )\) \(129\)
risch \(\ln \left (\left (x^{2}+1\right )^{n}\right ) \arctan \left (x \right )-n \arctan \left (x \right ) \ln \left (x^{2}+1\right )-\frac {i n \ln \left (x -i\right ) \ln \left (x^{2}+1\right )}{2}+\frac {i n \ln \left (x -i\right )^{2}}{4}+\frac {i n \operatorname {dilog}\left (-\frac {i \left (x +i\right )}{2}\right )}{2}+\frac {i n \ln \left (x -i\right ) \ln \left (-\frac {i \left (x +i\right )}{2}\right )}{2}+\frac {i n \ln \left (x +i\right ) \ln \left (x^{2}+1\right )}{2}-\frac {i n \ln \left (x +i\right )^{2}}{4}-\frac {i n \operatorname {dilog}\left (\frac {i \left (x -i\right )}{2}\right )}{2}-\frac {i n \ln \left (x +i\right ) \ln \left (\frac {i \left (x -i\right )}{2}\right )}{2}+\left (\frac {i \pi \,\operatorname {csgn}\left (i \left (x^{2}+1\right )^{n}\right ) {\operatorname {csgn}\left (i c \left (x^{2}+1\right )^{n}\right )}^{2}}{2}-\frac {i \pi \,\operatorname {csgn}\left (i \left (x^{2}+1\right )^{n}\right ) \operatorname {csgn}\left (i c \left (x^{2}+1\right )^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}-\frac {i \pi {\operatorname {csgn}\left (i c \left (x^{2}+1\right )^{n}\right )}^{3}}{2}+\frac {i \pi {\operatorname {csgn}\left (i c \left (x^{2}+1\right )^{n}\right )}^{2} \operatorname {csgn}\left (i c \right )}{2}+\ln \left (c \right )\right ) \arctan \left (x \right )\) \(242\)

Input:

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

Output:

arctan(x)*ln(c*(x^2+1)^n)-2*n*(1/2*arctan(x)*ln(x^2+1)+1/4*I*(ln(x-I)*ln(x 
^2+1)-1/2*ln(x-I)^2-dilog(-1/2*I*(x+I))-ln(x-I)*ln(-1/2*I*(x+I)))-1/4*I*(l 
n(x+I)*ln(x^2+1)-1/2*ln(x+I)^2-dilog(1/2*I*(x-I))-ln(x+I)*ln(1/2*I*(x-I))) 
)
 

Fricas [F]

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

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

Output:

integral(log((x^2 + 1)^n*c)/(x^2 + 1), x)
 

Sympy [F]

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

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

Output:

Integral(log(c*(x**2 + 1)**n)/(x**2 + 1), x)
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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