Optimal. Leaf size=18 \[ \frac {a^x b^{-x}}{\log (a)-\log (b)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2325, 2225}
\begin {gather*} \frac {a^x b^{-x}}{\log (a)-\log (b)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2225
Rule 2325
Rubi steps
\begin {align*} \int a^x b^{-x} \, dx &=\int e^{x (\log (a)-\log (b))} \, dx\\ &=\frac {a^x b^{-x}}{\log (a)-\log (b)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 18, normalized size = 1.00 \begin {gather*} \frac {a^x b^{-x}}{\log (a)-\log (b)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.02, size = 19, normalized size = 1.06
method | result | size |
gosper | \(\frac {a^{x} b^{-x}}{\ln \left (a \right )-\ln \left (b \right )}\) | \(19\) |
risch | \(\frac {a^{x} b^{-x}}{\ln \left (a \right )-\ln \left (b \right )}\) | \(19\) |
norman | \(\frac {{\mathrm e}^{x \ln \left (a \right )} {\mathrm e}^{-x \ln \left (b \right )}}{\ln \left (a \right )-\ln \left (b \right )}\) | \(23\) |
meijerg | \(-\frac {1-{\mathrm e}^{x \ln \left (a \right ) \left (1-\frac {\ln \left (b \right )}{\ln \left (a \right )}\right )}}{\ln \left (a \right ) \left (1-\frac {\ln \left (b \right )}{\ln \left (a \right )}\right )}\) | \(38\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.78, size = 18, normalized size = 1.00 \begin {gather*} \frac {a^{x}}{b^{x} {\left (\log \left (a\right ) - \log \left (b\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains complex when optimal does not.
time = 0.88, size = 216, normalized size = 12.00 \begin {gather*} 2 \, {\left (\frac {2 \, {\left (\log \left ({\left | a \right |}\right ) - \log \left ({\left | b \right |}\right )\right )} \cos \left (-\frac {1}{2} \, \pi x \mathrm {sgn}\left (a\right ) + \frac {1}{2} \, \pi x \mathrm {sgn}\left (b\right )\right )}{{\left (\pi \mathrm {sgn}\left (a\right ) - \pi \mathrm {sgn}\left (b\right )\right )}^{2} + 4 \, {\left (\log \left ({\left | a \right |}\right ) - \log \left ({\left | b \right |}\right )\right )}^{2}} - \frac {{\left (\pi \mathrm {sgn}\left (a\right ) - \pi \mathrm {sgn}\left (b\right )\right )} \sin \left (-\frac {1}{2} \, \pi x \mathrm {sgn}\left (a\right ) + \frac {1}{2} \, \pi x \mathrm {sgn}\left (b\right )\right )}{{\left (\pi \mathrm {sgn}\left (a\right ) - \pi \mathrm {sgn}\left (b\right )\right )}^{2} + 4 \, {\left (\log \left ({\left | a \right |}\right ) - \log \left ({\left | b \right |}\right )\right )}^{2}}\right )} e^{\left (x {\left (\log \left ({\left | a \right |}\right ) - \log \left ({\left | b \right |}\right )\right )}\right )} + i \, {\left (\frac {i \, e^{\left (\frac {1}{2} i \, \pi x \mathrm {sgn}\left (a\right ) - \frac {1}{2} i \, \pi x \mathrm {sgn}\left (b\right )\right )}}{i \, \pi \mathrm {sgn}\left (a\right ) - i \, \pi \mathrm {sgn}\left (b\right ) + 2 \, \log \left ({\left | a \right |}\right ) - 2 \, \log \left ({\left | b \right |}\right )} - \frac {i \, e^{\left (-\frac {1}{2} i \, \pi x \mathrm {sgn}\left (a\right ) + \frac {1}{2} i \, \pi x \mathrm {sgn}\left (b\right )\right )}}{-i \, \pi \mathrm {sgn}\left (a\right ) + i \, \pi \mathrm {sgn}\left (b\right ) + 2 \, \log \left ({\left | a \right |}\right ) - 2 \, \log \left ({\left | b \right |}\right )}\right )} e^{\left (x {\left (\log \left ({\left | a \right |}\right ) - \log \left ({\left | b \right |}\right )\right )}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.20, size = 18, normalized size = 1.00 \begin {gather*} \frac {a^x}{b^x\,\left (\ln \left (a\right )-\ln \left (b\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________