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]

x/2 - Cos[x]/2 - Log[Cos[Pi/4 + x/2]]

________________________________________________________________________________________

Rubi [F]  time = 0.0625198, antiderivative size = 0, normalized size of antiderivative = 0., number of steps used = 0, number of rules used = 0, integrand size = 0, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0., 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.166814, 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

________________________________________________________________________________________

Maple [A]  time = 0.14, size = 22, normalized size = 0.8 \begin{align*}{\frac{x}{2}}-{\frac{\cos \left ( x \right ) }{2}}+{\frac{\ln \left ( \sec \left ( x \right ) +\tan \left ( x \right ) \right ) }{2}}-{\frac{\ln \left ( \cos \left ( x \right ) \right ) }{2}} \end{align*}

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 = 1.44345, size = 100, normalized size = 3.7 \begin{align*} \frac{2 \, x \cos \left (x\right )^{2} + 2 \, x \sin \left (x\right )^{2} - \cos \left (2 \, x\right ) \cos \left (x\right ) - 2 \,{\left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2}\right )} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \sin \left (x\right ) + 1\right ) - \sin \left (2 \, x\right ) \sin \left (x\right ) - \cos \left (x\right )}{4 \,{\left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2}\right )}} \end{align*}

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)

________________________________________________________________________________________

Fricas [A]  time = 2.06683, size = 85, normalized size = 3.15 \begin{align*} -\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 ) \end{align*}

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)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \cos ^{2}{\left (\frac{x}{2} \right )} \tan{\left (\frac{x}{2} + \frac{\pi }{4} \right )}\, dx \end{align*}

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)

________________________________________________________________________________________

Giac [B]  time = 1.1435, size = 126, normalized size = 4.67 \begin{align*} \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 )}} \end{align*}

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)