3.948 \(\int \frac{-\csc ^2(a+b x)+\sec ^2(a+b x)}{\csc ^2(a+b x)+\sec ^2(a+b x)} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.174518, antiderivative size = 17, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 39, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.026, Rules used = {383} \[ -\frac{\sin (a+b x) \cos (a+b x)}{b} \]

Antiderivative was successfully verified.

[In]

Int[(-Csc[a + b*x]^2 + Sec[a + b*x]^2)/(Csc[a + b*x]^2 + Sec[a + b*x]^2),x]

[Out]

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

Rule 383

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(c*x*(a + b*x^n)^(p + 1))/a, x]
 /; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[a*d - b*c*(n*(p + 1) + 1), 0]

Rubi steps

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

Mathematica [A]  time = 0.0143717, size = 33, normalized size = 1.94 \[ -\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[(-Csc[a + b*x]^2 + Sec[a + b*x]^2)/(Csc[a + b*x]^2 + Sec[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.084, size = 18, 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((-csc(b*x+a)^2+sec(b*x+a)^2)/(csc(b*x+a)^2+sec(b*x+a)^2),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.945537, size = 31, normalized size = 1.82 \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((-csc(b*x+a)^2+sec(b*x+a)^2)/(csc(b*x+a)^2+sec(b*x+a)^2),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.02152, size = 41, normalized size = 2.41 \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((-csc(b*x+a)^2+sec(b*x+a)^2)/(csc(b*x+a)^2+sec(b*x+a)^2),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} - \int \frac{\csc ^{2}{\left (a + b x \right )}}{\csc ^{2}{\left (a + b x \right )} + \sec ^{2}{\left (a + b x \right )}}\, dx - \int - \frac{\sec ^{2}{\left (a + b x \right )}}{\csc ^{2}{\left (a + b x \right )} + \sec ^{2}{\left (a + b x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-csc(b*x+a)**2+sec(b*x+a)**2)/(csc(b*x+a)**2+sec(b*x+a)**2),x)

[Out]

-Integral(csc(a + b*x)**2/(csc(a + b*x)**2 + sec(a + b*x)**2), x) - Integral(-sec(a + b*x)**2/(csc(a + b*x)**2
 + sec(a + b*x)**2), x)

________________________________________________________________________________________

Giac [A]  time = 1.13875, size = 19, normalized size = 1.12 \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((-csc(b*x+a)^2+sec(b*x+a)^2)/(csc(b*x+a)^2+sec(b*x+a)^2),x, algorithm="giac")

[Out]

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