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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.41, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {2074, 260, 628} \[ -\frac {2 \log \left (\tan ^2(a+b x)-\tan (a+b x)+1\right )}{3 b}+\frac {\log (\tan (a+b x)+1)}{3 b}-\frac {\log (\cos (a+b x))}{b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

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]

Rule 2074

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Q^q, x], x] /;  !SumQ[N
onfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x] && PolyQ[Q, x] && IntegerQ[p] && NeQ[P, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.20, size = 42, normalized size = 0.76 \[ \frac {\log (\sin (a+b x)+\cos (a+b x))}{3 b}-\frac {2 \log (2-\sin (2 (a+b x)))}{3 b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.90, size = 42, normalized size = 0.76 \[ \frac {\log \left (2 \, \cos \left (b x + a\right ) \sin \left (b x + a\right ) + 1\right ) - 4 \, \log \left (-\cos \left (b x + a\right ) \sin \left (b x + a\right ) + 1\right )}{6 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.29, size = 52, normalized size = 0.95 \[ -\frac {4 \, \log \left (\tan \left (b x + a\right )^{2} - \tan \left (b x + a\right ) + 1\right ) - 3 \, \log \left (\tan \left (b x + a\right )^{2} + 1\right ) - 2 \, \log \left ({\left | \tan \left (b x + a\right ) + 1 \right |}\right )}{6 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/6*(4*log(tan(b*x + a)^2 - tan(b*x + a) + 1) - 3*log(tan(b*x + a)^2 + 1) - 2*log(abs(tan(b*x + a) + 1)))/b

________________________________________________________________________________________

maple [A]  time = 0.65, size = 56, normalized size = 1.02 \[ -\frac {2 \ln \left (1-\tan \left (b x +a \right )+\tan ^{2}\left (b x +a \right )\right )}{3 b}+\frac {\ln \left (1+\tan ^{2}\left (b x +a \right )\right )}{2 b}+\frac {\ln \left (1+\tan \left (b x +a \right )\right )}{3 b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.43, size = 154, normalized size = 2.80 \[ -\frac {2 \, \log \left (-\frac {2 \, \sin \left (b x + a\right )}{\cos \left (b x + a\right ) + 1} + \frac {2 \, \sin \left (b x + a\right )^{2}}{{\left (\cos \left (b x + a\right ) + 1\right )}^{2}} + \frac {2 \, \sin \left (b x + a\right )^{3}}{{\left (\cos \left (b x + a\right ) + 1\right )}^{3}} + \frac {\sin \left (b x + a\right )^{4}}{{\left (\cos \left (b x + a\right ) + 1\right )}^{4}} + 1\right ) - \log \left (-\frac {2 \, \sin \left (b x + a\right )}{\cos \left (b x + a\right ) + 1} + \frac {\sin \left (b x + a\right )^{2}}{{\left (\cos \left (b x + a\right ) + 1\right )}^{2}} - 1\right ) - 3 \, \log \left (\frac {\sin \left (b x + a\right )^{2}}{{\left (\cos \left (b x + a\right ) + 1\right )}^{2}} + 1\right )}{3 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 3.30, size = 105, normalized size = 1.91 \[ \frac {\ln \left ({\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^2+1\right )}{b}+\frac {\ln \left ({\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^2-2\,\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )-1\right )}{3\,b}-\frac {2\,\ln \left ({\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^4+2\,{\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^3+2\,{\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^2-2\,\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )+1\right )}{3\,b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 1.02, size = 76, normalized size = 1.38 \[ \begin {cases} \frac {\log {\left (\sin {\left (a + b x \right )} + \cos {\left (a + b x \right )} \right )}}{3 b} - \frac {2 \log {\left (\sin ^{2}{\left (a + b x \right )} - \sin {\left (a + b x \right )} \cos {\left (a + b x \right )} + \cos ^{2}{\left (a + b x \right )} \right )}}{3 b} & \text {for}\: b \neq 0 \\\frac {x \left (- \sin ^{3}{\relax (a )} + \cos ^{3}{\relax (a )}\right )}{\sin ^{3}{\relax (a )} + \cos ^{3}{\relax (a )}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((log(sin(a + b*x) + cos(a + b*x))/(3*b) - 2*log(sin(a + b*x)**2 - sin(a + b*x)*cos(a + b*x) + cos(a
+ b*x)**2)/(3*b), Ne(b, 0)), (x*(-sin(a)**3 + cos(a)**3)/(sin(a)**3 + cos(a)**3), True))

________________________________________________________________________________________