3.915 \(\int \cos ^2(\frac {x}{2}) \tan (\frac {\pi }{4}+\frac {x}{2}) \, dx\)

Optimal. Leaf size=27 \[ \frac {x}{2}-\frac {\cos (x)}{2}-\log \left (\cos \left (\frac {x}{2}+\frac {\pi }{4}\right )\right ) \]

[Out]

1/2*x-1/2*cos(x)-ln(cos(1/4*Pi+1/2*x))

________________________________________________________________________________________

Rubi [F]  time = 0.06, 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 = {} \[ \int \cos ^2\left (\frac {x}{2}\right ) \tan \left (\frac {\pi }{4}+\frac {x}{2}\right ) \, dx \]

Verification is Not applicable to the result.

[In]

Int[Cos[x/2]^2*Tan[Pi/4 + x/2],x]

[Out]

Defer[Int][Cos[x/2]^2*Tan[Pi/4 + x/2], x]

Rubi steps

\begin {align*} \int \cos ^2\left (\frac {x}{2}\right ) \tan \left (\frac {\pi }{4}+\frac {x}{2}\right ) \, dx &=\int \cos ^2\left (\frac {x}{2}\right ) \tan \left (\frac {\pi }{4}+\frac {x}{2}\right ) \, dx\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.17, size = 24, normalized size = 0.89 \[ \frac {1}{2} \left (x-\cos (x)-\log (\cos (x))+2 \tanh ^{-1}\left (\cot \left (\frac {x}{2}\right )\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[x/2]^2*Tan[Pi/4 + x/2],x]

[Out]

(x + 2*ArcTanh[Cot[x/2]] - Cos[x] - Log[Cos[x]])/2

________________________________________________________________________________________

fricas [A]  time = 1.58, size = 27, normalized size = 1.00 \[ -\cos \left (\frac {1}{2} \, x\right )^{2} + \frac {1}{2} \, x - \frac {1}{2} \, \log \left (-2 \, \cos \left (\frac {1}{2} \, x\right ) \sin \left (\frac {1}{2} \, x\right ) + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(1/2*x)^2*tan(1/4*pi+1/2*x),x, algorithm="fricas")

[Out]

-cos(1/2*x)^2 + 1/2*x - 1/2*log(-2*cos(1/2*x)*sin(1/2*x) + 1)

________________________________________________________________________________________

giac [B]  time = 3.12, size = 93, normalized size = 3.44 \[ \frac {x \tan \left (\frac {1}{2} \, x\right )^{2} - \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{2} + \tan \left (\frac {1}{2} \, x\right )^{2} + x - \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) - 1}{2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(1/2*x)^2*tan(1/4*pi+1/2*x),x, algorithm="giac")

[Out]

1/2*(x*tan(1/2*x)^2 - log(2*(tan(1/2*x)^2 - 2*tan(1/2*x) + 1)/(tan(1/2*x)^2 + 1))*tan(1/2*x)^2 + tan(1/2*x)^2
+ x - log(2*(tan(1/2*x)^2 - 2*tan(1/2*x) + 1)/(tan(1/2*x)^2 + 1)) - 1)/(tan(1/2*x)^2 + 1)

________________________________________________________________________________________

maple [A]  time = 0.36, size = 22, normalized size = 0.81 \[ \frac {x}{2}-\frac {\cos \relax (x )}{2}+\frac {\ln \left (\sec \relax (x )+\tan \relax (x )\right )}{2}-\frac {\ln \left (\cos \relax (x )\right )}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(1/2*x)^2*tan(1/4*Pi+1/2*x),x)

[Out]

1/2*x-1/2*cos(x)+1/2*ln(sec(x)+tan(x))-1/2*ln(cos(x))

________________________________________________________________________________________

maxima [B]  time = 0.64, size = 74, normalized size = 2.74 \[ \frac {2 \, x \cos \relax (x)^{2} + 2 \, x \sin \relax (x)^{2} - \cos \left (2 \, x\right ) \cos \relax (x) - 2 \, {\left (\cos \relax (x)^{2} + \sin \relax (x)^{2}\right )} \log \left (\cos \relax (x)^{2} + \sin \relax (x)^{2} - 2 \, \sin \relax (x) + 1\right ) - \sin \left (2 \, x\right ) \sin \relax (x) - \cos \relax (x)}{4 \, {\left (\cos \relax (x)^{2} + \sin \relax (x)^{2}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(1/2*x)^2*tan(1/4*pi+1/2*x),x, algorithm="maxima")

[Out]

1/4*(2*x*cos(x)^2 + 2*x*sin(x)^2 - cos(2*x)*cos(x) - 2*(cos(x)^2 + sin(x)^2)*log(cos(x)^2 + sin(x)^2 - 2*sin(x
) + 1) - sin(2*x)*sin(x) - cos(x))/(cos(x)^2 + sin(x)^2)

________________________________________________________________________________________

mupad [B]  time = 0.48, size = 38, normalized size = 1.41 \[ -2\,\ln \left ({\mathrm {e}}^{\frac {\Pi \,1{}\mathrm {i}}{2}}\,{\mathrm {e}}^{x\,1{}\mathrm {i}}+1\right )\,{\sin \left (\frac {\Pi }{4}\right )}^2+x\,{\mathrm {e}}^{\frac {\Pi \,1{}\mathrm {i}}{4}}\,\sin \left (\frac {\Pi }{4}\right )-\frac {\cos \relax (x)}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x/2)^2*tan(Pi/4 + x/2),x)

[Out]

x*sin(Pi/4)*exp((Pi*1i)/4) - 2*sin(Pi/4)^2*log(exp((Pi*1i)/2)*exp(x*1i) + 1) - cos(x)/2

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cos ^{2}{\left (\frac {x}{2} \right )} \tan {\left (\frac {x}{2} + \frac {\pi }{4} \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(1/2*x)**2*tan(1/4*pi+1/2*x),x)

[Out]

Integral(cos(x/2)**2*tan(x/2 + pi/4), x)

________________________________________________________________________________________