3.1.51 \(\int \frac {1}{A^4-A^2 B^2+(-A^2+B^2) x^2} \, dx\) [51]

Optimal. Leaf size=21 \[ \frac {\tanh ^{-1}\left (\frac {x}{A}\right )}{A \left (A^2-B^2\right )} \]

[Out]

arctanh(x/A)/A/(A^2-B^2)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.037, Rules used = {214} \begin {gather*} \frac {\tanh ^{-1}\left (\frac {x}{A}\right )}{A \left (A^2-B^2\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(A^4 - A^2*B^2 + (-A^2 + B^2)*x^2)^(-1),x]

[Out]

ArcTanh[x/A]/(A*(A^2 - B^2))

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rubi steps

\begin {align*} \int \frac {1}{A^4-A^2 B^2+\left (-A^2+B^2\right ) x^2} \, dx &=\frac {\tanh ^{-1}\left (\frac {x}{A}\right )}{A \left (A^2-B^2\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 21, normalized size = 1.00 \begin {gather*} \frac {\tanh ^{-1}\left (\frac {x}{A}\right )}{A \left (A^2-B^2\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(A^4 - A^2*B^2 + (-A^2 + B^2)*x^2)^(-1),x]

[Out]

ArcTanh[x/A]/(A*(A^2 - B^2))

________________________________________________________________________________________

Mathics [A]
time = 2.85, size = 30, normalized size = 1.43 \begin {gather*} \frac {\text {Log}\left [A+x\right ]-\text {Log}\left [-A+x\right ]}{2 A \left (A+B\right ) \left (A-B\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[1/((B^2 - A^2)*x^2 - A^2*B^2 + A^4),x]')

[Out]

(Log[A + x] - Log[-A + x]) / (2 A (A + B) (A - B))

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 34, normalized size = 1.62

method result size
default \(\frac {-\frac {\ln \left (A -x \right )}{2 A}+\frac {\ln \left (A +x \right )}{2 A}}{A^{2}-B^{2}}\) \(34\)
norman \(-\frac {\ln \left (A -x \right )}{2 A \left (A^{2}-B^{2}\right )}+\frac {\ln \left (A +x \right )}{2 A \left (A^{2}-B^{2}\right )}\) \(44\)
risch \(-\frac {\ln \left (A -x \right )}{2 A \left (A^{2}-B^{2}\right )}+\frac {\ln \left (A +x \right )}{2 A \left (A^{2}-B^{2}\right )}\) \(44\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(A^4-A^2*B^2+(-A^2+B^2)*x^2),x,method=_RETURNVERBOSE)

[Out]

1/(A^2-B^2)*(-1/2/A*ln(A-x)+1/2/A*ln(A+x))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 39, normalized size = 1.86 \begin {gather*} \frac {\log \left (A + x\right )}{2 \, {\left (A^{3} - A B^{2}\right )}} - \frac {\log \left (-A + x\right )}{2 \, {\left (A^{3} - A B^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(A^4-A^2*B^2+(-A^2+B^2)*x^2),x, algorithm="maxima")

[Out]

1/2*log(A + x)/(A^3 - A*B^2) - 1/2*log(-A + x)/(A^3 - A*B^2)

________________________________________________________________________________________

Fricas [A]
time = 0.32, size = 27, normalized size = 1.29 \begin {gather*} \frac {\log \left (A + x\right ) - \log \left (-A + x\right )}{2 \, {\left (A^{3} - A B^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(A^4-A^2*B^2+(-A^2+B^2)*x^2),x, algorithm="fricas")

[Out]

1/2*(log(A + x) - log(-A + x))/(A^3 - A*B^2)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (12) = 24\)
time = 0.19, size = 70, normalized size = 3.33 \begin {gather*} - \frac {\log {\left (- \frac {A^{3}}{\left (A - B\right ) \left (A + B\right )} + \frac {A B^{2}}{\left (A - B\right ) \left (A + B\right )} + x \right )}}{2 A \left (A - B\right ) \left (A + B\right )} + \frac {\log {\left (\frac {A^{3}}{\left (A - B\right ) \left (A + B\right )} - \frac {A B^{2}}{\left (A - B\right ) \left (A + B\right )} + x \right )}}{2 A \left (A - B\right ) \left (A + B\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(A**4-A**2*B**2+(-A**2+B**2)*x**2),x)

[Out]

-log(-A**3/((A - B)*(A + B)) + A*B**2/((A - B)*(A + B)) + x)/(2*A*(A - B)*(A + B)) + log(A**3/((A - B)*(A + B)
) - A*B**2/((A - B)*(A + B)) + x)/(2*A*(A - B)*(A + B))

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 44, normalized size = 2.10 \begin {gather*} -\frac {\ln \left |x-A\right |}{2 A^{3}-2 A B^{2}}-\frac {\ln \left |x+A\right |}{-2 A^{3}+2 A B^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(A^4-A^2*B^2+(-A^2+B^2)*x^2),x)

[Out]

1/2*log(abs(A + x))/(A^3 - A*B^2) - 1/2*log(abs(-A + x))/(A^3 - A*B^2)

________________________________________________________________________________________

Mupad [B]
time = 0.24, size = 21, normalized size = 1.00 \begin {gather*} -\frac {\mathrm {atanh}\left (\frac {x}{A}\right )}{A\,B^2-A^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-1/(x^2*(A^2 - B^2) - A^4 + A^2*B^2),x)

[Out]

-atanh(x/A)/(A*B^2 - A^3)

________________________________________________________________________________________