3.10.84 \(\int \frac {1}{1+\sqrt {5}-x^2+\sqrt {5} x^2} \, dx\) [984]

Optimal. Leaf size=24 \[ \frac {1}{2} \tan ^{-1}\left (\sqrt {\frac {1}{2} \left (3-\sqrt {5}\right )} x\right ) \]

[Out]

1/2*arctan(x*(1/2*5^(1/2)-1/2))

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {6, 209} \begin {gather*} \frac {1}{2} \text {ArcTan}\left (\sqrt {\frac {1}{2} \left (3-\sqrt {5}\right )} x\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + Sqrt[5] - x^2 + Sqrt[5]*x^2)^(-1),x]

[Out]

ArcTan[Sqrt[(3 - Sqrt[5])/2]*x]/2

Rule 6

Int[(u_.)*((w_.) + (a_.)*(v_) + (b_.)*(v_))^(p_.), x_Symbol] :> Int[u*((a + b)*v + w)^p, x] /; FreeQ[{a, b}, x
] &&  !FreeQ[v, x]

Rule 209

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

Rubi steps

\begin {align*} \int \frac {1}{1+\sqrt {5}-x^2+\sqrt {5} x^2} \, dx &=\int \frac {1}{1+\sqrt {5}+\left (-1+\sqrt {5}\right ) x^2} \, dx\\ &=\frac {1}{2} \tan ^{-1}\left (\sqrt {\frac {1}{2} \left (3-\sqrt {5}\right )} x\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.02, size = 39, normalized size = 1.62 \begin {gather*} \frac {1}{4} i \log \left (1+\sqrt {5}-2 i x\right )-\frac {1}{4} i \log \left (1+\sqrt {5}+2 i x\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 + Sqrt[5] - x^2 + Sqrt[5]*x^2)^(-1),x]

[Out]

(I/4)*Log[1 + Sqrt[5] - (2*I)*x] - (I/4)*Log[1 + Sqrt[5] + (2*I)*x]

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(31\) vs. \(2(12)=24\).
time = 0.24, size = 32, normalized size = 1.33

method result size
risch \(\frac {\arctan \left (\frac {2 x}{\sqrt {5}+1}\right )}{4}-\frac {\arctan \left (\frac {2 x}{-\sqrt {5}-1}\right )}{4}\) \(30\)
default \(\frac {4 \arctan \left (\frac {4 x}{2 \sqrt {5}+2}\right )}{\left (\sqrt {5}-1\right ) \left (2 \sqrt {5}+2\right )}\) \(32\)
meijerg \(\frac {\arctan \left (\frac {x \sqrt {\sqrt {5}-1}}{\sqrt {\sqrt {5}+1}}\right )}{\sqrt {\sqrt {5}+1}\, \sqrt {\sqrt {5}-1}}\) \(33\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(1-x^2+5^(1/2)+x^2*5^(1/2)),x,method=_RETURNVERBOSE)

[Out]

4/(5^(1/2)-1)/(2*5^(1/2)+2)*arctan(4*x/(2*5^(1/2)+2))

________________________________________________________________________________________

Maxima [A]
time = 0.81, size = 11, normalized size = 0.46 \begin {gather*} \frac {1}{2} \, \arctan \left (\frac {1}{2} \, x {\left (\sqrt {5} - 1\right )}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*arctan(1/2*x*(sqrt(5) - 1))

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 13, normalized size = 0.54 \begin {gather*} \frac {1}{2} \, \arctan \left (\frac {1}{2} \, \sqrt {5} x - \frac {1}{2} \, x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*arctan(1/2*sqrt(5)*x - 1/2*x)

________________________________________________________________________________________

Sympy [A]
time = 0.32, size = 15, normalized size = 0.62 \begin {gather*} - \frac {\operatorname {atan}{\left (x \left (\frac {1}{2} - \frac {\sqrt {5}}{2}\right ) \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1-x**2+5**(1/2)+x**2*5**(1/2)),x)

[Out]

-atan(x*(1/2 - sqrt(5)/2))/2

________________________________________________________________________________________

Giac [A]
time = 2.96, size = 13, normalized size = 0.54 \begin {gather*} \frac {1}{2} \, \arctan \left (\frac {2 \, x}{\sqrt {5} + 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1-x^2+5^(1/2)+x^2*5^(1/2)),x, algorithm="giac")

[Out]

1/2*arctan(2*x/(sqrt(5) + 1))

________________________________________________________________________________________

Mupad [B]
time = 0.10, size = 45, normalized size = 1.88 \begin {gather*} \frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,x\,\left (\sqrt {5}+1\right )}{4\,\left (\frac {\sqrt {5}}{4}+\frac {1}{4}\right )\,\sqrt {\sqrt {5}+3}}\right )\,\left (\sqrt {5}+1\right )}{4\,\sqrt {\sqrt {5}+3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(5^(1/2) + 5^(1/2)*x^2 - x^2 + 1),x)

[Out]

(2^(1/2)*atan((2^(1/2)*x*(5^(1/2) + 1))/(4*(5^(1/2)/4 + 1/4)*(5^(1/2) + 3)^(1/2)))*(5^(1/2) + 1))/(4*(5^(1/2)
+ 3)^(1/2))

________________________________________________________________________________________