### 3.181 $$\int \frac{1}{(a+x) (b+x)} \, dx$$

Optimal. Leaf size=26 $\frac{\log (b+x)}{a-b}-\frac{\log (a+x)}{a-b}$

[Out]

-(Log[a + x]/(a - b)) + Log[b + x]/(a - b)

________________________________________________________________________________________

Rubi [A]  time = 0.0057296, antiderivative size = 26, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 11, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.182, Rules used = {36, 31} $\frac{\log (b+x)}{a-b}-\frac{\log (a+x)}{a-b}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-(Log[a + x]/(a - b)) + Log[b + x]/(a - b)

Rule 36

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

Rule 31

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

Rubi steps

\begin{align*} \int \frac{1}{(a+x) (b+x)} \, dx &=\frac{\int \frac{1}{a+x} \, dx}{-a+b}-\frac{\int \frac{1}{b+x} \, dx}{-a+b}\\ &=-\frac{\log (a+x)}{a-b}+\frac{\log (b+x)}{a-b}\\ \end{align*}

Mathematica [A]  time = 0.0065485, size = 19, normalized size = 0.73 $\frac{\log (b+x)-\log (a+x)}{a-b}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(-Log[a + x] + Log[b + x])/(a - b)

________________________________________________________________________________________

Maple [A]  time = 0.006, size = 27, normalized size = 1. \begin{align*} -{\frac{\ln \left ( a+x \right ) }{a-b}}+{\frac{\ln \left ( b+x \right ) }{a-b}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+x)/(b+x),x)

[Out]

-ln(a+x)/(a-b)+ln(b+x)/(a-b)

________________________________________________________________________________________

Maxima [A]  time = 0.928666, size = 35, normalized size = 1.35 \begin{align*} -\frac{\log \left (a + x\right )}{a - b} + \frac{\log \left (b + x\right )}{a - b} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+x)/(b+x),x, algorithm="maxima")

[Out]

-log(a + x)/(a - b) + log(b + x)/(a - b)

________________________________________________________________________________________

Fricas [A]  time = 1.8644, size = 49, normalized size = 1.88 \begin{align*} -\frac{\log \left (a + x\right ) - \log \left (b + x\right )}{a - b} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+x)/(b+x),x, algorithm="fricas")

[Out]

-(log(a + x) - log(b + x))/(a - b)

________________________________________________________________________________________

Sympy [B]  time = 0.197396, size = 80, normalized size = 3.08 \begin{align*} \frac{\log{\left (- \frac{a^{2}}{2 \left (a - b\right )} + \frac{a b}{a - b} + \frac{a}{2} - \frac{b^{2}}{2 \left (a - b\right )} + \frac{b}{2} + x \right )}}{a - b} - \frac{\log{\left (\frac{a^{2}}{2 \left (a - b\right )} - \frac{a b}{a - b} + \frac{a}{2} + \frac{b^{2}}{2 \left (a - b\right )} + \frac{b}{2} + x \right )}}{a - b} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+x)/(b+x),x)

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.05028, size = 38, normalized size = 1.46 \begin{align*} -\frac{\log \left ({\left | a + x \right |}\right )}{a - b} + \frac{\log \left ({\left | b + x \right |}\right )}{a - b} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+x)/(b+x),x, algorithm="giac")

[Out]

-log(abs(a + x))/(a - b) + log(abs(b + x))/(a - b)