3.945 \(\int \frac{\cos ^2(a+b x)-\sin ^2(a+b x)}{\cos ^2(a+b x)+\sin ^2(a+b x)} \, dx\)

Optimal. Leaf size=16 \[ \frac{\sin (a+b x) \cos (a+b x)}{b} \]

[Out]

(Cos[a + b*x]*Sin[a + b*x])/b

________________________________________________________________________________________

Rubi [A]  time = 0.0541188, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 3, integrand size = 39, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.077, Rules used = {4380, 2635, 8} \[ \frac{\sin (a+b x) \cos (a+b x)}{b} \]

Antiderivative was successfully verified.

[In]

Int[(Cos[a + b*x]^2 - Sin[a + b*x]^2)/(Cos[a + b*x]^2 + Sin[a + b*x]^2),x]

[Out]

(Cos[a + b*x]*Sin[a + b*x])/b

Rule 4380

Int[(u_.)*((a_.) + cos[(d_.) + (e_.)*(x_)]^2*(b_.) + (c_.)*sin[(d_.) + (e_.)*(x_)]^2)^(p_.), x_Symbol] :> Dist
[(a + c)^p, Int[ActivateTrig[u], x], x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[b - c, 0]

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\cos ^2(a+b x)-\sin ^2(a+b x)}{\cos ^2(a+b x)+\sin ^2(a+b x)} \, dx &=\int \left (\cos ^2(a+b x)-\sin ^2(a+b x)\right ) \, dx\\ &=\int \cos ^2(a+b x) \, dx-\int \sin ^2(a+b x) \, dx\\ &=\frac{\cos (a+b x) \sin (a+b x)}{b}\\ \end{align*}

Mathematica [B]  time = 0.0118323, size = 33, normalized size = 2.06 \[ \frac{\sin (2 a) \cos (2 b x)}{2 b}+\frac{\cos (2 a) \sin (2 b x)}{2 b} \]

Antiderivative was successfully verified.

[In]

Integrate[(Cos[a + b*x]^2 - Sin[a + b*x]^2)/(Cos[a + b*x]^2 + Sin[a + b*x]^2),x]

[Out]

(Cos[2*b*x]*Sin[2*a])/(2*b) + (Cos[2*a]*Sin[2*b*x])/(2*b)

________________________________________________________________________________________

Maple [A]  time = 0.04, size = 17, normalized size = 1.1 \begin{align*}{\frac{\cos \left ( bx+a \right ) \sin \left ( bx+a \right ) }{b}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cos(b*x+a)^2-sin(b*x+a)^2)/(cos(b*x+a)^2+sin(b*x+a)^2),x)

[Out]

cos(b*x+a)*sin(b*x+a)/b

________________________________________________________________________________________

Maxima [A]  time = 0.951656, size = 30, normalized size = 1.88 \begin{align*} \frac{\tan \left (b x + a\right )}{{\left (\tan \left (b x + a\right )^{2} + 1\right )} b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(b*x+a)^2-sin(b*x+a)^2)/(cos(b*x+a)^2+sin(b*x+a)^2),x, algorithm="maxima")

[Out]

tan(b*x + a)/((tan(b*x + a)^2 + 1)*b)

________________________________________________________________________________________

Fricas [A]  time = 1.99053, size = 39, normalized size = 2.44 \begin{align*} \frac{\cos \left (b x + a\right ) \sin \left (b x + a\right )}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(b*x+a)^2-sin(b*x+a)^2)/(cos(b*x+a)^2+sin(b*x+a)^2),x, algorithm="fricas")

[Out]

cos(b*x + a)*sin(b*x + a)/b

________________________________________________________________________________________

Sympy [B]  time = 0.283215, size = 32, normalized size = 2. \begin{align*} \frac{\sin{\left (a + b x \right )} \cos{\left (a + b x \right )}}{b \sin ^{2}{\left (a + b x \right )} + b \cos ^{2}{\left (a + b x \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(b*x+a)**2-sin(b*x+a)**2)/(cos(b*x+a)**2+sin(b*x+a)**2),x)

[Out]

sin(a + b*x)*cos(a + b*x)/(b*sin(a + b*x)**2 + b*cos(a + b*x)**2)

________________________________________________________________________________________

Giac [A]  time = 1.08693, size = 19, normalized size = 1.19 \begin{align*} \frac{\sin \left (2 \, b x + 2 \, a\right )}{2 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(b*x+a)^2-sin(b*x+a)^2)/(cos(b*x+a)^2+sin(b*x+a)^2),x, algorithm="giac")

[Out]

1/2*sin(2*b*x + 2*a)/b