3.3.75 \(\int \log (\sqrt {3}+\tan (x)) \, dx\) [275]

Optimal. Leaf size=108 \[ -\frac {1}{2} i \left (\left (\log \left (\frac {i-\tan (x)}{i+\sqrt {3}}\right )-\log \left (\frac {i+\tan (x)}{i-\sqrt {3}}\right )\right ) \log \left (\sqrt {3}+\tan (x)\right )-\operatorname {PolyLog}\left (2,\frac {\sqrt {3}+\tan (x)}{-i+\sqrt {3}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {3}+\tan (x)}{i+\sqrt {3}}\right )\right ) \]

[Out]

-1/2*I*((ln((I-tan(x))/(3^(1/2)+I))-ln((I+tan(x))/(I-3^(1/2))))*ln(3^(1/2)+tan(x))-polylog(2,(3^(1/2)+tan(x))/
(-I+3^(1/2)))+polylog(2,(3^(1/2)+tan(x))/(3^(1/2)+I)))

________________________________________________________________________________________

Rubi [F]
time = 0.35, antiderivative size = 0, normalized size of antiderivative = 0.00, number of steps used = 0, number of rules used = 0, integrand size = 0, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.000, Rules used = {} \begin {gather*} \int \log \left (\sqrt {3}+\tan (x)\right ) \, dx \end {gather*}

Verification is not applicable to the result.

[In]

Int[Log[Sqrt[3] + Tan[x]],x]

[Out]

x*Log[Sqrt[3] + Tan[x]] - Defer[Int][(x*Sec[x]^2)/(Sqrt[3] + Tan[x]), x]

Rubi steps

\begin {gather*} \begin {aligned} \text {Integral} &=x \log \left (\sqrt {3}+\tan (x)\right )-\int \frac {x \sec ^2(x)}{\sqrt {3}+\tan (x)} \, dx\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 132, normalized size = 1.22 \begin {gather*} -\frac {1}{2} i \log \left (\frac {i-\tan (x)}{i+\sqrt {3}}\right ) \log \left (\sqrt {3}+\tan (x)\right )+\frac {1}{2} i \log \left (\frac {i+\tan (x)}{i-\sqrt {3}}\right ) \log \left (\sqrt {3}+\tan (x)\right )+\frac {1}{2} i \operatorname {PolyLog}\left (2,-\frac {\sqrt {3}+\tan (x)}{i-\sqrt {3}}\right )-\frac {1}{2} i \operatorname {PolyLog}\left (2,\frac {\sqrt {3}+\tan (x)}{i+\sqrt {3}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Log[Sqrt[3] + Tan[x]],x]

[Out]

(-1/2*I)*Log[(I - Tan[x])/(I + Sqrt[3])]*Log[Sqrt[3] + Tan[x]] + (I/2)*Log[(I + Tan[x])/(I - Sqrt[3])]*Log[Sqr
t[3] + Tan[x]] + (I/2)*PolyLog[2, -((Sqrt[3] + Tan[x])/(I - Sqrt[3]))] - (I/2)*PolyLog[2, (Sqrt[3] + Tan[x])/(
I + Sqrt[3])]

________________________________________________________________________________________

Maple [A]
time = 0.43, size = 96, normalized size = 0.89

method result size
derivativedivides \(-\frac {i \ln \left (\sqrt {3}+\tan \left (x \right )\right ) \ln \left (\frac {i-\tan \left (x \right )}{\sqrt {3}+i}\right )}{2}+\frac {i \ln \left (\sqrt {3}+\tan \left (x \right )\right ) \ln \left (\frac {i+\tan \left (x \right )}{i-\sqrt {3}}\right )}{2}-\frac {i \mathit {dilog}\left (\frac {i-\tan \left (x \right )}{\sqrt {3}+i}\right )}{2}+\frac {i \mathit {dilog}\left (\frac {i+\tan \left (x \right )}{i-\sqrt {3}}\right )}{2}\) \(96\)
default \(-\frac {i \ln \left (\sqrt {3}+\tan \left (x \right )\right ) \ln \left (\frac {i-\tan \left (x \right )}{\sqrt {3}+i}\right )}{2}+\frac {i \ln \left (\sqrt {3}+\tan \left (x \right )\right ) \ln \left (\frac {i+\tan \left (x \right )}{i-\sqrt {3}}\right )}{2}-\frac {i \mathit {dilog}\left (\frac {i-\tan \left (x \right )}{\sqrt {3}+i}\right )}{2}+\frac {i \mathit {dilog}\left (\frac {i+\tan \left (x \right )}{i-\sqrt {3}}\right )}{2}\) \(96\)
risch \(-i \ln \left ({\mathrm e}^{i x}\right ) \ln \left (1-i {\mathrm e}^{i x}\right )+i \mathit {dilog}\left (\frac {-i \sqrt {3}+2 \,{\mathrm e}^{i x}+1}{1-i \sqrt {3}}\right )+i \ln \left ({\mathrm e}^{i x}\right ) \ln \left ({\mathrm e}^{2 i x}+1\right )+\frac {i \pi \,\mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i x}+1}\right ) {\mathrm {csgn}\left (\frac {i \left (-i {\mathrm e}^{2 i x}+\sqrt {3}\, {\mathrm e}^{2 i x}+i+\sqrt {3}\right )}{{\mathrm e}^{2 i x}+1}\right )}^{2} x}{2}-\ln \left (\frac {-2 \,{\mathrm e}^{i x}-i \sqrt {3}+1}{1-i \sqrt {3}}\right ) x -x \ln \left (\frac {-i \sqrt {3}+2 \,{\mathrm e}^{i x}+1}{1-i \sqrt {3}}\right )-i \mathit {dilog}\left (1+i {\mathrm e}^{i x}\right )-\frac {i \pi {\mathrm {csgn}\left (\frac {i \left (-i {\mathrm e}^{2 i x}+\sqrt {3}\, {\mathrm e}^{2 i x}+i+\sqrt {3}\right )}{{\mathrm e}^{2 i x}+1}\right )}^{3} x}{2}-i \mathit {dilog}\left (\frac {2 \,{\mathrm e}^{i x}}{1-i \sqrt {3}}\right )-i \ln \left ({\mathrm e}^{i x}\right ) \ln \left (1+i {\mathrm e}^{i x}\right )+x \ln \left (-i {\mathrm e}^{2 i x}+\sqrt {3}\, {\mathrm e}^{2 i x}+i+\sqrt {3}\right )-\frac {i \pi \,\mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i x}+1}\right ) \mathrm {csgn}\left (i \left (-i {\mathrm e}^{2 i x}+\sqrt {3}\, {\mathrm e}^{2 i x}+i+\sqrt {3}\right )\right ) \mathrm {csgn}\left (\frac {i \left (-i {\mathrm e}^{2 i x}+\sqrt {3}\, {\mathrm e}^{2 i x}+i+\sqrt {3}\right )}{{\mathrm e}^{2 i x}+1}\right ) x}{2}-i \mathit {dilog}\left (1-i {\mathrm e}^{i x}\right )+\frac {i \pi \,\mathrm {csgn}\left (i \left (-i {\mathrm e}^{2 i x}+\sqrt {3}\, {\mathrm e}^{2 i x}+i+\sqrt {3}\right )\right ) {\mathrm {csgn}\left (\frac {i \left (-i {\mathrm e}^{2 i x}+\sqrt {3}\, {\mathrm e}^{2 i x}+i+\sqrt {3}\right )}{{\mathrm e}^{2 i x}+1}\right )}^{2} x}{2}-i \ln \left (\frac {-2 \,{\mathrm e}^{i x}-i \sqrt {3}+1}{1-i \sqrt {3}}\right ) \ln \left (\frac {2 \,{\mathrm e}^{i x}}{1-i \sqrt {3}}\right )\) \(522\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(3^(1/2)+tan(x)),x,method=_RETURNVERBOSE)

[Out]

-1/2*I*ln(3^(1/2)+tan(x))*ln((I-tan(x))/(3^(1/2)+I))+1/2*I*ln(3^(1/2)+tan(x))*ln((I+tan(x))/(I-3^(1/2)))-1/2*I
*dilog((I-tan(x))/(3^(1/2)+I))+1/2*I*dilog((I+tan(x))/(I-3^(1/2)))

________________________________________________________________________________________

Maxima [A]
time = 0.58, size = 115, normalized size = 1.06 \begin {gather*} \frac {1}{2} \, \arctan \left (\frac {1}{4} \, \sqrt {3} + \frac {1}{4} \, \tan \left (x\right ), \frac {1}{4} \, \sqrt {3} \tan \left (x\right ) + \frac {3}{4}\right ) \log \left (\tan \left (x\right )^{2} + 1\right ) - \frac {1}{2} \, x \log \left (\frac {1}{4} \, \tan \left (x\right )^{2} + \frac {1}{2} \, \sqrt {3} \tan \left (x\right ) + \frac {3}{4}\right ) + x \log \left (\sqrt {3} + \tan \left (x\right )\right ) + \frac {1}{2} i \, {\rm Li}_2\left (-\frac {{\left (\sqrt {3} + i\right )} \tan \left (x\right ) - i \, \sqrt {3} + 1}{2 i \, \sqrt {3} + 2}\right ) - \frac {1}{2} i \, {\rm Li}_2\left (\frac {{\left (\sqrt {3} - i\right )} \tan \left (x\right ) + i \, \sqrt {3} + 1}{2 i \, \sqrt {3} - 2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(3^(1/2)+tan(x)),x, algorithm="maxima")

[Out]

1/2*arctan2(1/4*sqrt(3) + 1/4*tan(x), 1/4*sqrt(3)*tan(x) + 3/4)*log(tan(x)^2 + 1) - 1/2*x*log(1/4*tan(x)^2 + 1
/2*sqrt(3)*tan(x) + 3/4) + x*log(sqrt(3) + tan(x)) + 1/2*I*dilog(-((sqrt(3) + I)*tan(x) - I*sqrt(3) + 1)/(2*I*
sqrt(3) + 2)) - 1/2*I*dilog(((sqrt(3) - I)*tan(x) + I*sqrt(3) + 1)/(2*I*sqrt(3) - 2))

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 262 vs. \(2 (75) = 150\).
time = 0.72, size = 262, normalized size = 2.43 \begin {gather*} x \log \left (\sqrt {3} + \tan \left (x\right )\right ) - \frac {1}{2} \, x \log \left (\frac {{\left (i \, \sqrt {3} + 1\right )} \tan \left (x\right )^{2} + 2 \, {\left (\sqrt {3} + i\right )} \tan \left (x\right ) - i \, \sqrt {3} + 3}{2 \, {\left (\tan \left (x\right )^{2} + 1\right )}}\right ) - \frac {1}{2} \, x \log \left (\frac {{\left (-i \, \sqrt {3} + 1\right )} \tan \left (x\right )^{2} + 2 \, {\left (\sqrt {3} - i\right )} \tan \left (x\right ) + i \, \sqrt {3} + 3}{2 \, {\left (\tan \left (x\right )^{2} + 1\right )}}\right ) + \frac {1}{2} \, x \log \left (-\frac {2 \, {\left (i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1}\right ) + \frac {1}{2} \, x \log \left (-\frac {2 \, {\left (-i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1}\right ) + \frac {1}{4} i \, {\rm Li}_2\left (-\frac {{\left (i \, \sqrt {3} + 1\right )} \tan \left (x\right )^{2} + 2 \, {\left (\sqrt {3} + i\right )} \tan \left (x\right ) - i \, \sqrt {3} + 3}{2 \, {\left (\tan \left (x\right )^{2} + 1\right )}} + 1\right ) - \frac {1}{4} i \, {\rm Li}_2\left (-\frac {{\left (-i \, \sqrt {3} + 1\right )} \tan \left (x\right )^{2} + 2 \, {\left (\sqrt {3} - i\right )} \tan \left (x\right ) + i \, \sqrt {3} + 3}{2 \, {\left (\tan \left (x\right )^{2} + 1\right )}} + 1\right ) + \frac {1}{4} i \, {\rm Li}_2\left (\frac {2 \, {\left (i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1} + 1\right ) - \frac {1}{4} i \, {\rm Li}_2\left (\frac {2 \, {\left (-i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(3^(1/2)+tan(x)),x, algorithm="fricas")

[Out]

x*log(sqrt(3) + tan(x)) - 1/2*x*log(1/2*((I*sqrt(3) + 1)*tan(x)^2 + 2*(sqrt(3) + I)*tan(x) - I*sqrt(3) + 3)/(t
an(x)^2 + 1)) - 1/2*x*log(1/2*((-I*sqrt(3) + 1)*tan(x)^2 + 2*(sqrt(3) - I)*tan(x) + I*sqrt(3) + 3)/(tan(x)^2 +
 1)) + 1/2*x*log(-2*(I*tan(x) - 1)/(tan(x)^2 + 1)) + 1/2*x*log(-2*(-I*tan(x) - 1)/(tan(x)^2 + 1)) + 1/4*I*dilo
g(-1/2*((I*sqrt(3) + 1)*tan(x)^2 + 2*(sqrt(3) + I)*tan(x) - I*sqrt(3) + 3)/(tan(x)^2 + 1) + 1) - 1/4*I*dilog(-
1/2*((-I*sqrt(3) + 1)*tan(x)^2 + 2*(sqrt(3) - I)*tan(x) + I*sqrt(3) + 3)/(tan(x)^2 + 1) + 1) + 1/4*I*dilog(2*(
I*tan(x) - 1)/(tan(x)^2 + 1) + 1) - 1/4*I*dilog(2*(-I*tan(x) - 1)/(tan(x)^2 + 1) + 1)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \log {\left (\tan {\left (x \right )} + \sqrt {3} \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(3**(1/2)+tan(x)),x)

[Out]

Integral(log(tan(x) + sqrt(3)), x)

________________________________________________________________________________________

Giac [F]
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]

integrate(log(3^(1/2)+tan(x)),x, algorithm="giac")

[Out]

integrate(log(sqrt(3) + tan(x)), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \ln \left (\mathrm {tan}\left (x\right )+\sqrt {3}\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(log(tan(x) + 3^(1/2)),x)

[Out]

int(log(tan(x) + 3^(1/2)), x)

________________________________________________________________________________________

Chatgpt [F] Failed to verify
time = 1.00, size = 40, normalized size = 0.37 \begin {gather*} x \ln \left (\sqrt {3}+\tan \left (x \right )\right )-\frac {\left (1+\sqrt {3}\right ) \ln \left (\sqrt {3}+\tan \left (x \right )-1\right )}{2}+\frac {\left (\sqrt {3}-1\right ) \ln \left (\sqrt {3}+\tan \left (x \right )+1\right )}{2} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

int(ln(3^(1/2)+tan(x)),x)

[Out]

x*ln(3^(1/2)+tan(x))-1/2*(1+3^(1/2))*ln(3^(1/2)+tan(x)-1)+1/2*(3^(1/2)-1)*ln(3^(1/2)+tan(x)+1)

________________________________________________________________________________________