Optimal. Leaf size=40 \[ \frac {(b+a p) \log (p-x)}{p-q}-\frac {(b+a q) \log (q-x)}{p-q} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.050, Rules used = {78}
\begin {gather*} \frac {(a p+b) \log (p-x)}{p-q}-\frac {(a q+b) \log (q-x)}{p-q} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rubi steps
\begin {align*} \int \frac {b+a x}{(-p+x) (-q+x)} \, dx &=\int \left (\frac {-b-a p}{(p-q) (p-x)}+\frac {b+a q}{(p-q) (q-x)}\right ) \, dx\\ &=\frac {(b+a p) \log (p-x)}{p-q}-\frac {(b+a q) \log (q-x)}{p-q}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 34, normalized size = 0.85 \begin {gather*} \frac {(b+a p) \log (-p+x)-(b+a q) \log (-q+x)}{p-q} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.04, size = 43, normalized size = 1.08
method | result | size |
norman | \(\frac {\left (a p +b \right ) \ln \left (p -x \right )}{p -q}-\frac {\left (a q +b \right ) \ln \left (q -x \right )}{p -q}\) | \(41\) |
default | \(\frac {\left (-a q -b \right ) \ln \left (q -x \right )}{p -q}+\frac {\left (a p +b \right ) \ln \left (p -x \right )}{p -q}\) | \(43\) |
risch | \(-\frac {\ln \left (-q +x \right ) a q}{p -q}-\frac {\ln \left (-q +x \right ) b}{p -q}+\frac {\ln \left (p -x \right ) a p}{p -q}+\frac {\ln \left (p -x \right ) b}{p -q}\) | \(66\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 2.36, size = 40, normalized size = 1.00 \begin {gather*} \frac {{\left (a p + b\right )} \log \left (-p + x\right )}{p - q} - \frac {{\left (a q + b\right )} \log \left (-q + x\right )}{p - q} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.92, size = 34, normalized size = 0.85 \begin {gather*} \frac {{\left (a p + b\right )} \log \left (-p + x\right ) - {\left (a q + b\right )} \log \left (-q + x\right )}{p - q} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 144 vs.
\(2 (26) = 52\).
time = 0.52, size = 144, normalized size = 3.60 \begin {gather*} \frac {\left (a p + b\right ) \log {\left (x + \frac {- 2 a p q - b p - b q - \frac {p^{2} \left (a p + b\right )}{p - q} + \frac {2 p q \left (a p + b\right )}{p - q} - \frac {q^{2} \left (a p + b\right )}{p - q}}{a p + a q + 2 b} \right )}}{p - q} - \frac {\left (a q + b\right ) \log {\left (x + \frac {- 2 a p q - b p - b q + \frac {p^{2} \left (a q + b\right )}{p - q} - \frac {2 p q \left (a q + b\right )}{p - q} + \frac {q^{2} \left (a q + b\right )}{p - q}}{a p + a q + 2 b} \right )}}{p - q} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 42, normalized size = 1.05 \begin {gather*} \frac {{\left (a p + b\right )} \log \left ({\left | -p + x \right |}\right )}{p - q} - \frac {{\left (a q + b\right )} \log \left ({\left | -q + x \right |}\right )}{p - q} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.25, size = 40, normalized size = 1.00 \begin {gather*} \frac {\ln \left (x-p\right )\,\left (b+a\,p\right )}{p-q}-\frac {\ln \left (x-q\right )\,\left (b+a\,q\right )}{p-q} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________