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

Optimal. Leaf size=72 \[ \frac{\log \left (\tan ^2(a+b x)+\sqrt{2} \tan (a+b x)+1\right )}{2 \sqrt{2} b}-\frac{\log \left (\tan ^2(a+b x)-\sqrt{2} \tan (a+b x)+1\right )}{2 \sqrt{2} b} \]

[Out]

-Log[1 - Sqrt[2]*Tan[a + b*x] + Tan[a + b*x]^2]/(2*Sqrt[2]*b) + Log[1 + Sqrt[2]*Tan[a + b*x] + Tan[a + b*x]^2]
/(2*Sqrt[2]*b)

________________________________________________________________________________________

Rubi [A]  time = 0.151379, antiderivative size = 72, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 2, integrand size = 39, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.051, Rules used = {1165, 628} \[ \frac{\log \left (\tan ^2(a+b x)+\sqrt{2} \tan (a+b x)+1\right )}{2 \sqrt{2} b}-\frac{\log \left (\tan ^2(a+b x)-\sqrt{2} \tan (a+b x)+1\right )}{2 \sqrt{2} b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-Log[1 - Sqrt[2]*Tan[a + b*x] + Tan[a + b*x]^2]/(2*Sqrt[2]*b) + Log[1 + Sqrt[2]*Tan[a + b*x] + Tan[a + b*x]^2]
/(2*Sqrt[2]*b)

Rule 1165

Int[((d_) + (e_.)*(x_)^2)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[(-2*d)/e, 2]}, Dist[e/(2*c*q), Int[
(q - 2*x)/Simp[d/e + q*x - x^2, x], x], x] + Dist[e/(2*c*q), Int[(q + 2*x)/Simp[d/e - q*x - x^2, x], x], x]] /
; FreeQ[{a, c, d, e}, x] && EqQ[c*d^2 - a*e^2, 0] && NegQ[d*e]

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

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

Mathematica [A]  time = 0.0345226, size = 25, normalized size = 0.35 \[ \frac{\tanh ^{-1}\left (\frac{\sin (2 a+2 b x)}{\sqrt{2}}\right )}{\sqrt{2} b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.088, size = 108, normalized size = 1.5 \begin{align*}{\frac{\sqrt{2}}{8\,b}\ln \left ({\frac{1+\sqrt{2}\tan \left ( bx+a \right ) + \left ( \tan \left ( bx+a \right ) \right ) ^{2}}{1-\sqrt{2}\tan \left ( bx+a \right ) + \left ( \tan \left ( bx+a \right ) \right ) ^{2}}} \right ) }-{\frac{\sqrt{2}}{8\,b}\ln \left ({\frac{1-\sqrt{2}\tan \left ( bx+a \right ) + \left ( \tan \left ( bx+a \right ) \right ) ^{2}}{1+\sqrt{2}\tan \left ( bx+a \right ) + \left ( \tan \left ( bx+a \right ) \right ) ^{2}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.43376, size = 78, normalized size = 1.08 \begin{align*} \frac{\sqrt{2} \log \left (\tan \left (b x + a\right )^{2} + \sqrt{2} \tan \left (b x + a\right ) + 1\right ) - \sqrt{2} \log \left (\tan \left (b x + a\right )^{2} - \sqrt{2} \tan \left (b x + a\right ) + 1\right )}{4 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.12544, size = 193, normalized size = 2.68 \begin{align*} \frac{\sqrt{2} \log \left (-\frac{2 \, \cos \left (b x + a\right )^{4} - 2 \, \sqrt{2} \cos \left (b x + a\right ) \sin \left (b x + a\right ) - 2 \, \cos \left (b x + a\right )^{2} - 1}{2 \, \cos \left (b x + a\right )^{4} - 2 \, \cos \left (b x + a\right )^{2} + 1}\right )}{4 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 28.038, size = 122, normalized size = 1.69 \begin{align*} \begin{cases} - \frac{\sqrt{2} \log{\left (4 \sin ^{2}{\left (a + b x \right )} - 4 \sqrt{2} \sin{\left (a + b x \right )} \cos{\left (a + b x \right )} + 4 \cos ^{2}{\left (a + b x \right )} \right )}}{4 b} + \frac{\sqrt{2} \log{\left (4 \sin ^{2}{\left (a + b x \right )} + 4 \sqrt{2} \sin{\left (a + b x \right )} \cos{\left (a + b x \right )} + 4 \cos ^{2}{\left (a + b x \right )} \right )}}{4 b} & \text{for}\: b \neq 0 \\\frac{x \left (- \sin ^{4}{\left (a \right )} + \cos ^{4}{\left (a \right )}\right )}{\sin ^{4}{\left (a \right )} + \cos ^{4}{\left (a \right )}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((-sqrt(2)*log(4*sin(a + b*x)**2 - 4*sqrt(2)*sin(a + b*x)*cos(a + b*x) + 4*cos(a + b*x)**2)/(4*b) + s
qrt(2)*log(4*sin(a + b*x)**2 + 4*sqrt(2)*sin(a + b*x)*cos(a + b*x) + 4*cos(a + b*x)**2)/(4*b), Ne(b, 0)), (x*(
-sin(a)**4 + cos(a)**4)/(sin(a)**4 + cos(a)**4), True))

________________________________________________________________________________________

Giac [A]  time = 1.2328, size = 65, normalized size = 0.9 \begin{align*} -\frac{\sqrt{2} \log \left (\frac{{\left | -2 \, \sqrt{2} + 2 \, \sin \left (2 \, b x + 2 \, a\right ) \right |}}{{\left | 2 \, \sqrt{2} + 2 \, \sin \left (2 \, b x + 2 \, a\right ) \right |}}\right )}{4 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*sqrt(2)*log(abs(-2*sqrt(2) + 2*sin(2*b*x + 2*a))/abs(2*sqrt(2) + 2*sin(2*b*x + 2*a)))/b