\(\int \frac {(a+b \text {arctanh}(c x))^2}{x^2 (d+c d x)} \, dx\) [100]

Optimal result
Mathematica [C] (verified)
Rubi [A] (verified)
Maple [C] (warning: unable to verify)
Fricas [F]
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

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

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.58 (sec) , antiderivative size = 225, normalized size of antiderivative = 1.39 \[ \int \frac {(a+b \text {arctanh}(c x))^2}{x^2 (d+c d x)} \, dx=\frac {-\frac {a^2}{x}-a^2 c \log (x)+a^2 c \log (1+c x)+\frac {a b \left (-2 \text {arctanh}(c x) \left (1+c x \log \left (1-e^{-2 \text {arctanh}(c x)}\right )\right )+2 c x \log \left (\frac {c x}{\sqrt {1-c^2 x^2}}\right )+c x \operatorname {PolyLog}\left (2,e^{-2 \text {arctanh}(c x)}\right )\right )}{x}+b^2 c \left (-\frac {i \pi ^3}{24}+\text {arctanh}(c x)^2-\frac {\text {arctanh}(c x)^2}{c x}+\frac {2}{3} \text {arctanh}(c x)^3+2 \text {arctanh}(c x) \log \left (1-e^{-2 \text {arctanh}(c x)}\right )-\text {arctanh}(c x)^2 \log \left (1-e^{2 \text {arctanh}(c x)}\right )-\operatorname {PolyLog}\left (2,e^{-2 \text {arctanh}(c x)}\right )-\text {arctanh}(c x) \operatorname {PolyLog}\left (2,e^{2 \text {arctanh}(c x)}\right )+\frac {1}{2} \operatorname {PolyLog}\left (3,e^{2 \text {arctanh}(c x)}\right )\right )}{d} \] Input:

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

Output:

(-(a^2/x) - a^2*c*Log[x] + a^2*c*Log[1 + c*x] + (a*b*(-2*ArcTanh[c*x]*(1 + 
 c*x*Log[1 - E^(-2*ArcTanh[c*x])]) + 2*c*x*Log[(c*x)/Sqrt[1 - c^2*x^2]] + 
c*x*PolyLog[2, E^(-2*ArcTanh[c*x])]))/x + b^2*c*((-1/24*I)*Pi^3 + ArcTanh[ 
c*x]^2 - ArcTanh[c*x]^2/(c*x) + (2*ArcTanh[c*x]^3)/3 + 2*ArcTanh[c*x]*Log[ 
1 - E^(-2*ArcTanh[c*x])] - ArcTanh[c*x]^2*Log[1 - E^(2*ArcTanh[c*x])] - Po 
lyLog[2, E^(-2*ArcTanh[c*x])] - ArcTanh[c*x]*PolyLog[2, E^(2*ArcTanh[c*x]) 
] + PolyLog[3, E^(2*ArcTanh[c*x])]/2))/d
 

Rubi [A] (verified)

Time = 1.69 (sec) , antiderivative size = 166, normalized size of antiderivative = 1.02, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.409, Rules used = {6496, 27, 6452, 6494, 6550, 6494, 2897, 6618, 7164}

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 {(a+b \text {arctanh}(c x))^2}{x^2 (c d x+d)} \, dx\)

\(\Big \downarrow \) 6496

\(\displaystyle \frac {\int \frac {(a+b \text {arctanh}(c x))^2}{x^2}dx}{d}-c \int \frac {(a+b \text {arctanh}(c x))^2}{d x (c x+1)}dx\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\int \frac {(a+b \text {arctanh}(c x))^2}{x^2}dx}{d}-\frac {c \int \frac {(a+b \text {arctanh}(c x))^2}{x (c x+1)}dx}{d}\)

\(\Big \downarrow \) 6452

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

\(\Big \downarrow \) 6494

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

\(\Big \downarrow \) 6550

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

\(\Big \downarrow \) 6494

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

\(\Big \downarrow \) 2897

\(\displaystyle \frac {2 b c \left (\frac {(a+b \text {arctanh}(c x))^2}{2 b}+\log \left (2-\frac {2}{c x+1}\right ) (a+b \text {arctanh}(c x))-\frac {1}{2} b \operatorname {PolyLog}\left (2,\frac {2}{c x+1}-1\right )\right )-\frac {(a+b \text {arctanh}(c x))^2}{x}}{d}-\frac {c \left (\log \left (2-\frac {2}{c x+1}\right ) (a+b \text {arctanh}(c x))^2-2 b c \int \frac {(a+b \text {arctanh}(c x)) \log \left (2-\frac {2}{c x+1}\right )}{1-c^2 x^2}dx\right )}{d}\)

\(\Big \downarrow \) 6618

\(\displaystyle \frac {2 b c \left (\frac {(a+b \text {arctanh}(c x))^2}{2 b}+\log \left (2-\frac {2}{c x+1}\right ) (a+b \text {arctanh}(c x))-\frac {1}{2} b \operatorname {PolyLog}\left (2,\frac {2}{c x+1}-1\right )\right )-\frac {(a+b \text {arctanh}(c x))^2}{x}}{d}-\frac {c \left (\log \left (2-\frac {2}{c x+1}\right ) (a+b \text {arctanh}(c x))^2-2 b c \left (\frac {\operatorname {PolyLog}\left (2,\frac {2}{c x+1}-1\right ) (a+b \text {arctanh}(c x))}{2 c}-\frac {1}{2} b \int \frac {\operatorname {PolyLog}\left (2,\frac {2}{c x+1}-1\right )}{1-c^2 x^2}dx\right )\right )}{d}\)

\(\Big \downarrow \) 7164

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2897
Int[Log[u_]*(Pq_)^(m_.), x_Symbol] :> With[{C = FullSimplify[Pq^m*((1 - u)/ 
D[u, x])]}, Simp[C*PolyLog[2, 1 - u], x] /; FreeQ[C, x]] /; IntegerQ[m] && 
PolyQ[Pq, x] && RationalFunctionQ[u, x] && LeQ[RationalFunctionExponents[u, 
 x][[2]], Expon[Pq, x]]
 

rule 6452
Int[((a_.) + ArcTanh[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] : 
> Simp[x^(m + 1)*((a + b*ArcTanh[c*x^n])^p/(m + 1)), x] - Simp[b*c*n*(p/(m 
+ 1))   Int[x^(m + n)*((a + b*ArcTanh[c*x^n])^(p - 1)/(1 - c^2*x^(2*n))), x 
], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1 
] && IntegerQ[m])) && NeQ[m, -1]
 

rule 6494
Int[((a_.) + ArcTanh[(c_.)*(x_)]*(b_.))^(p_.)/((x_)*((d_) + (e_.)*(x_))), x 
_Symbol] :> Simp[(a + b*ArcTanh[c*x])^p*(Log[2 - 2/(1 + e*(x/d))]/d), x] - 
Simp[b*c*(p/d)   Int[(a + b*ArcTanh[c*x])^(p - 1)*(Log[2 - 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 6496
Int[(((a_.) + ArcTanh[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + ( 
e_.)*(x_)), x_Symbol] :> Simp[1/d   Int[(f*x)^m*(a + b*ArcTanh[c*x])^p, x], 
 x] - Simp[e/(d*f)   Int[(f*x)^(m + 1)*((a + b*ArcTanh[c*x])^p/(d + e*x)), 
x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[p, 0] && EqQ[c^2*d^2 - e^2, 
0] && LtQ[m, -1]
 

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

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

rule 7164
Int[(u_)*PolyLog[n_, v_], x_Symbol] :> With[{w = DerivativeDivides[v, u*v, 
x]}, Simp[w*PolyLog[n + 1, v], x] /;  !FalseQ[w]] /; FreeQ[n, x]
 
Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 2.60 (sec) , antiderivative size = 4135, normalized size of antiderivative = 25.52

method result size
parts \(\text {Expression too large to display}\) \(4135\)
derivativedivides \(\text {Expression too large to display}\) \(4170\)
default \(\text {Expression too large to display}\) \(4170\)

Input:

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

Output:

a^2/d*(c*ln(c*x+1)-1/x-c*ln(x))+b^2/d*c*(-arctanh(c*x)^2*ln(1-(c*x+1)/(-c^ 
2*x^2+1)^(1/2))-2*arctanh(c*x)*polylog(2,(c*x+1)/(-c^2*x^2+1)^(1/2))-arcta 
nh(c*x)^2*ln(1+(c*x+1)/(-c^2*x^2+1)^(1/2))-2*arctanh(c*x)*polylog(2,-(c*x+ 
1)/(-c^2*x^2+1)^(1/2))+arctanh(c*x)^2*ln((c*x+1)^2/(-c^2*x^2+1)-1)-arctanh 
(c*x)^2*ln(c*x)+ln(2)*dilog((c*x+1)/(-c^2*x^2+1)^(1/2))-ln(2)*dilog(1+(c*x 
+1)/(-c^2*x^2+1)^(1/2))+ln(2)*polylog(2,(c*x+1)/(-c^2*x^2+1)^(1/2))+ln(2)* 
polylog(2,-(c*x+1)/(-c^2*x^2+1)^(1/2))+arctanh(c*x)^2*ln(c*x+1)+arctanh(c* 
x)*ln(1-(c*x+1)/(-c^2*x^2+1)^(1/2))+2*arctanh(c*x)*ln(1+(c*x+1)/(-c^2*x^2+ 
1)^(1/2))+2/3*arctanh(c*x)^3-dilog((c*x+1)/(-c^2*x^2+1)^(1/2))+dilog(1+(c* 
x+1)/(-c^2*x^2+1)^(1/2))+ln(2)*arctanh(c*x)*ln(1-(c*x+1)/(-c^2*x^2+1)^(1/2 
))-arctanh(c*x)^2+polylog(2,(c*x+1)/(-c^2*x^2+1)^(1/2))+polylog(2,-(c*x+1) 
/(-c^2*x^2+1)^(1/2))+2*polylog(3,-(c*x+1)/(-c^2*x^2+1)^(1/2))+2*polylog(3, 
(c*x+1)/(-c^2*x^2+1)^(1/2))-arctanh(c*x)^2/c/x+1/2*I*Pi*csgn(I*(c*x+1)^2/( 
c^2*x^2-1))^3*(arctanh(c*x)*ln(1-(c*x+1)/(-c^2*x^2+1)^(1/2))+arctanh(c*x)* 
ln(1+(c*x+1)/(-c^2*x^2+1)^(1/2))-arctanh(c*x)^2+polylog(2,(c*x+1)/(-c^2*x^ 
2+1)^(1/2))+polylog(2,-(c*x+1)/(-c^2*x^2+1)^(1/2)))+1/2*I*Pi*csgn(I*(-(c*x 
+1)^2/(c^2*x^2-1)-1)/(1-(c*x+1)^2/(c^2*x^2-1)))^3*(arctanh(c*x)*ln(1-(c*x+ 
1)/(-c^2*x^2+1)^(1/2))+arctanh(c*x)*ln(1+(c*x+1)/(-c^2*x^2+1)^(1/2))-arcta 
nh(c*x)^2+polylog(2,(c*x+1)/(-c^2*x^2+1)^(1/2))+polylog(2,-(c*x+1)/(-c^2*x 
^2+1)^(1/2)))+1/2*I*Pi*csgn(I*(-(c*x+1)^2/(c^2*x^2-1)-1))*csgn(I*(-(c*x...
 

Fricas [F]

\[ \int \frac {(a+b \text {arctanh}(c x))^2}{x^2 (d+c d x)} \, dx=\int { \frac {{\left (b \operatorname {artanh}\left (c x\right ) + a\right )}^{2}}{{\left (c d x + d\right )} x^{2}} \,d x } \] Input:

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

Output:

integral((b^2*arctanh(c*x)^2 + 2*a*b*arctanh(c*x) + a^2)/(c*d*x^3 + d*x^2) 
, x)
 

Sympy [F]

\[ \int \frac {(a+b \text {arctanh}(c x))^2}{x^2 (d+c d x)} \, dx=\frac {\int \frac {a^{2}}{c x^{3} + x^{2}}\, dx + \int \frac {b^{2} \operatorname {atanh}^{2}{\left (c x \right )}}{c x^{3} + x^{2}}\, dx + \int \frac {2 a b \operatorname {atanh}{\left (c x \right )}}{c x^{3} + x^{2}}\, dx}{d} \] Input:

integrate((a+b*atanh(c*x))**2/x**2/(c*d*x+d),x)
 

Output:

(Integral(a**2/(c*x**3 + x**2), x) + Integral(b**2*atanh(c*x)**2/(c*x**3 + 
 x**2), x) + Integral(2*a*b*atanh(c*x)/(c*x**3 + x**2), x))/d
 

Maxima [F]

\[ \int \frac {(a+b \text {arctanh}(c x))^2}{x^2 (d+c d x)} \, dx=\int { \frac {{\left (b \operatorname {artanh}\left (c x\right ) + a\right )}^{2}}{{\left (c d x + d\right )} x^{2}} \,d x } \] Input:

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

Output:

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

Giac [F]

\[ \int \frac {(a+b \text {arctanh}(c x))^2}{x^2 (d+c d x)} \, dx=\int { \frac {{\left (b \operatorname {artanh}\left (c x\right ) + a\right )}^{2}}{{\left (c d x + d\right )} x^{2}} \,d x } \] Input:

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

Output:

integrate((b*arctanh(c*x) + a)^2/((c*d*x + d)*x^2), x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {(a+b \text {arctanh}(c x))^2}{x^2 (d+c d x)} \, dx=\int \frac {{\left (a+b\,\mathrm {atanh}\left (c\,x\right )\right )}^2}{x^2\,\left (d+c\,d\,x\right )} \,d x \] Input:

int((a + b*atanh(c*x))^2/(x^2*(d + c*d*x)),x)
 

Output:

int((a + b*atanh(c*x))^2/(x^2*(d + c*d*x)), x)
 

Reduce [F]

\[ \int \frac {(a+b \text {arctanh}(c x))^2}{x^2 (d+c d x)} \, dx=\frac {2 \left (\int \frac {\mathit {atanh} \left (c x \right )}{c \,x^{3}+x^{2}}d x \right ) a b x +\left (\int \frac {\mathit {atanh} \left (c x \right )^{2}}{c \,x^{3}+x^{2}}d x \right ) b^{2} x +\mathrm {log}\left (c x +1\right ) a^{2} c x -\mathrm {log}\left (x \right ) a^{2} c x -a^{2}}{d x} \] Input:

int((a+b*atanh(c*x))^2/x^2/(c*d*x+d),x)
 

Output:

(2*int(atanh(c*x)/(c*x**3 + x**2),x)*a*b*x + int(atanh(c*x)**2/(c*x**3 + x 
**2),x)*b**2*x + log(c*x + 1)*a**2*c*x - log(x)*a**2*c*x - a**2)/(d*x)