3.526 \(\int \frac{\cos (x)-i \sin (x)}{\cos (x)+i \sin (x)} \, dx\)

Optimal. Leaf size=17 \[ \frac{1}{2} i (\cos (x)-i \sin (x))^2 \]

[Out]

(I/2)*(Cos[x] - I*Sin[x])^2

________________________________________________________________________________________

Rubi [A]  time = 0.0400325, antiderivative size = 17, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.048, Rules used = {4385} \[ \frac{1}{2} i (\cos (x)-i \sin (x))^2 \]

Antiderivative was successfully verified.

[In]

Int[(Cos[x] - I*Sin[x])/(Cos[x] + I*Sin[x]),x]

[Out]

(I/2)*(Cos[x] - I*Sin[x])^2

Rule 4385

Int[(u_)*(y_)^(m_.), x_Symbol] :> With[{q = DerivativeDivides[ActivateTrig[y], ActivateTrig[u], x]}, Simp[(q*A
ctivateTrig[y^(m + 1)])/(m + 1), x] /;  !FalseQ[q]] /; FreeQ[m, x] && NeQ[m, -1] &&  !InertTrigFreeQ[u]

Rubi steps

\begin{align*} \int \frac{\cos (x)-i \sin (x)}{\cos (x)+i \sin (x)} \, dx &=\frac{1}{2} i (\cos (x)-i \sin (x))^2\\ \end{align*}

Mathematica [A]  time = 0.0054046, size = 19, normalized size = 1.12 \[ \frac{1}{2} \sin (2 x)+\frac{1}{2} i \cos (2 x) \]

Antiderivative was successfully verified.

[In]

Integrate[(Cos[x] - I*Sin[x])/(Cos[x] + I*Sin[x]),x]

[Out]

(I/2)*Cos[2*x] + Sin[2*x]/2

________________________________________________________________________________________

Maple [A]  time = 0.065, size = 8, normalized size = 0.5 \begin{align*} \left ( \tan \left ( x \right ) -i \right ) ^{-1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cos(x)-I*sin(x))/(cos(x)+I*sin(x)),x)

[Out]

1/(tan(x)-I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)-I*sin(x))/(cos(x)+I*sin(x)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.78768, size = 24, normalized size = 1.41 \begin{align*} \frac{1}{2} i \, e^{\left (-2 i \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)-I*sin(x))/(cos(x)+I*sin(x)),x, algorithm="fricas")

[Out]

1/2*I*e^(-2*I*x)

________________________________________________________________________________________

Sympy [A]  time = 0.128324, size = 8, normalized size = 0.47 \begin{align*} \frac{i e^{- 2 i x}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)-I*sin(x))/(cos(x)+I*sin(x)),x)

[Out]

I*exp(-2*I*x)/2

________________________________________________________________________________________

Giac [A]  time = 1.13732, size = 19, normalized size = 1.12 \begin{align*} -\frac{2 \, \tan \left (\frac{1}{2} \, x\right )}{{\left (\tan \left (\frac{1}{2} \, x\right ) - i\right )}^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)-I*sin(x))/(cos(x)+I*sin(x)),x, algorithm="giac")

[Out]

-2*tan(1/2*x)/(tan(1/2*x) - I)^2