3.698 \(\int -\frac{\tan ^{-1}(a-x)}{a+x} \, dx\)

Optimal. Leaf size=122 \[ -\frac{1}{2} i \text{PolyLog}\left (2,1-\frac{2}{1-i (a-x)}\right )+\frac{1}{2} i \text{PolyLog}\left (2,1+\frac{2 (a+x)}{(-2 a+i) (1-i (a-x))}\right )+\log \left (\frac{2}{1-i (a-x)}\right ) \tan ^{-1}(a-x)-\log \left (-\frac{2 (a+x)}{(-2 a+i) (1-i (a-x))}\right ) \tan ^{-1}(a-x) \]

[Out]

ArcTan[a - x]*Log[2/(1 - I*(a - x))] - ArcTan[a - x]*Log[(-2*(a + x))/((I - 2*a)*(1 - I*(a - x)))] - (I/2)*Pol
yLog[2, 1 - 2/(1 - I*(a - x))] + (I/2)*PolyLog[2, 1 + (2*(a + x))/((I - 2*a)*(1 - I*(a - x)))]

________________________________________________________________________________________

Rubi [A]  time = 0.0914153, antiderivative size = 122, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {5047, 4856, 2402, 2315, 2447} \[ -\frac{1}{2} i \text{PolyLog}\left (2,1-\frac{2}{1-i (a-x)}\right )+\frac{1}{2} i \text{PolyLog}\left (2,1+\frac{2 (a+x)}{(-2 a+i) (1-i (a-x))}\right )+\log \left (\frac{2}{1-i (a-x)}\right ) \tan ^{-1}(a-x)-\log \left (-\frac{2 (a+x)}{(-2 a+i) (1-i (a-x))}\right ) \tan ^{-1}(a-x) \]

Antiderivative was successfully verified.

[In]

Int[-(ArcTan[a - x]/(a + x)),x]

[Out]

ArcTan[a - x]*Log[2/(1 - I*(a - x))] - ArcTan[a - x]*Log[(-2*(a + x))/((I - 2*a)*(1 - I*(a - x)))] - (I/2)*Pol
yLog[2, 1 - 2/(1 - I*(a - x))] + (I/2)*PolyLog[2, 1 + (2*(a + x))/((I - 2*a)*(1 - I*(a - x)))]

Rule 5047

Int[((a_.) + ArcTan[(c_) + (d_.)*(x_)]*(b_.))^(p_.)*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Dist[1/d, Subst[I
nt[((d*e - c*f)/d + (f*x)/d)^m*(a + b*ArcTan[x])^p, x], x, c + d*x], x] /; FreeQ[{a, b, c, d, e, f, m, p}, x]
&& IGtQ[p, 0]

Rule 4856

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

Rule 2402

Int[Log[(c_.)/((d_) + (e_.)*(x_))]/((f_) + (g_.)*(x_)^2), x_Symbol] :> -Dist[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 2315

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

Rule 2447

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[RationalFunctionExponen
ts[u, x][[2]], Expon[Pq, x]]

Rubi steps

\begin{align*} \int -\frac{\tan ^{-1}(a-x)}{a+x} \, dx &=\operatorname{Subst}\left (\int \frac{\tan ^{-1}(x)}{2 a-x} \, dx,x,a-x\right )\\ &=\tan ^{-1}(a-x) \log \left (\frac{2}{1-i (a-x)}\right )-\tan ^{-1}(a-x) \log \left (-\frac{2 (a+x)}{(i-2 a) (1-i (a-x))}\right )-\operatorname{Subst}\left (\int \frac{\log \left (\frac{2}{1-i x}\right )}{1+x^2} \, dx,x,a-x\right )+\operatorname{Subst}\left (\int \frac{\log \left (\frac{2 (2 a-x)}{(-i+2 a) (1-i x)}\right )}{1+x^2} \, dx,x,a-x\right )\\ &=\tan ^{-1}(a-x) \log \left (\frac{2}{1-i (a-x)}\right )-\tan ^{-1}(a-x) \log \left (-\frac{2 (a+x)}{(i-2 a) (1-i (a-x))}\right )+\frac{1}{2} i \text{Li}_2\left (1+\frac{2 (a+x)}{(i-2 a) (1-i (a-x))}\right )-i \operatorname{Subst}\left (\int \frac{\log (2 x)}{1-2 x} \, dx,x,\frac{1}{1-i (a-x)}\right )\\ &=\tan ^{-1}(a-x) \log \left (\frac{2}{1-i (a-x)}\right )-\tan ^{-1}(a-x) \log \left (-\frac{2 (a+x)}{(i-2 a) (1-i (a-x))}\right )-\frac{1}{2} i \text{Li}_2\left (1-\frac{2}{1-i (a-x)}\right )+\frac{1}{2} i \text{Li}_2\left (1+\frac{2 (a+x)}{(i-2 a) (1-i (a-x))}\right )\\ \end{align*}

Mathematica [A]  time = 0.0304267, size = 105, normalized size = 0.86 \[ -\frac{1}{2} i \left (\text{PolyLog}\left (2,\frac{a-x+i}{2 a+i}\right )-\text{PolyLog}\left (2,\frac{-a+x+i}{-2 a+i}\right )-\log (1+i (a-x)) \log \left (\frac{a+x}{2 a-i}\right )+\log (-i a+i x+1) \log \left (\frac{a+x}{2 a+i}\right )\right ) \]

Warning: Unable to verify antiderivative.

[In]

Integrate[-(ArcTan[a - x]/(a + x)),x]

[Out]

(-I/2)*(-(Log[1 + I*(a - x)]*Log[(a + x)/(-I + 2*a)]) + Log[1 - I*a + I*x]*Log[(a + x)/(I + 2*a)] + PolyLog[2,
 (I + a - x)/(I + 2*a)] - PolyLog[2, (I - a + x)/(I - 2*a)])

________________________________________________________________________________________

Maple [A]  time = 0.013, size = 102, normalized size = 0.8 \begin{align*} -\ln \left ( a+x \right ) \arctan \left ( a-x \right ) +{\frac{i}{2}}\ln \left ( a+x \right ) \ln \left ({\frac{a-x+i}{2\,a+i}} \right ) -{\frac{i}{2}}\ln \left ( a+x \right ) \ln \left ({\frac{-a+x+i}{i-2\,a}} \right ) +{\frac{i}{2}}{\it dilog} \left ({\frac{a-x+i}{2\,a+i}} \right ) -{\frac{i}{2}}{\it dilog} \left ({\frac{-a+x+i}{i-2\,a}} \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-arctan(a-x)/(a+x),x)

[Out]

-ln(a+x)*arctan(a-x)+1/2*I*ln(a+x)*ln((a-x+I)/(2*a+I))-1/2*I*ln(a+x)*ln((-a+x+I)/(I-2*a))+1/2*I*dilog((a-x+I)/
(2*a+I))-1/2*I*dilog((-a+x+I)/(I-2*a))

________________________________________________________________________________________

Maxima [A]  time = 1.6248, size = 159, normalized size = 1.3 \begin{align*} -\frac{1}{2} \, \arctan \left (\frac{a + x}{4 \, a^{2} + 1}, \frac{2 \,{\left (a^{2} + a x\right )}}{4 \, a^{2} + 1}\right ) \log \left (a^{2} - 2 \, a x + x^{2} + 1\right ) + \frac{1}{2} \, \arctan \left (-a + x\right ) \log \left (\frac{a^{2} + 2 \, a x + x^{2}}{4 \, a^{2} + 1}\right ) - \frac{1}{2} i \,{\rm Li}_2\left (-\frac{-i \, a + i \, x + 1}{2 i \, a - 1}\right ) + \frac{1}{2} i \,{\rm Li}_2\left (-\frac{-i \, a + i \, x - 1}{2 i \, a + 1}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-arctan(a-x)/(a+x),x, algorithm="maxima")

[Out]

-1/2*arctan2((a + x)/(4*a^2 + 1), 2*(a^2 + a*x)/(4*a^2 + 1))*log(a^2 - 2*a*x + x^2 + 1) + 1/2*arctan(-a + x)*l
og((a^2 + 2*a*x + x^2)/(4*a^2 + 1)) - 1/2*I*dilog(-(-I*a + I*x + 1)/(2*I*a - 1)) + 1/2*I*dilog(-(-I*a + I*x -
1)/(2*I*a + 1))

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\arctan \left (-a + x\right )}{a + x}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-arctan(a-x)/(a+x),x, algorithm="fricas")

[Out]

integral(arctan(-a + x)/(a + x), x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} - \int \frac{\operatorname{atan}{\left (a - x \right )}}{a + x}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-atan(a-x)/(a+x),x)

[Out]

-Integral(atan(a - x)/(a + x), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int -\frac{\arctan \left (a - x\right )}{a + x}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-arctan(a-x)/(a+x),x, algorithm="giac")

[Out]

integrate(-arctan(a - x)/(a + x), x)