Optimal. Leaf size=34 \[ \frac {a^x b^{-x}-a^{-x} b^x}{\log (a)-\log (b)}-2 x \]
________________________________________________________________________________________
Rubi [A] time = 0.21, 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 = {2287, 6742, 2194, 8} \[ -\frac {a^{-x} b^x}{\log (a)-\log (b)}+\frac {a^x b^{-x}}{\log (a)-\log (b)}-2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2194
Rule 2287
Rule 6742
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.06, size = 46, normalized size = 1.35 \[ \frac {e^{x (\log (a)-\log (b))}}{\log (a)-\log (b)}+\frac {e^{x (\log (b)-\log (a))}}{\log (b)-\log (a)}-2 x \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int a^{-x} b^{-x} \left (a^x-b^x\right )^2 \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.85, size = 52, normalized size = 1.53 \[ -\frac {2 \, {\left (x \log \relax (a) - x \log \relax (b)\right )} a^{x} b^{x} - a^{2 \, x} + b^{2 \, x}}{a^{x} b^{x} {\left (\log \relax (a) - \log \relax (b)\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [C] time = 0.94, size = 436, normalized size = 12.82 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.05, size = 42, normalized size = 1.24
method | result | size |
risch | \(-2 x +\frac {a^{x} b^{-x}}{\ln \relax (a )-\ln \relax (b )}-\frac {b^{x} a^{-x}}{\ln \relax (a )-\ln \relax (b )}\) | \(42\) |
norman | \(\left (\frac {{\mathrm e}^{2 x \ln \relax (a )}}{\ln \relax (a )-\ln \relax (b )}-\frac {{\mathrm e}^{2 x \ln \relax (b )}}{\ln \relax (a )-\ln \relax (b )}-2 x \,{\mathrm e}^{x \ln \relax (a )} {\mathrm e}^{x \ln \relax (b )}\right ) {\mathrm e}^{-x \ln \relax (a )} {\mathrm e}^{-x \ln \relax (b )}\) | \(65\) |
meijerg | error in int/gbinthm/express: improper op or subscript selector\ | N/A |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.49, size = 34, normalized size = 1.00 \[ \frac {\frac {a^x}{b^x}-\frac {b^x}{a^x}}{\ln \relax (a)-\ln \relax (b)}-2\,x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________