\(\int \frac {(a+b \csc ^{-1}(c x))^2}{x} \, dx\) [19]

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

Optimal result

Integrand size = 14, antiderivative size = 91 \[ \int \frac {\left (a+b \csc ^{-1}(c x)\right )^2}{x} \, dx=\frac {i \left (a+b \csc ^{-1}(c x)\right )^3}{3 b}-\left (a+b \csc ^{-1}(c x)\right )^2 \log \left (1-e^{2 i \csc ^{-1}(c x)}\right )+i b \left (a+b \csc ^{-1}(c x)\right ) \operatorname {PolyLog}\left (2,e^{2 i \csc ^{-1}(c x)}\right )-\frac {1}{2} b^2 \operatorname {PolyLog}\left (3,e^{2 i \csc ^{-1}(c x)}\right ) \] Output:

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

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.51 \[ \int \frac {\left (a+b \csc ^{-1}(c x)\right )^2}{x} \, dx=-2 a b \csc ^{-1}(c x) \log \left (1-e^{2 i \csc ^{-1}(c x)}\right )+a^2 \log (c x)+i a b \left (\csc ^{-1}(c x)^2+\operatorname {PolyLog}\left (2,e^{2 i \csc ^{-1}(c x)}\right )\right )+\frac {1}{24} i b^2 \left (\pi ^3-8 \csc ^{-1}(c x)^3+24 i \csc ^{-1}(c x)^2 \log \left (1-e^{-2 i \csc ^{-1}(c x)}\right )-24 \csc ^{-1}(c x) \operatorname {PolyLog}\left (2,e^{-2 i \csc ^{-1}(c x)}\right )+12 i \operatorname {PolyLog}\left (3,e^{-2 i \csc ^{-1}(c x)}\right )\right ) \] Input:

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

Output:

-2*a*b*ArcCsc[c*x]*Log[1 - E^((2*I)*ArcCsc[c*x])] + a^2*Log[c*x] + I*a*b*( 
ArcCsc[c*x]^2 + PolyLog[2, E^((2*I)*ArcCsc[c*x])]) + (I/24)*b^2*(Pi^3 - 8* 
ArcCsc[c*x]^3 + (24*I)*ArcCsc[c*x]^2*Log[1 - E^((-2*I)*ArcCsc[c*x])] - 24* 
ArcCsc[c*x]*PolyLog[2, E^((-2*I)*ArcCsc[c*x])] + (12*I)*PolyLog[3, E^((-2* 
I)*ArcCsc[c*x])])
 

Rubi [A] (verified)

Time = 0.54 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.15, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.643, Rules used = {5746, 3042, 25, 4200, 25, 2620, 3011, 2720, 7143}

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

\(\Big \downarrow \) 5746

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 4200

\(\displaystyle \frac {i \left (a+b \csc ^{-1}(c x)\right )^3}{3 b}-2 i \int -\frac {e^{2 i \csc ^{-1}(c x)} \left (a+b \csc ^{-1}(c x)\right )^2}{1-e^{2 i \csc ^{-1}(c x)}}d\csc ^{-1}(c x)\)

\(\Big \downarrow \) 25

\(\displaystyle 2 i \int \frac {e^{2 i \csc ^{-1}(c x)} \left (a+b \csc ^{-1}(c x)\right )^2}{1-e^{2 i \csc ^{-1}(c x)}}d\csc ^{-1}(c x)+\frac {i \left (a+b \csc ^{-1}(c x)\right )^3}{3 b}\)

\(\Big \downarrow \) 2620

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

\(\Big \downarrow \) 3011

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

\(\Big \downarrow \) 2720

\(\displaystyle 2 i \left (\frac {1}{2} i \log \left (1-e^{2 i \csc ^{-1}(c x)}\right ) \left (a+b \csc ^{-1}(c x)\right )^2-i b \left (\frac {1}{2} i \operatorname {PolyLog}\left (2,e^{2 i \csc ^{-1}(c x)}\right ) \left (a+b \csc ^{-1}(c x)\right )-\frac {1}{4} b \int e^{-2 i \csc ^{-1}(c x)} \operatorname {PolyLog}\left (2,e^{2 i \csc ^{-1}(c x)}\right )de^{2 i \csc ^{-1}(c x)}\right )\right )+\frac {i \left (a+b \csc ^{-1}(c x)\right )^3}{3 b}\)

\(\Big \downarrow \) 7143

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

Input:

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

Output:

((I/3)*(a + b*ArcCsc[c*x])^3)/b + (2*I)*((I/2)*(a + b*ArcCsc[c*x])^2*Log[1 
 - E^((2*I)*ArcCsc[c*x])] - I*b*((I/2)*(a + b*ArcCsc[c*x])*PolyLog[2, E^(( 
2*I)*ArcCsc[c*x])] - (b*PolyLog[3, E^((2*I)*ArcCsc[c*x])])/4))
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 2620
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ 
((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp 
[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si 
mp[d*(m/(b*f*g*n*Log[F]))   Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x 
)))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
 

rule 2720
Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Simp[v/D[v, x] 
   Subst[Int[FunctionOfExponentialFunction[u, x]/x, x], x, v], x]] /; Funct 
ionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; FreeQ 
[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x)) 
*(F_)[v_] /; FreeQ[{a, b, c}, x] && InverseFunctionQ[F[x]]]
 

rule 3011
Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.) 
*(x_))^(m_.), x_Symbol] :> Simp[(-(f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + 
b*x)))^n]/(b*c*n*Log[F])), x] + Simp[g*(m/(b*c*n*Log[F]))   Int[(f + g*x)^( 
m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e 
, f, g, n}, x] && GtQ[m, 0]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4200
Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (f_.)*(x_)], x_Symbol 
] :> Simp[I*((c + d*x)^(m + 1)/(d*(m + 1))), x] - Simp[2*I   Int[(c + d*x)^ 
m*E^(2*I*k*Pi)*(E^(2*I*(e + f*x))/(1 + E^(2*I*k*Pi)*E^(2*I*(e + f*x)))), x] 
, x] /; FreeQ[{c, d, e, f}, x] && IntegerQ[4*k] && IGtQ[m, 0]
 

rule 5746
Int[((a_.) + ArcCsc[(c_.)*(x_)]*(b_.))^(n_)*(x_)^(m_.), x_Symbol] :> Simp[- 
(c^(m + 1))^(-1)   Subst[Int[(a + b*x)^n*Csc[x]^(m + 1)*Cot[x], x], x, ArcC 
sc[c*x]], x] /; FreeQ[{a, b, c}, x] && IntegerQ[n] && IntegerQ[m] && (GtQ[n 
, 0] || LtQ[m, -1])
 

rule 7143
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_S 
ymbol] :> Simp[PolyLog[n + 1, c*(a + b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d 
, e, n, p}, x] && EqQ[b*d, a*e]
 
Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 337 vs. \(2 (127 ) = 254\).

Time = 0.72 (sec) , antiderivative size = 338, normalized size of antiderivative = 3.71

method result size
parts \(a^{2} \ln \left (x \right )+b^{2} \left (\frac {i \operatorname {arccsc}\left (c x \right )^{3}}{3}-\operatorname {arccsc}\left (c x \right )^{2} \ln \left (1+\frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+2 i \operatorname {arccsc}\left (c x \right ) \operatorname {polylog}\left (2, -\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-2 \operatorname {polylog}\left (3, -\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-\operatorname {arccsc}\left (c x \right )^{2} \ln \left (1-\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+2 i \operatorname {arccsc}\left (c x \right ) \operatorname {polylog}\left (2, \frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-2 \operatorname {polylog}\left (3, \frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )\right )+2 a b \left (\frac {i \operatorname {arccsc}\left (c x \right )^{2}}{2}-\operatorname {arccsc}\left (c x \right ) \ln \left (1+\frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+i \operatorname {polylog}\left (2, -\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-\operatorname {arccsc}\left (c x \right ) \ln \left (1-\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+i \operatorname {polylog}\left (2, \frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )\right )\) \(338\)
derivativedivides \(a^{2} \ln \left (c x \right )+b^{2} \left (\frac {i \operatorname {arccsc}\left (c x \right )^{3}}{3}-\operatorname {arccsc}\left (c x \right )^{2} \ln \left (1+\frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+2 i \operatorname {arccsc}\left (c x \right ) \operatorname {polylog}\left (2, -\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-2 \operatorname {polylog}\left (3, -\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-\operatorname {arccsc}\left (c x \right )^{2} \ln \left (1-\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+2 i \operatorname {arccsc}\left (c x \right ) \operatorname {polylog}\left (2, \frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-2 \operatorname {polylog}\left (3, \frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )\right )+2 a b \left (\frac {i \operatorname {arccsc}\left (c x \right )^{2}}{2}-\operatorname {arccsc}\left (c x \right ) \ln \left (1+\frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+i \operatorname {polylog}\left (2, -\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-\operatorname {arccsc}\left (c x \right ) \ln \left (1-\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+i \operatorname {polylog}\left (2, \frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )\right )\) \(340\)
default \(a^{2} \ln \left (c x \right )+b^{2} \left (\frac {i \operatorname {arccsc}\left (c x \right )^{3}}{3}-\operatorname {arccsc}\left (c x \right )^{2} \ln \left (1+\frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+2 i \operatorname {arccsc}\left (c x \right ) \operatorname {polylog}\left (2, -\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-2 \operatorname {polylog}\left (3, -\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-\operatorname {arccsc}\left (c x \right )^{2} \ln \left (1-\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+2 i \operatorname {arccsc}\left (c x \right ) \operatorname {polylog}\left (2, \frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-2 \operatorname {polylog}\left (3, \frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )\right )+2 a b \left (\frac {i \operatorname {arccsc}\left (c x \right )^{2}}{2}-\operatorname {arccsc}\left (c x \right ) \ln \left (1+\frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+i \operatorname {polylog}\left (2, -\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )-\operatorname {arccsc}\left (c x \right ) \ln \left (1-\frac {i}{c x}-\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )+i \operatorname {polylog}\left (2, \frac {i}{c x}+\sqrt {1-\frac {1}{c^{2} x^{2}}}\right )\right )\) \(340\)

Input:

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

Output:

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

Fricas [F]

\[ \int \frac {\left (a+b \csc ^{-1}(c x)\right )^2}{x} \, dx=\int { \frac {{\left (b \operatorname {arccsc}\left (c x\right ) + a\right )}^{2}}{x} \,d x } \] Input:

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

Output:

integral((b^2*arccsc(c*x)^2 + 2*a*b*arccsc(c*x) + a^2)/x, x)
 

Sympy [F]

\[ \int \frac {\left (a+b \csc ^{-1}(c x)\right )^2}{x} \, dx=\int \frac {\left (a + b \operatorname {acsc}{\left (c x \right )}\right )^{2}}{x}\, dx \] Input:

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

Output:

Integral((a + b*acsc(c*x))**2/x, x)
 

Maxima [F]

\[ \int \frac {\left (a+b \csc ^{-1}(c x)\right )^2}{x} \, dx=\int { \frac {{\left (b \operatorname {arccsc}\left (c x\right ) + a\right )}^{2}}{x} \,d x } \] Input:

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

Output:

-1/2*b^2*c^2*(log(c*x + 1)/c^2 + log(c*x - 1)/c^2)*log(c)^2 + b^2*c^2*inte 
grate(x^2*log(c^2*x^2)/(c^2*x^3 - x), x)*log(c) - 2*b^2*c^2*integrate(x^2* 
log(x)/(c^2*x^3 - x), x)*log(c) + 2*b^2*c^2*integrate(x^2*log(c^2*x^2)*log 
(x)/(c^2*x^3 - x), x) - b^2*c^2*integrate(x^2*log(x)^2/(c^2*x^3 - x), x) + 
 2*a*b*c^2*integrate(x^2*arctan(1/(sqrt(c*x + 1)*sqrt(c*x - 1)))/(c^2*x^3 
- x), x) + 1/2*b^2*(log(c*x + 1) + log(c*x - 1) - 2*log(x))*log(c)^2 + b^2 
*arctan2(1, sqrt(c*x + 1)*sqrt(c*x - 1))^2*log(x) - 1/4*b^2*log(c^2*x^2)^2 
*log(x) - b^2*integrate(log(c^2*x^2)/(c^2*x^3 - x), x)*log(c) + 2*b^2*inte 
grate(log(x)/(c^2*x^3 - x), x)*log(c) + 2*b^2*integrate(sqrt(c*x + 1)*sqrt 
(c*x - 1)*arctan(1/(sqrt(c*x + 1)*sqrt(c*x - 1)))*log(x)/(c^2*x^3 - x), x) 
 - 2*b^2*integrate(log(c^2*x^2)*log(x)/(c^2*x^3 - x), x) + b^2*integrate(l 
og(x)^2/(c^2*x^3 - x), x) - 2*a*b*integrate(arctan(1/(sqrt(c*x + 1)*sqrt(c 
*x - 1)))/(c^2*x^3 - x), x) + a^2*log(x)
 

Giac [F(-2)]

Exception generated. \[ \int \frac {\left (a+b \csc ^{-1}(c x)\right )^2}{x} \, dx=\text {Exception raised: RuntimeError} \] Input:

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

Output:

Exception raised: RuntimeError >> an error occurred running a Giac command 
:INPUT:sage2OUTPUT:sym2poly/r2sym(const gen & e,const index_m & i,const ve 
cteur & l) Error: Bad Argument Value
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

2*int(acsc(c*x)/x,x)*a*b + int(acsc(c*x)**2/x,x)*b**2 + log(x)*a**2