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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [B] (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 = 15, antiderivative size = 79 \[ \int \frac {1}{x^2 \left (c+(a+b x)^2\right )} \, dx=-\frac {1}{\left (a^2+c\right ) x}+\frac {b \left (a^2-c\right ) \arctan \left (\frac {a+b x}{\sqrt {c}}\right )}{\sqrt {c} \left (a^2+c\right )^2}-\frac {2 a b \log (x)}{\left (a^2+c\right )^2}+\frac {a b \log \left (c+(a+b x)^2\right )}{\left (a^2+c\right )^2} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.18, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {896, 480, 657, 2009}

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

\(\Big \downarrow \) 896

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

\(\Big \downarrow \) 480

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

\(\Big \downarrow \) 657

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 480
Int[((c_) + (d_.)*(x_))^(n_)/((a_) + (b_.)*(x_)^2), x_Symbol] :> Simp[d*((c 
 + d*x)^(n + 1)/((n + 1)*(b*c^2 + a*d^2))), x] + Simp[b/(b*c^2 + a*d^2)   I 
nt[(c + d*x)^(n + 1)*((c - d*x)/(a + b*x^2)), x], x] /; FreeQ[{a, b, c, d}, 
 x] && ILtQ[n, -1]
 

rule 657
Int[(((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.))/((a_) + (c_.)*( 
x_)^2), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*((f + g*x)^n/(a + c*x^ 
2)), x], x] /; FreeQ[{a, c, d, e, f, g, m}, x] && IntegersQ[n]
 

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 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 
Maple [A] (verified)

Time = 0.54 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.22

method result size
default \(\frac {b^{2} \left (\frac {a \ln \left (b^{2} x^{2}+2 a b x +a^{2}+c \right )}{b}+\frac {\left (a^{2}-c \right ) \arctan \left (\frac {2 b^{2} x +2 a b}{2 b \sqrt {c}}\right )}{b \sqrt {c}}\right )}{\left (a^{2}+c \right )^{2}}-\frac {1}{\left (a^{2}+c \right ) x}-\frac {2 a b \ln \left (x \right )}{\left (a^{2}+c \right )^{2}}\) \(96\)
risch \(-\frac {1}{\left (a^{2}+c \right ) x}+\frac {b \ln \left (\left (a^{6} b -15 a^{4} b c -8 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{3} b +15 a^{2} b \,c^{2}+8 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a b c -b \,c^{3}\right ) x +a^{7}-7 c \,a^{5}-7 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{4}-c^{2} a^{3}-6 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{2} c +7 c^{3} a +\sqrt {-c \left (a^{2}-c \right )^{2}}\, c^{2}\right ) a}{a^{4}+2 a^{2} c +c^{2}}+\frac {b \ln \left (\left (a^{6} b -15 a^{4} b c -8 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{3} b +15 a^{2} b \,c^{2}+8 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a b c -b \,c^{3}\right ) x +a^{7}-7 c \,a^{5}-7 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{4}-c^{2} a^{3}-6 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{2} c +7 c^{3} a +\sqrt {-c \left (a^{2}-c \right )^{2}}\, c^{2}\right ) \sqrt {-c \left (a^{2}-c \right )^{2}}}{2 c \left (a^{4}+2 a^{2} c +c^{2}\right )}+\frac {b \ln \left (\left (a^{6} b -15 a^{4} b c +8 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{3} b +15 a^{2} b \,c^{2}-8 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a b c -b \,c^{3}\right ) x +a^{7}-7 c \,a^{5}+7 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{4}-c^{2} a^{3}+6 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{2} c +7 c^{3} a -\sqrt {-c \left (a^{2}-c \right )^{2}}\, c^{2}\right ) a}{a^{4}+2 a^{2} c +c^{2}}-\frac {b \ln \left (\left (a^{6} b -15 a^{4} b c +8 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{3} b +15 a^{2} b \,c^{2}-8 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a b c -b \,c^{3}\right ) x +a^{7}-7 c \,a^{5}+7 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{4}-c^{2} a^{3}+6 \sqrt {-c \left (a^{2}-c \right )^{2}}\, a^{2} c +7 c^{3} a -\sqrt {-c \left (a^{2}-c \right )^{2}}\, c^{2}\right ) \sqrt {-c \left (a^{2}-c \right )^{2}}}{2 c \left (a^{4}+2 a^{2} c +c^{2}\right )}-\frac {2 a b \ln \left (x \right )}{a^{4}+2 a^{2} c +c^{2}}\) \(747\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 229, normalized size of antiderivative = 2.90 \[ \int \frac {1}{x^2 \left (c+(a+b x)^2\right )} \, dx=\left [\frac {2 \, a b c x \log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + c\right ) - 4 \, a b c x \log \left (x\right ) + {\left (a^{2} b - b c\right )} \sqrt {-c} x \log \left (\frac {b^{2} x^{2} + 2 \, a b x + a^{2} + 2 \, {\left (b x + a\right )} \sqrt {-c} - c}{b^{2} x^{2} + 2 \, a b x + a^{2} + c}\right ) - 2 \, a^{2} c - 2 \, c^{2}}{2 \, {\left (a^{4} c + 2 \, a^{2} c^{2} + c^{3}\right )} x}, \frac {a b c x \log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + c\right ) - 2 \, a b c x \log \left (x\right ) + {\left (a^{2} b - b c\right )} \sqrt {c} x \arctan \left (\frac {b x + a}{\sqrt {c}}\right ) - a^{2} c - c^{2}}{{\left (a^{4} c + 2 \, a^{2} c^{2} + c^{3}\right )} x}\right ] \] Input:

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

Output:

[1/2*(2*a*b*c*x*log(b^2*x^2 + 2*a*b*x + a^2 + c) - 4*a*b*c*x*log(x) + (a^2 
*b - b*c)*sqrt(-c)*x*log((b^2*x^2 + 2*a*b*x + a^2 + 2*(b*x + a)*sqrt(-c) - 
 c)/(b^2*x^2 + 2*a*b*x + a^2 + c)) - 2*a^2*c - 2*c^2)/((a^4*c + 2*a^2*c^2 
+ c^3)*x), (a*b*c*x*log(b^2*x^2 + 2*a*b*x + a^2 + c) - 2*a*b*c*x*log(x) + 
(a^2*b - b*c)*sqrt(c)*x*arctan((b*x + a)/sqrt(c)) - a^2*c - c^2)/((a^4*c + 
 2*a^2*c^2 + c^3)*x)]
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1620 vs. \(2 (73) = 146\).

Time = 5.39 (sec) , antiderivative size = 1620, normalized size of antiderivative = 20.51 \[ \int \frac {1}{x^2 \left (c+(a+b x)^2\right )} \, dx=\text {Too large to display} \] Input:

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

Output:

-2*a*b*log(x + (-16*a**13*b**2*c/(a**2 + c)**4 + 48*a**11*b**2*c**2/(a**2 
+ c)**4 + 352*a**9*b**2*c**3/(a**2 + c)**4 - 20*a**9*b**2*c/(a**2 + c)**2 
+ 608*a**7*b**2*c**4/(a**2 + c)**4 - 64*a**7*b**2*c**2/(a**2 + c)**2 + 432 
*a**5*b**2*c**5/(a**2 + c)**4 - 72*a**5*b**2*c**3/(a**2 + c)**2 + 36*a**5* 
b**2*c + 112*a**3*b**2*c**6/(a**2 + c)**4 - 32*a**3*b**2*c**4/(a**2 + c)** 
2 - 88*a**3*b**2*c**2 - 4*a*b**2*c**5/(a**2 + c)**2 + 4*a*b**2*c**3)/(a**6 
*b**3 + 33*a**4*b**3*c - 33*a**2*b**3*c**2 - b**3*c**3))/(a**2 + c)**2 + ( 
a*b/(a**2 + c)**2 - b*sqrt(-c)*(a**2 - c)/(2*c*(a**4 + 2*a**2*c + c**2)))* 
log(x + (-4*a**11*c*(a*b/(a**2 + c)**2 - b*sqrt(-c)*(a**2 - c)/(2*c*(a**4 
+ 2*a**2*c + c**2)))**2 + 12*a**9*c**2*(a*b/(a**2 + c)**2 - b*sqrt(-c)*(a* 
*2 - c)/(2*c*(a**4 + 2*a**2*c + c**2)))**2 + 10*a**8*b*c*(a*b/(a**2 + c)** 
2 - b*sqrt(-c)*(a**2 - c)/(2*c*(a**4 + 2*a**2*c + c**2))) + 88*a**7*c**3*( 
a*b/(a**2 + c)**2 - b*sqrt(-c)*(a**2 - c)/(2*c*(a**4 + 2*a**2*c + c**2)))* 
*2 + 32*a**6*b*c**2*(a*b/(a**2 + c)**2 - b*sqrt(-c)*(a**2 - c)/(2*c*(a**4 
+ 2*a**2*c + c**2))) + 36*a**5*b**2*c + 152*a**5*c**4*(a*b/(a**2 + c)**2 - 
 b*sqrt(-c)*(a**2 - c)/(2*c*(a**4 + 2*a**2*c + c**2)))**2 + 36*a**4*b*c**3 
*(a*b/(a**2 + c)**2 - b*sqrt(-c)*(a**2 - c)/(2*c*(a**4 + 2*a**2*c + c**2)) 
) - 88*a**3*b**2*c**2 + 108*a**3*c**5*(a*b/(a**2 + c)**2 - b*sqrt(-c)*(a** 
2 - c)/(2*c*(a**4 + 2*a**2*c + c**2)))**2 + 16*a**2*b*c**4*(a*b/(a**2 + c) 
**2 - b*sqrt(-c)*(a**2 - c)/(2*c*(a**4 + 2*a**2*c + c**2))) + 4*a*b**2*...
 

Maxima [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.56 \[ \int \frac {1}{x^2 \left (c+(a+b x)^2\right )} \, dx=\frac {a b \log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + c\right )}{a^{4} + 2 \, a^{2} c + c^{2}} - \frac {2 \, a b \log \left (x\right )}{a^{4} + 2 \, a^{2} c + c^{2}} + \frac {{\left (a^{2} b^{2} - b^{2} c\right )} \arctan \left (\frac {b^{2} x + a b}{b \sqrt {c}}\right )}{{\left (a^{4} + 2 \, a^{2} c + c^{2}\right )} b \sqrt {c}} - \frac {1}{{\left (a^{2} + c\right )} x} \] Input:

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

Output:

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

Giac [A] (verification not implemented)

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 9.41 (sec) , antiderivative size = 425, normalized size of antiderivative = 5.38 \[ \int \frac {1}{x^2 \left (c+(a+b x)^2\right )} \, dx=\frac {\ln \left ({\left (-c\right )}^{13/2}-35\,a^2\,{\left (-c\right )}^{11/2}+34\,a^4\,{\left (-c\right )}^{9/2}+34\,a^6\,{\left (-c\right )}^{7/2}-35\,a^8\,{\left (-c\right )}^{5/2}+a^{10}\,{\left (-c\right )}^{3/2}+a\,c^6-a^{11}\,c+35\,a^3\,c^5+34\,a^5\,c^4-34\,a^7\,c^3-35\,a^9\,c^2+b\,c^6\,x-a^{10}\,b\,c\,x+35\,a^2\,b\,c^5\,x+34\,a^4\,b\,c^4\,x-34\,a^6\,b\,c^3\,x-35\,a^8\,b\,c^2\,x\right )\,\left (b\,{\left (-c\right )}^{3/2}+2\,a\,b\,c+a^2\,b\,\sqrt {-c}\right )}{2\,\left (a^4\,c+2\,a^2\,c^2+c^3\right )}-\frac {1}{x\,\left (a^2+c\right )}-\frac {\ln \left ({\left (-c\right )}^{13/2}-35\,a^2\,{\left (-c\right )}^{11/2}+34\,a^4\,{\left (-c\right )}^{9/2}+34\,a^6\,{\left (-c\right )}^{7/2}-35\,a^8\,{\left (-c\right )}^{5/2}+a^{10}\,{\left (-c\right )}^{3/2}-a\,c^6+a^{11}\,c-35\,a^3\,c^5-34\,a^5\,c^4+34\,a^7\,c^3+35\,a^9\,c^2-b\,c^6\,x+a^{10}\,b\,c\,x-35\,a^2\,b\,c^5\,x-34\,a^4\,b\,c^4\,x+34\,a^6\,b\,c^3\,x+35\,a^8\,b\,c^2\,x\right )\,\left (b\,{\left (-c\right )}^{3/2}-2\,a\,b\,c+a^2\,b\,\sqrt {-c}\right )}{2\,\left (a^4\,c+2\,a^2\,c^2+c^3\right )}-\frac {2\,a\,b\,\ln \left (x\right )}{{\left (a^2+c\right )}^2} \] Input:

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

Output:

(log((-c)^(13/2) - 35*a^2*(-c)^(11/2) + 34*a^4*(-c)^(9/2) + 34*a^6*(-c)^(7 
/2) - 35*a^8*(-c)^(5/2) + a^10*(-c)^(3/2) + a*c^6 - a^11*c + 35*a^3*c^5 + 
34*a^5*c^4 - 34*a^7*c^3 - 35*a^9*c^2 + b*c^6*x - a^10*b*c*x + 35*a^2*b*c^5 
*x + 34*a^4*b*c^4*x - 34*a^6*b*c^3*x - 35*a^8*b*c^2*x)*(b*(-c)^(3/2) + 2*a 
*b*c + a^2*b*(-c)^(1/2)))/(2*(a^4*c + c^3 + 2*a^2*c^2)) - 1/(x*(c + a^2)) 
- (log((-c)^(13/2) - 35*a^2*(-c)^(11/2) + 34*a^4*(-c)^(9/2) + 34*a^6*(-c)^ 
(7/2) - 35*a^8*(-c)^(5/2) + a^10*(-c)^(3/2) - a*c^6 + a^11*c - 35*a^3*c^5 
- 34*a^5*c^4 + 34*a^7*c^3 + 35*a^9*c^2 - b*c^6*x + a^10*b*c*x - 35*a^2*b*c 
^5*x - 34*a^4*b*c^4*x + 34*a^6*b*c^3*x + 35*a^8*b*c^2*x)*(b*(-c)^(3/2) - 2 
*a*b*c + a^2*b*(-c)^(1/2)))/(2*(a^4*c + c^3 + 2*a^2*c^2)) - (2*a*b*log(x)) 
/(c + a^2)^2
 

Reduce [B] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.29 \[ \int \frac {1}{x^2 \left (c+(a+b x)^2\right )} \, dx=\frac {\sqrt {c}\, \mathit {atan} \left (\frac {b x +a}{\sqrt {c}}\right ) a^{2} b x -\sqrt {c}\, \mathit {atan} \left (\frac {b x +a}{\sqrt {c}}\right ) b c x +\mathrm {log}\left (b^{2} x^{2}+2 a b x +a^{2}+c \right ) a b c x -2 \,\mathrm {log}\left (x \right ) a b c x -a^{2} c -c^{2}}{c x \left (a^{4}+2 a^{2} c +c^{2}\right )} \] Input:

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

Output:

(sqrt(c)*atan((a + b*x)/sqrt(c))*a**2*b*x - sqrt(c)*atan((a + b*x)/sqrt(c) 
)*b*c*x + log(a**2 + 2*a*b*x + b**2*x**2 + c)*a*b*c*x - 2*log(x)*a*b*c*x - 
 a**2*c - c**2)/(c*x*(a**4 + 2*a**2*c + c**2))