3.2.81 \(\int \frac {1}{(a+x) (b+x)} \, dx\) [181]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 26, normalized size of antiderivative = 1.00, 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} \begin {gather*} \frac {\log (b+x)}{a-b}-\frac {\log (a+x)}{a-b} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 31

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

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]

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.00, size = 19, normalized size = 0.73 \begin {gather*} \frac {-\log (a+x)+\log (b+x)}{a-b} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Mathics [A]
time = 2.61, size = 19, normalized size = 0.73 \begin {gather*} \frac {\text {Log}\left [b+x\right ]-\text {Log}\left [a+x\right ]}{a-b} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 27, normalized size = 1.04

method result size
default \(-\frac {\ln \left (a +x \right )}{a -b}+\frac {\ln \left (b +x \right )}{a -b}\) \(27\)
norman \(-\frac {\ln \left (a +x \right )}{a -b}+\frac {\ln \left (b +x \right )}{a -b}\) \(27\)
risch \(-\frac {\ln \left (a +x \right )}{a -b}+\frac {\ln \left (b +x \right )}{a -b}\) \(27\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+x)/(b+x),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.25, size = 26, normalized size = 1.00 \begin {gather*} -\frac {\log \left (a + x\right )}{a - b} + \frac {\log \left (b + x\right )}{a - b} \end {gather*}

Verification 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 = 0.34, size = 20, normalized size = 0.77 \begin {gather*} -\frac {\log \left (a + x\right ) - \log \left (b + x\right )}{a - b} \end {gather*}

Verification 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] Leaf count of result is larger than twice the leaf count of optimal. 80 vs. \(2 (15) = 30\)
time = 0.12, size = 80, normalized size = 3.08 \begin {gather*} \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 {gather*}

Verification 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 = 0.00, size = 23, normalized size = 0.88 \begin {gather*} \frac {\ln \left |x+b\right |}{a-b}+\frac {\ln \left |x+a\right |}{-a+b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.22, size = 18, normalized size = 0.69 \begin {gather*} \frac {\ln \left (\frac {b+x}{a+x}\right )}{a-b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________