\(\int \log ^2(a+b \tanh (c+d x)) \, dx\) [12]

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

Optimal result

Integrand size = 13, antiderivative size = 194 \[ \int \log ^2(a+b \tanh (c+d x)) \, dx=-\frac {\log \left (\frac {b (1-\tanh (c+d x))}{a+b}\right ) \log ^2(a+b \tanh (c+d x))}{2 d}+\frac {\log \left (-\frac {b (1+\tanh (c+d x))}{a-b}\right ) \log ^2(a+b \tanh (c+d x))}{2 d}+\frac {\log (a+b \tanh (c+d x)) \operatorname {PolyLog}\left (2,\frac {a+b \tanh (c+d x)}{a-b}\right )}{d}-\frac {\log (a+b \tanh (c+d x)) \operatorname {PolyLog}\left (2,\frac {a+b \tanh (c+d x)}{a+b}\right )}{d}-\frac {\operatorname {PolyLog}\left (3,\frac {a+b \tanh (c+d x)}{a-b}\right )}{d}+\frac {\operatorname {PolyLog}\left (3,\frac {a+b \tanh (c+d x)}{a+b}\right )}{d} \] Output:

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

Mathematica [A] (verified)

Time = 0.51 (sec) , antiderivative size = 199, normalized size of antiderivative = 1.03 \[ \int \log ^2(a+b \tanh (c+d x)) \, dx=\frac {\log ^2(a+b \tanh (c+d x)) \log \left (1-\frac {a+b \tanh (c+d x)}{a-b}\right )}{2 d}-\frac {\log ^2(a+b \tanh (c+d x)) \log \left (1-\frac {a+b \tanh (c+d x)}{a+b}\right )}{2 d}+\frac {\log (a+b \tanh (c+d x)) \operatorname {PolyLog}\left (2,\frac {a+b \tanh (c+d x)}{a-b}\right )}{d}-\frac {\log (a+b \tanh (c+d x)) \operatorname {PolyLog}\left (2,\frac {a+b \tanh (c+d x)}{a+b}\right )}{d}-\frac {\operatorname {PolyLog}\left (3,\frac {a+b \tanh (c+d x)}{a-b}\right )}{d}+\frac {\operatorname {PolyLog}\left (3,\frac {a+b \tanh (c+d x)}{a+b}\right )}{d} \] Input:

Integrate[Log[a + b*Tanh[c + d*x]]^2,x]
 

Output:

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

Rubi [A] (verified)

Time = 0.71 (sec) , antiderivative size = 179, normalized size of antiderivative = 0.92, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {4853, 2856, 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 \log ^2(a+b \tanh (c+d x)) \, dx\)

\(\Big \downarrow \) 4853

\(\displaystyle \frac {\int \frac {\log ^2(a+b \tanh (c+d x))}{1-\tanh ^2(c+d x)}d\tanh (c+d x)}{d}\)

\(\Big \downarrow \) 2856

\(\displaystyle \frac {\int \left (\frac {\log ^2(a+b \tanh (c+d x))}{2 (1-\tanh (c+d x))}+\frac {\log ^2(a+b \tanh (c+d x))}{2 (\tanh (c+d x)+1)}\right )d\tanh (c+d x)}{d}\)

\(\Big \downarrow \) 2009

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

Input:

Int[Log[a + b*Tanh[c + d*x]]^2,x]
 

Output:

(-1/2*(Log[(b*(1 - Tanh[c + d*x]))/(a + b)]*Log[a + b*Tanh[c + d*x]]^2) + 
(Log[-((b*(1 + Tanh[c + d*x]))/(a - b))]*Log[a + b*Tanh[c + d*x]]^2)/2 + L 
og[a + b*Tanh[c + d*x]]*PolyLog[2, (a + b*Tanh[c + d*x])/(a - b)] - Log[a 
+ b*Tanh[c + d*x]]*PolyLog[2, (a + b*Tanh[c + d*x])/(a + b)] - PolyLog[3, 
(a + b*Tanh[c + d*x])/(a - b)] + PolyLog[3, (a + b*Tanh[c + d*x])/(a + b)] 
)/d
 

Defintions of rubi rules used

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

rule 2856
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_. 
)*(x_)^(r_))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*Log[c*(d + e*x) 
^n])^p, (f + g*x^r)^q, x], x] /; FreeQ[{a, b, c, d, e, f, g, n, r}, x] && I 
GtQ[p, 0] && IntegerQ[q] && (GtQ[q, 0] || (IntegerQ[r] && NeQ[r, 1]))
 

rule 4853
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, Simp[With[{d = FreeFa 
ctors[Tan[v], x]}, d/Coefficient[v, x, 1]   Subst[Int[SubstFor[1/(1 + d^2*x 
^2), Tan[v]/d, u, x], x], x, Tan[v]/d]], x] /;  !FalseQ[v] && FunctionOfQ[N 
onfreeFactors[Tan[v], x], u, x, True] && TryPureTanSubst[ActivateTrig[u], x 
]]
 
Maple [A] (verified)

Time = 9.01 (sec) , antiderivative size = 210, normalized size of antiderivative = 1.08

method result size
derivativedivides \(-\frac {b \left (\frac {\ln \left (a +b \tanh \left (d x +c \right )\right )^{2} \ln \left (1+\frac {a +b \tanh \left (d x +c \right )}{-a -b}\right )+2 \ln \left (a +b \tanh \left (d x +c \right )\right ) \operatorname {polylog}\left (2, -\frac {a +b \tanh \left (d x +c \right )}{-a -b}\right )-2 \operatorname {polylog}\left (3, -\frac {a +b \tanh \left (d x +c \right )}{-a -b}\right )}{2 b}-\frac {\ln \left (a +b \tanh \left (d x +c \right )\right )^{2} \ln \left (1+\frac {a +b \tanh \left (d x +c \right )}{-a +b}\right )+2 \ln \left (a +b \tanh \left (d x +c \right )\right ) \operatorname {polylog}\left (2, -\frac {a +b \tanh \left (d x +c \right )}{-a +b}\right )-2 \operatorname {polylog}\left (3, -\frac {a +b \tanh \left (d x +c \right )}{-a +b}\right )}{2 b}\right )}{d}\) \(210\)
default \(-\frac {b \left (\frac {\ln \left (a +b \tanh \left (d x +c \right )\right )^{2} \ln \left (1+\frac {a +b \tanh \left (d x +c \right )}{-a -b}\right )+2 \ln \left (a +b \tanh \left (d x +c \right )\right ) \operatorname {polylog}\left (2, -\frac {a +b \tanh \left (d x +c \right )}{-a -b}\right )-2 \operatorname {polylog}\left (3, -\frac {a +b \tanh \left (d x +c \right )}{-a -b}\right )}{2 b}-\frac {\ln \left (a +b \tanh \left (d x +c \right )\right )^{2} \ln \left (1+\frac {a +b \tanh \left (d x +c \right )}{-a +b}\right )+2 \ln \left (a +b \tanh \left (d x +c \right )\right ) \operatorname {polylog}\left (2, -\frac {a +b \tanh \left (d x +c \right )}{-a +b}\right )-2 \operatorname {polylog}\left (3, -\frac {a +b \tanh \left (d x +c \right )}{-a +b}\right )}{2 b}\right )}{d}\) \(210\)

Input:

int(ln(a+b*tanh(d*x+c))^2,x,method=_RETURNVERBOSE)
 

Output:

-1/d*b*(1/2/b*(ln(a+b*tanh(d*x+c))^2*ln(1+1/(-a-b)*(a+b*tanh(d*x+c)))+2*ln 
(a+b*tanh(d*x+c))*polylog(2,-1/(-a-b)*(a+b*tanh(d*x+c)))-2*polylog(3,-1/(- 
a-b)*(a+b*tanh(d*x+c))))-1/2/b*(ln(a+b*tanh(d*x+c))^2*ln(1+1/(-a+b)*(a+b*t 
anh(d*x+c)))+2*ln(a+b*tanh(d*x+c))*polylog(2,-1/(-a+b)*(a+b*tanh(d*x+c)))- 
2*polylog(3,-1/(-a+b)*(a+b*tanh(d*x+c)))))
 

Fricas [F]

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

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

Output:

integral(log(b*tanh(d*x + c) + a)^2, x)
 

Sympy [F]

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

integrate(ln(a+b*tanh(d*x+c))**2,x)
 

Output:

Integral(log(a + b*tanh(c + d*x))**2, x)
 

Maxima [F]

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

integrate(log(a+b*tanh(d*x+c))^2,x, algorithm="maxima")
 

Output:

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

Giac [F]

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

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

Output:

integrate(log(b*tanh(d*x + c) + a)^2, x)
 

Mupad [F(-1)]

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

int(log(a + b*tanh(c + d*x))^2,x)
 

Output:

int(log(a + b*tanh(c + d*x))^2, x)
 

Reduce [F]

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

int(log(a+b*tanh(d*x+c))^2,x)
 

Output:

int(log(tanh(c + d*x)*b + a)**2,x)