\(\int x \arctan (c+d \tan (a+b x)) \, dx\) [49]

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

Optimal result

Integrand size = 13, antiderivative size = 305 \[ \int x \arctan (c+d \tan (a+b x)) \, dx=\frac {1}{2} x^2 \arctan (c+d \tan (a+b x))+\frac {1}{4} i x^2 \log \left (1+\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )-\frac {1}{4} i x^2 \log \left (1+\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )+\frac {x \operatorname {PolyLog}\left (2,-\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )}{4 b}-\frac {x \operatorname {PolyLog}\left (2,-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )}{4 b}+\frac {i \operatorname {PolyLog}\left (3,-\frac {(1+i c+d) e^{2 i a+2 i b x}}{1+i c-d}\right )}{8 b^2}-\frac {i \operatorname {PolyLog}\left (3,-\frac {(c+i (1-d)) e^{2 i a+2 i b x}}{c+i (1+d)}\right )}{8 b^2} \] Output:

1/2*x^2*arctan(c+d*tan(b*x+a))+1/4*I*x^2*ln(1+(1+I*c+d)*exp(2*I*a+2*I*b*x) 
/(1+I*c-d))-1/4*I*x^2*ln(1+(c+I*(1-d))*exp(2*I*a+2*I*b*x)/(c+I*(1+d)))+1/4 
*x*polylog(2,-(1+I*c+d)*exp(2*I*a+2*I*b*x)/(1+I*c-d))/b-1/4*x*polylog(2,-( 
c+I*(1-d))*exp(2*I*a+2*I*b*x)/(c+I*(1+d)))/b+1/8*I*polylog(3,-(1+I*c+d)*ex 
p(2*I*a+2*I*b*x)/(1+I*c-d))/b^2-1/8*I*polylog(3,-(c+I*(1-d))*exp(2*I*a+2*I 
*b*x)/(c+I*(1+d)))/b^2
 

Mathematica [A] (verified)

Time = 2.58 (sec) , antiderivative size = 281, normalized size of antiderivative = 0.92 \[ \int x \arctan (c+d \tan (a+b x)) \, dx=\frac {4 b^2 x^2 \arctan (c+d \tan (a+b x))+2 i b^2 x^2 \log \left (1+\frac {(c+i (-1+d)) e^{-2 i (a+b x)}}{c-i (1+d)}\right )-2 i b^2 x^2 \log \left (1+\frac {(c+i (1+d)) e^{-2 i (a+b x)}}{i+c-i d}\right )+2 b x \operatorname {PolyLog}\left (2,\frac {(-c-i (1+d)) e^{-2 i (a+b x)}}{c-i (-1+d)}\right )-2 b x \operatorname {PolyLog}\left (2,\frac {(i-c-i d) e^{-2 i (a+b x)}}{c-i (1+d)}\right )-i \operatorname {PolyLog}\left (3,\frac {(-c-i (1+d)) e^{-2 i (a+b x)}}{i+c-i d}\right )+i \operatorname {PolyLog}\left (3,\frac {(i-c-i d) e^{-2 i (a+b x)}}{c-i (1+d)}\right )}{8 b^2} \] Input:

Integrate[x*ArcTan[c + d*Tan[a + b*x]],x]
 

Output:

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

Rubi [A] (verified)

Time = 1.15 (sec) , antiderivative size = 396, normalized size of antiderivative = 1.30, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {5698, 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 x \arctan (d \tan (a+b x)+c) \, dx\)

\(\Big \downarrow \) 5698

\(\displaystyle \frac {1}{2} b (-i c-d+1) \int \frac {e^{2 i a+2 i b x} x^2}{-i c+(-i c-d+1) e^{2 i a+2 i b x}+d+1}dx-\frac {1}{2} b (i c+d+1) \int \frac {e^{2 i a+2 i b x} x^2}{i c+(i c+d+1) e^{2 i a+2 i b x}-d+1}dx+\frac {1}{2} x^2 \arctan (d \tan (a+b x)+c)\)

\(\Big \downarrow \) 2620

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

\(\Big \downarrow \) 3011

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

\(\Big \downarrow \) 2720

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

\(\Big \downarrow \) 7143

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

Input:

Int[x*ArcTan[c + d*Tan[a + b*x]],x]
 

Output:

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

Defintions of rubi rules used

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 5698
Int[ArcTan[(c_.) + (d_.)*Tan[(a_.) + (b_.)*(x_)]]*((e_.) + (f_.)*(x_))^(m_. 
), x_Symbol] :> Simp[(e + f*x)^(m + 1)*(ArcTan[c + d*Tan[a + b*x]]/(f*(m + 
1))), x] + (Simp[b*((1 - I*c - d)/(f*(m + 1)))   Int[(e + f*x)^(m + 1)*(E^( 
2*I*a + 2*I*b*x)/(1 - I*c + d + (1 - I*c - d)*E^(2*I*a + 2*I*b*x))), x], x] 
 - Simp[b*((1 + I*c + d)/(f*(m + 1)))   Int[(e + f*x)^(m + 1)*(E^(2*I*a + 2 
*I*b*x)/(1 + I*c - d + (1 + I*c + d)*E^(2*I*a + 2*I*b*x))), x], x]) /; Free 
Q[{a, b, c, d, e, f}, x] && IGtQ[m, 0] && NeQ[(c + I*d)^2, -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 [C] (warning: unable to verify)

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

Time = 3.92 (sec) , antiderivative size = 7647, normalized size of antiderivative = 25.07

method result size
risch \(\text {Expression too large to display}\) \(7647\)

Input:

int(x*arctan(c+d*tan(b*x+a)),x,method=_RETURNVERBOSE)
 

Output:

result too large to display
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1545 vs. \(2 (217) = 434\).

Time = 0.16 (sec) , antiderivative size = 1545, normalized size of antiderivative = 5.07 \[ \int x \arctan (c+d \tan (a+b x)) \, dx=\text {Too large to display} \] Input:

integrate(x*arctan(c+d*tan(b*x+a)),x, algorithm="fricas")
 

Output:

1/16*(8*b^2*x^2*arctan(d*tan(b*x + a) + c) + 2*b*x*dilog(2*((I*c*d - d^2 + 
 d)*tan(b*x + a)^2 - c^2 - I*c*d + (I*c^2 - 2*c*d - I*d^2 + I)*tan(b*x + a 
) + d - 1)/((c^2 + d^2 - 2*d + 1)*tan(b*x + a)^2 + c^2 + d^2 - 2*d + 1) + 
1) - 2*b*x*dilog(2*((I*c*d - d^2 - d)*tan(b*x + a)^2 - c^2 - I*c*d + (I*c^ 
2 - 2*c*d - I*d^2 + I)*tan(b*x + a) - d - 1)/((c^2 + d^2 + 2*d + 1)*tan(b* 
x + a)^2 + c^2 + d^2 + 2*d + 1) + 1) + 2*b*x*dilog(2*((-I*c*d - d^2 + d)*t 
an(b*x + a)^2 - c^2 + I*c*d + (-I*c^2 - 2*c*d + I*d^2 - I)*tan(b*x + a) + 
d - 1)/((c^2 + d^2 - 2*d + 1)*tan(b*x + a)^2 + c^2 + d^2 - 2*d + 1) + 1) - 
 2*b*x*dilog(2*((-I*c*d - d^2 - d)*tan(b*x + a)^2 - c^2 + I*c*d + (-I*c^2 
- 2*c*d + I*d^2 - I)*tan(b*x + a) - d - 1)/((c^2 + d^2 + 2*d + 1)*tan(b*x 
+ a)^2 + c^2 + d^2 + 2*d + 1) + 1) - 2*I*a^2*log(((I*c*d + d^2 + d)*tan(b* 
x + a)^2 - c^2 + I*c*d + (I*c^2 + I*d^2 + 2*I*d + I)*tan(b*x + a) - d - 1) 
/(tan(b*x + a)^2 + 1)) + 2*I*a^2*log(((I*c*d + d^2 - d)*tan(b*x + a)^2 - c 
^2 + I*c*d + (I*c^2 + I*d^2 - 2*I*d + I)*tan(b*x + a) + d - 1)/(tan(b*x + 
a)^2 + 1)) - 2*I*a^2*log(((I*c*d - d^2 + d)*tan(b*x + a)^2 + c^2 + I*c*d + 
 (I*c^2 + I*d^2 - 2*I*d + I)*tan(b*x + a) - d + 1)/(tan(b*x + a)^2 + 1)) + 
 2*I*a^2*log(((I*c*d - d^2 - d)*tan(b*x + a)^2 + c^2 + I*c*d + (I*c^2 + I* 
d^2 + 2*I*d + I)*tan(b*x + a) + d + 1)/(tan(b*x + a)^2 + 1)) - 2*(I*b^2*x^ 
2 - I*a^2)*log(-2*((I*c*d - d^2 + d)*tan(b*x + a)^2 - c^2 - I*c*d + (I*c^2 
 - 2*c*d - I*d^2 + I)*tan(b*x + a) + d - 1)/((c^2 + d^2 - 2*d + 1)*tan(...
 

Sympy [F]

\[ \int x \arctan (c+d \tan (a+b x)) \, dx=\int x \operatorname {atan}{\left (c + d \tan {\left (a + b x \right )} \right )}\, dx \] Input:

integrate(x*atan(c+d*tan(b*x+a)),x)
 

Output:

Integral(x*atan(c + d*tan(a + b*x)), x)
 

Maxima [F]

\[ \int x \arctan (c+d \tan (a+b x)) \, dx=\int { x \arctan \left (d \tan \left (b x + a\right ) + c\right ) \,d x } \] Input:

integrate(x*arctan(c+d*tan(b*x+a)),x, algorithm="maxima")
 

Output:

1/4*x^2*arctan2(c*cos(2*b*x + 2*a) + (d + 1)*sin(2*b*x + 2*a) + c, (d + 1) 
*cos(2*b*x + 2*a) - c*sin(2*b*x + 2*a) - d + 1) + 1/4*x^2*arctan2(c*cos(2* 
b*x + 2*a) + (d - 1)*sin(2*b*x + 2*a) + c, -(d - 1)*cos(2*b*x + 2*a) + c*s 
in(2*b*x + 2*a) + d + 1) + 2*b*d*integrate(-(2*(c^2 + d^2 + 1)*x^2*cos(2*b 
*x + 2*a)^2 + 2*c*d*x^2*sin(2*b*x + 2*a) + 2*(c^2 + d^2 + 1)*x^2*sin(2*b*x 
 + 2*a)^2 + (c^2 - d^2 + 1)*x^2*cos(2*b*x + 2*a) - (2*c*d*x^2*sin(2*b*x + 
2*a) - (c^2 - d^2 + 1)*x^2*cos(2*b*x + 2*a))*cos(4*b*x + 4*a) + (2*c*d*x^2 
*cos(2*b*x + 2*a) + (c^2 - d^2 + 1)*x^2*sin(2*b*x + 2*a))*sin(4*b*x + 4*a) 
)/(c^4 + d^4 + 2*(c^2 - 1)*d^2 + (c^4 + d^4 + 2*(c^2 - 1)*d^2 + 2*c^2 + 1) 
*cos(4*b*x + 4*a)^2 + 4*(c^4 + d^4 + 2*(c^2 + 1)*d^2 + 2*c^2 + 1)*cos(2*b* 
x + 2*a)^2 + (c^4 + d^4 + 2*(c^2 - 1)*d^2 + 2*c^2 + 1)*sin(4*b*x + 4*a)^2 
+ 4*(c^4 + d^4 + 2*(c^2 + 1)*d^2 + 2*c^2 + 1)*sin(2*b*x + 2*a)^2 + 2*c^2 + 
 2*(c^4 + d^4 - 2*(3*c^2 + 1)*d^2 + 2*c^2 + 2*(c^4 - d^4 + 2*c^2 + 1)*cos( 
2*b*x + 2*a) - 4*(c*d^3 + (c^3 + c)*d)*sin(2*b*x + 2*a) + 1)*cos(4*b*x + 4 
*a) + 4*(c^4 - d^4 + 2*c^2 + 1)*cos(2*b*x + 2*a) - 4*(2*c*d^3 - 2*(c^3 + c 
)*d - 2*(c*d^3 + (c^3 + c)*d)*cos(2*b*x + 2*a) - (c^4 - d^4 + 2*c^2 + 1)*s 
in(2*b*x + 2*a))*sin(4*b*x + 4*a) + 8*(c*d^3 + (c^3 + c)*d)*sin(2*b*x + 2* 
a) + 1), x)
 

Giac [F]

\[ \int x \arctan (c+d \tan (a+b x)) \, dx=\int { x \arctan \left (d \tan \left (b x + a\right ) + c\right ) \,d x } \] Input:

integrate(x*arctan(c+d*tan(b*x+a)),x, algorithm="giac")
 

Output:

integrate(x*arctan(d*tan(b*x + a) + c), x)
 

Mupad [F(-1)]

Timed out. \[ \int x \arctan (c+d \tan (a+b x)) \, dx=\int x\,\mathrm {atan}\left (c+d\,\mathrm {tan}\left (a+b\,x\right )\right ) \,d x \] Input:

int(x*atan(c + d*tan(a + b*x)),x)
 

Output:

int(x*atan(c + d*tan(a + b*x)), x)
 

Reduce [F]

\[ \int x \arctan (c+d \tan (a+b x)) \, dx=\int \mathit {atan} \left (\tan \left (b x +a \right ) d +c \right ) x d x \] Input:

int(x*atan(c+d*tan(b*x+a)),x)
 

Output:

int(atan(tan(a + b*x)*d + c)*x,x)