3.100 \(\int \frac {\tan ^2(c+d x)}{(a+a \sec (c+d x))^3} \, dx\)

Optimal. Leaf size=60 \[ -\frac {x}{a^3}+\frac {2 \tan (c+d x)}{a^2 d (a \sec (c+d x)+a)}-\frac {\tan ^3(c+d x)}{3 d (a \sec (c+d x)+a)^3} \]

[Out]

-x/a^3+2*tan(d*x+c)/a^2/d/(a+a*sec(d*x+c))-1/3*tan(d*x+c)^3/d/(a+a*sec(d*x+c))^3

________________________________________________________________________________________

Rubi [A]  time = 0.17, antiderivative size = 71, normalized size of antiderivative = 1.18, number of steps used = 12, number of rules used = 7, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3888, 3886, 3473, 8, 2606, 2607, 30} \[ \frac {4 \cot ^3(c+d x)}{3 a^3 d}-\frac {\cot (c+d x)}{a^3 d}-\frac {4 \csc ^3(c+d x)}{3 a^3 d}+\frac {3 \csc (c+d x)}{a^3 d}-\frac {x}{a^3} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^2/(a + a*Sec[c + d*x])^3,x]

[Out]

-(x/a^3) - Cot[c + d*x]/(a^3*d) + (4*Cot[c + d*x]^3)/(3*a^3*d) + (3*Csc[c + d*x])/(a^3*d) - (4*Csc[c + d*x]^3)
/(3*a^3*d)

Rule 8

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

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2606

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2607

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3886

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Int[ExpandI
ntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]

Rule 3888

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[a^(2*n
)/e^(2*n), Int[(e*Cot[c + d*x])^(m + 2*n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && E
qQ[a^2 - b^2, 0] && ILtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {\tan ^2(c+d x)}{(a+a \sec (c+d x))^3} \, dx &=\frac {\int \cot ^4(c+d x) (-a+a \sec (c+d x))^3 \, dx}{a^6}\\ &=\frac {\int \left (-a^3 \cot ^4(c+d x)+3 a^3 \cot ^3(c+d x) \csc (c+d x)-3 a^3 \cot ^2(c+d x) \csc ^2(c+d x)+a^3 \cot (c+d x) \csc ^3(c+d x)\right ) \, dx}{a^6}\\ &=-\frac {\int \cot ^4(c+d x) \, dx}{a^3}+\frac {\int \cot (c+d x) \csc ^3(c+d x) \, dx}{a^3}+\frac {3 \int \cot ^3(c+d x) \csc (c+d x) \, dx}{a^3}-\frac {3 \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx}{a^3}\\ &=\frac {\cot ^3(c+d x)}{3 a^3 d}+\frac {\int \cot ^2(c+d x) \, dx}{a^3}-\frac {\operatorname {Subst}\left (\int x^2 \, dx,x,\csc (c+d x)\right )}{a^3 d}-\frac {3 \operatorname {Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{a^3 d}-\frac {3 \operatorname {Subst}\left (\int \left (-1+x^2\right ) \, dx,x,\csc (c+d x)\right )}{a^3 d}\\ &=-\frac {\cot (c+d x)}{a^3 d}+\frac {4 \cot ^3(c+d x)}{3 a^3 d}+\frac {3 \csc (c+d x)}{a^3 d}-\frac {4 \csc ^3(c+d x)}{3 a^3 d}-\frac {\int 1 \, dx}{a^3}\\ &=-\frac {x}{a^3}-\frac {\cot (c+d x)}{a^3 d}+\frac {4 \cot ^3(c+d x)}{3 a^3 d}+\frac {3 \csc (c+d x)}{a^3 d}-\frac {4 \csc ^3(c+d x)}{3 a^3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.40, size = 125, normalized size = 2.08 \[ -\frac {\sec \left (\frac {c}{2}\right ) \sec ^3\left (\frac {1}{2} (c+d x)\right ) \left (351 \sin \left (c+\frac {d x}{2}\right )-277 \sin \left (c+\frac {3 d x}{2}\right )-3 \sin \left (2 c+\frac {3 d x}{2}\right )+180 d x \cos \left (c+\frac {d x}{2}\right )+60 d x \cos \left (c+\frac {3 d x}{2}\right )+60 d x \cos \left (2 c+\frac {3 d x}{2}\right )-471 \sin \left (\frac {d x}{2}\right )+180 d x \cos \left (\frac {d x}{2}\right )\right )}{480 a^3 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^2/(a + a*Sec[c + d*x])^3,x]

[Out]

-1/480*(Sec[c/2]*Sec[(c + d*x)/2]^3*(180*d*x*Cos[(d*x)/2] + 180*d*x*Cos[c + (d*x)/2] + 60*d*x*Cos[c + (3*d*x)/
2] + 60*d*x*Cos[2*c + (3*d*x)/2] - 471*Sin[(d*x)/2] + 351*Sin[c + (d*x)/2] - 277*Sin[c + (3*d*x)/2] - 3*Sin[2*
c + (3*d*x)/2]))/(a^3*d)

________________________________________________________________________________________

fricas [A]  time = 0.60, size = 80, normalized size = 1.33 \[ -\frac {3 \, d x \cos \left (d x + c\right )^{2} + 6 \, d x \cos \left (d x + c\right ) + 3 \, d x - {\left (7 \, \cos \left (d x + c\right ) + 5\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{3} d \cos \left (d x + c\right )^{2} + 2 \, a^{3} d \cos \left (d x + c\right ) + a^{3} d\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+a*sec(d*x+c))^3,x, algorithm="fricas")

[Out]

-1/3*(3*d*x*cos(d*x + c)^2 + 6*d*x*cos(d*x + c) + 3*d*x - (7*cos(d*x + c) + 5)*sin(d*x + c))/(a^3*d*cos(d*x +
c)^2 + 2*a^3*d*cos(d*x + c) + a^3*d)

________________________________________________________________________________________

giac [A]  time = 0.79, size = 50, normalized size = 0.83 \[ -\frac {\frac {3 \, {\left (d x + c\right )}}{a^{3}} + \frac {a^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{9}}}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+a*sec(d*x+c))^3,x, algorithm="giac")

[Out]

-1/3*(3*(d*x + c)/a^3 + (a^6*tan(1/2*d*x + 1/2*c)^3 - 6*a^6*tan(1/2*d*x + 1/2*c))/a^9)/d

________________________________________________________________________________________

maple [A]  time = 0.58, size = 56, normalized size = 0.93 \[ -\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{3 d \,a^{3}}+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \,a^{3}}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^2/(a+a*sec(d*x+c))^3,x)

[Out]

-1/3/d/a^3*tan(1/2*d*x+1/2*c)^3+2/d/a^3*tan(1/2*d*x+1/2*c)-2/d/a^3*arctan(tan(1/2*d*x+1/2*c))

________________________________________________________________________________________

maxima [A]  time = 0.45, size = 72, normalized size = 1.20 \[ \frac {\frac {\frac {6 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{3}} - \frac {6 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{3}}}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+a*sec(d*x+c))^3,x, algorithm="maxima")

[Out]

1/3*((6*sin(d*x + c)/(cos(d*x + c) + 1) - sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/a^3 - 6*arctan(sin(d*x + c)/(co
s(d*x + c) + 1))/a^3)/d

________________________________________________________________________________________

mupad [B]  time = 1.16, size = 35, normalized size = 0.58 \[ -\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+3\,d\,x}{3\,a^3\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^2/(a + a/cos(c + d*x))^3,x)

[Out]

-(tan(c/2 + (d*x)/2)^3 - 6*tan(c/2 + (d*x)/2) + 3*d*x)/(3*a^3*d)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\tan ^{2}{\left (c + d x \right )}}{\sec ^{3}{\left (c + d x \right )} + 3 \sec ^{2}{\left (c + d x \right )} + 3 \sec {\left (c + d x \right )} + 1}\, dx}{a^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**2/(a+a*sec(d*x+c))**3,x)

[Out]

Integral(tan(c + d*x)**2/(sec(c + d*x)**3 + 3*sec(c + d*x)**2 + 3*sec(c + d*x) + 1), x)/a**3

________________________________________________________________________________________