Optimal. Leaf size=34 \[ -2 x+\frac {a^x b^{-x}-a^{-x} b^x}{\log (a)-\log (b)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 41, normalized size of antiderivative = 1.21, number of steps
used = 9, number of rules used = 4, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {2325, 6874,
2225, 8} \begin {gather*} -\frac {a^{-x} b^x}{\log (a)-\log (b)}+\frac {a^x b^{-x}}{\log (a)-\log (b)}-2 x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2225
Rule 2325
Rule 6874
Rubi steps
\begin {align*} \int a^{-x} b^{-x} \left (a^x-b^x\right )^2 \, dx &=\int \left (a^x-b^x\right )^2 e^{-x (\log (a)+\log (b))} \, dx\\ &=\int \left (a^{2 x} e^{-x (\log (a)+\log (b))}-2 a^x b^x e^{-x (\log (a)+\log (b))}+b^{2 x} e^{-x (\log (a)+\log (b))}\right ) \, dx\\ &=-\left (2 \int a^x b^x e^{-x (\log (a)+\log (b))} \, dx\right )+\int a^{2 x} e^{-x (\log (a)+\log (b))} \, dx+\int b^{2 x} e^{-x (\log (a)+\log (b))} \, dx\\ &=-(2 \int 1 \, dx)+\int e^{-x (\log (a)-\log (b))} \, dx+\int e^{x (\log (a)-\log (b))} \, dx\\ &=-2 x+\frac {a^x b^{-x}}{\log (a)-\log (b)}-\frac {a^{-x} b^x}{\log (a)-\log (b)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 46, normalized size = 1.35 \begin {gather*} -2 x+\frac {e^{x (\log (a)-\log (b))}}{\log (a)-\log (b)}+\frac {e^{x (-\log (a)+\log (b))}}{-\log (a)+\log (b)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Mathics [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {cought exception: Invalid NaN comparison} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.04, size = 42, normalized size = 1.24
method | result | size |
risch | \(-2 x +\frac {a^{x} b^{-x}}{\ln \left (a \right )-\ln \left (b \right )}-\frac {b^{x} a^{-x}}{\ln \left (a \right )-\ln \left (b \right )}\) | \(42\) |
norman | \(\left (\frac {{\mathrm e}^{2 x \ln \left (a \right )}}{\ln \left (a \right )-\ln \left (b \right )}-\frac {{\mathrm e}^{2 x \ln \left (b \right )}}{\ln \left (a \right )-\ln \left (b \right )}-2 x \,{\mathrm e}^{x \ln \left (a \right )} {\mathrm e}^{x \ln \left (b \right )}\right ) {\mathrm e}^{-x \ln \left (a \right )} {\mathrm e}^{-x \ln \left (b \right )}\) | \(65\) |
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.31, size = 52, normalized size = 1.53 \begin {gather*} -\frac {2 \, {\left (x \log \left (a\right ) - x \log \left (b\right )\right )} a^{x} b^{x} - a^{2 \, x} + b^{2 \, x}}{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 [F] N/A
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.49, size = 34, normalized size = 1.00 \begin {gather*} \frac {\frac {a^x}{b^x}-\frac {b^x}{a^x}}{\ln \left (a\right )-\ln \left (b\right )}-2\,x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________