\(\int \frac {\arctan (a+b x)}{x^2} \, dx\) [6]

Optimal result
Mathematica [C] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [C] (verification not implemented)
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 62 \[ \int \frac {\arctan (a+b x)}{x^2} \, dx=-\frac {a b \arctan (a+b x)}{1+a^2}-\frac {\arctan (a+b x)}{x}+\frac {b \log (x)}{1+a^2}-\frac {b \log \left (1+(a+b x)^2\right )}{2 \left (1+a^2\right )} \] Output:

-a*b*arctan(b*x+a)/(a^2+1)-arctan(b*x+a)/x+b*ln(x)/(a^2+1)-b*ln(1+(b*x+a)^ 
2)/(2*a^2+2)
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.04 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.08 \[ \int \frac {\arctan (a+b x)}{x^2} \, dx=-\frac {\arctan (a+b x)}{x}+\frac {b (2 \log (x)+i (i+a) \log (i-a-b x)+(-1-i a) \log (i+a+b x))}{2 \left (1+a^2\right )} \] Input:

Integrate[ArcTan[a + b*x]/x^2,x]
 

Output:

-(ArcTan[a + b*x]/x) + (b*(2*Log[x] + I*(I + a)*Log[I - a - b*x] + (-1 - I 
*a)*Log[I + a + b*x]))/(2*(1 + a^2))
 

Rubi [A] (verified)

Time = 0.24 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.97, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.700, Rules used = {5568, 896, 25, 479, 452, 216, 240}

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

\(\Big \downarrow \) 5568

\(\displaystyle b \int \frac {1}{x \left ((a+b x)^2+1\right )}dx-\frac {\arctan (a+b x)}{x}\)

\(\Big \downarrow \) 896

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 479

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

\(\Big \downarrow \) 452

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

\(\Big \downarrow \) 216

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

\(\Big \downarrow \) 240

\(\displaystyle b \left (\frac {\log (-b x)}{a^2+1}-\frac {a \arctan (a+b x)+\frac {1}{2} \log \left ((a+b x)^2+1\right )}{a^2+1}\right )-\frac {\arctan (a+b x)}{x}\)

Input:

Int[ArcTan[a + b*x]/x^2,x]
 

Output:

-(ArcTan[a + b*x]/x) + b*(Log[-(b*x)]/(1 + a^2) - (a*ArcTan[a + b*x] + Log 
[1 + (a + b*x)^2]/2)/(1 + a^2))
 

Defintions of rubi rules used

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

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 240
Int[(x_)/((a_) + (b_.)*(x_)^2), x_Symbol] :> Simp[Log[RemoveContent[a + b*x 
^2, x]]/(2*b), x] /; FreeQ[{a, b}, x]
 

rule 452
Int[((c_) + (d_.)*(x_))/((a_) + (b_.)*(x_)^2), x_Symbol] :> Simp[c   Int[1/ 
(a + b*x^2), x], x] + Simp[d   Int[x/(a + b*x^2), x], x] /; FreeQ[{a, b, c, 
 d}, x] && NeQ[b*c^2 + a*d^2, 0]
 

rule 479
Int[1/(((c_) + (d_.)*(x_))*((a_) + (b_.)*(x_)^2)), x_Symbol] :> Simp[d*(Log 
[RemoveContent[c + d*x, x]]/(b*c^2 + a*d^2)), x] + Simp[b/(b*c^2 + a*d^2) 
 Int[(c - d*x)/(a + b*x^2), x], x] /; FreeQ[{a, b, c, d}, x]
 

rule 896
Int[((a_) + (b_.)*(v_)^(n_))^(p_.)*(x_)^(m_.), x_Symbol] :> With[{c = Coeff 
icient[v, x, 0], d = Coefficient[v, x, 1]}, Simp[1/d^(m + 1)   Subst[Int[Si 
mplifyIntegrand[(x - c)^m*(a + b*x^n)^p, x], x], x, v], x] /; NeQ[c, 0]] /; 
 FreeQ[{a, b, n, p}, x] && LinearQ[v, x] && IntegerQ[m]
 

rule 5568
Int[((a_.) + ArcTan[(c_) + (d_.)*(x_)]*(b_.))^(p_.)*((e_.) + (f_.)*(x_))^(m 
_), x_Symbol] :> Simp[(e + f*x)^(m + 1)*((a + b*ArcTan[c + d*x])^p/(f*(m + 
1))), x] - Simp[b*d*(p/(f*(m + 1)))   Int[(e + f*x)^(m + 1)*((a + b*ArcTan[ 
c + d*x])^(p - 1)/(1 + (c + d*x)^2)), x], x] /; FreeQ[{a, b, c, d, e, f}, x 
] && IGtQ[p, 0] && ILtQ[m, -1]
 
Maple [A] (verified)

Time = 0.10 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.98

method result size
derivativedivides \(b \left (-\frac {\arctan \left (b x +a \right )}{b x}+\frac {\ln \left (-b x \right )}{a^{2}+1}-\frac {\frac {\ln \left (1+\left (b x +a \right )^{2}\right )}{2}+a \arctan \left (b x +a \right )}{a^{2}+1}\right )\) \(61\)
default \(b \left (-\frac {\arctan \left (b x +a \right )}{b x}+\frac {\ln \left (-b x \right )}{a^{2}+1}-\frac {\frac {\ln \left (1+\left (b x +a \right )^{2}\right )}{2}+a \arctan \left (b x +a \right )}{a^{2}+1}\right )\) \(61\)
parts \(-\frac {\arctan \left (b x +a \right )}{x}+b \left (-\frac {b \left (\frac {\ln \left (b^{2} x^{2}+2 a b x +a^{2}+1\right )}{2 b}+\frac {a \arctan \left (\frac {2 b^{2} x +2 a b}{2 b}\right )}{b}\right )}{a^{2}+1}+\frac {\ln \left (x \right )}{a^{2}+1}\right )\) \(82\)
parallelrisch \(\frac {-2 x \arctan \left (b x +a \right ) a^{2} b^{2}+2 b^{2} \ln \left (x \right ) a x -b^{2} \ln \left (b^{2} x^{2}+2 a b x +a^{2}+1\right ) a x -2 \arctan \left (b x +a \right ) a^{3} b -2 \arctan \left (b x +a \right ) b a}{2 x a b \left (a^{2}+1\right )}\) \(91\)
risch \(\frac {i \ln \left (1+i \left (b x +a \right )\right )}{2 x}-\frac {i \left (a^{2} \ln \left (1-i \left (b x +a \right )\right )+\ln \left (1-i \left (b x +a \right )\right )-i \ln \left (\left (-a^{2} b +3 i a b \right ) x -3 a +2 i a^{2}-a^{3}\right ) b x -i \ln \left (\left (-a^{2} b -3 i a b \right ) x -3 a -2 i a^{2}-a^{3}\right ) b x +2 i \ln \left (x \right ) b x +\ln \left (\left (-a^{2} b +3 i a b \right ) x -3 a +2 i a^{2}-a^{3}\right ) a b x -\ln \left (\left (-a^{2} b -3 i a b \right ) x -3 a -2 i a^{2}-a^{3}\right ) a b x \right )}{2 x \left (i+a \right ) \left (a -i\right )}\) \(210\)

Input:

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

Output:

b*(-arctan(b*x+a)/b/x+1/(a^2+1)*ln(-b*x)-1/(a^2+1)*(1/2*ln(1+(b*x+a)^2)+a* 
arctan(b*x+a)))
 

Fricas [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.92 \[ \int \frac {\arctan (a+b x)}{x^2} \, dx=-\frac {b x \log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + 1\right ) - 2 \, b x \log \left (x\right ) + 2 \, {\left (a b x + a^{2} + 1\right )} \arctan \left (b x + a\right )}{2 \, {\left (a^{2} + 1\right )} x} \] Input:

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

Output:

-1/2*(b*x*log(b^2*x^2 + 2*a*b*x + a^2 + 1) - 2*b*x*log(x) + 2*(a*b*x + a^2 
 + 1)*arctan(b*x + a))/((a^2 + 1)*x)
 

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.79 (sec) , antiderivative size = 168, normalized size of antiderivative = 2.71 \[ \int \frac {\arctan (a+b x)}{x^2} \, dx=\begin {cases} - \frac {i b \operatorname {atan}{\left (b x - i \right )}}{2} - \frac {\operatorname {atan}{\left (b x - i \right )}}{x} - \frac {i}{2 x} & \text {for}\: a = - i \\\frac {i b \operatorname {atan}{\left (b x + i \right )}}{2} - \frac {\operatorname {atan}{\left (b x + i \right )}}{x} + \frac {i}{2 x} & \text {for}\: a = i \\- \frac {2 a^{2} \operatorname {atan}{\left (a + b x \right )}}{2 a^{2} x + 2 x} - \frac {2 a b x \operatorname {atan}{\left (a + b x \right )}}{2 a^{2} x + 2 x} + \frac {2 b x \log {\left (x \right )}}{2 a^{2} x + 2 x} - \frac {b x \log {\left (a^{2} + 2 a b x + b^{2} x^{2} + 1 \right )}}{2 a^{2} x + 2 x} - \frac {2 \operatorname {atan}{\left (a + b x \right )}}{2 a^{2} x + 2 x} & \text {otherwise} \end {cases} \] Input:

integrate(atan(b*x+a)/x**2,x)
 

Output:

Piecewise((-I*b*atan(b*x - I)/2 - atan(b*x - I)/x - I/(2*x), Eq(a, -I)), ( 
I*b*atan(b*x + I)/2 - atan(b*x + I)/x + I/(2*x), Eq(a, I)), (-2*a**2*atan( 
a + b*x)/(2*a**2*x + 2*x) - 2*a*b*x*atan(a + b*x)/(2*a**2*x + 2*x) + 2*b*x 
*log(x)/(2*a**2*x + 2*x) - b*x*log(a**2 + 2*a*b*x + b**2*x**2 + 1)/(2*a**2 
*x + 2*x) - 2*atan(a + b*x)/(2*a**2*x + 2*x), True))
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.24 \[ \int \frac {\arctan (a+b x)}{x^2} \, dx=-\frac {1}{2} \, b {\left (\frac {2 \, a \arctan \left (\frac {b^{2} x + a b}{b}\right )}{a^{2} + 1} + \frac {\log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + 1\right )}{a^{2} + 1} - \frac {2 \, \log \left (x\right )}{a^{2} + 1}\right )} - \frac {\arctan \left (b x + a\right )}{x} \] Input:

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

Output:

-1/2*b*(2*a*arctan((b^2*x + a*b)/b)/(a^2 + 1) + log(b^2*x^2 + 2*a*b*x + a^ 
2 + 1)/(a^2 + 1) - 2*log(x)/(a^2 + 1)) - arctan(b*x + a)/x
 

Giac [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.13 \[ \int \frac {\arctan (a+b x)}{x^2} \, dx=-\frac {1}{2} \, b {\left (\frac {2 \, a \arctan \left (b x + a\right )}{a^{2} + 1} + \frac {\log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + 1\right )}{a^{2} + 1} - \frac {2 \, \log \left ({\left | x \right |}\right )}{a^{2} + 1}\right )} - \frac {\arctan \left (b x + a\right )}{x} \] Input:

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

Output:

-1/2*b*(2*a*arctan(b*x + a)/(a^2 + 1) + log(b^2*x^2 + 2*a*b*x + a^2 + 1)/( 
a^2 + 1) - 2*log(abs(x))/(a^2 + 1)) - arctan(b*x + a)/x
 

Mupad [B] (verification not implemented)

Time = 1.43 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.02 \[ \int \frac {\arctan (a+b x)}{x^2} \, dx=-\frac {\mathrm {atan}\left (a+b\,x\right )}{x}-\frac {\frac {b\,x\,\ln \left (a^2+2\,a\,b\,x+b^2\,x^2+1\right )}{2}-b\,x\,\ln \left (x\right )+a\,b\,x\,\mathrm {atan}\left (a+b\,x\right )}{x\,\left (a^2+1\right )} \] Input:

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

Output:

- atan(a + b*x)/x - ((b*x*log(a^2 + b^2*x^2 + 2*a*b*x + 1))/2 - b*x*log(x) 
 + a*b*x*atan(a + b*x))/(x*(a^2 + 1))
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.15 \[ \int \frac {\arctan (a+b x)}{x^2} \, dx=\frac {-2 \mathit {atan} \left (b x +a \right ) a^{2}-2 \mathit {atan} \left (b x +a \right ) a b x -2 \mathit {atan} \left (b x +a \right )-\mathrm {log}\left (b^{2} x^{2}+2 a b x +a^{2}+1\right ) b x +2 \,\mathrm {log}\left (x \right ) b x}{2 x \left (a^{2}+1\right )} \] Input:

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

Output:

( - 2*atan(a + b*x)*a**2 - 2*atan(a + b*x)*a*b*x - 2*atan(a + b*x) - log(a 
**2 + 2*a*b*x + b**2*x**2 + 1)*b*x + 2*log(x)*b*x)/(2*x*(a**2 + 1))