\(\int \sec ^3(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx\) [855]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 96 \[ \int \sec ^3(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {a \text {arctanh}(\sin (c+d x))}{8 d}+\frac {a^5}{8 d \left (a^2-a^2 \sin (c+d x)\right )^2}-\frac {a^5}{4 d \left (a^4-a^4 \sin (c+d x)\right )}-\frac {a^5}{8 d \left (a^4+a^4 \sin (c+d x)\right )} \] Output:

-1/8*a*arctanh(sin(d*x+c))/d+1/8*a^5/d/(a^2-a^2*sin(d*x+c))^2-1/4*a^5/d/(a 
^4-a^4*sin(d*x+c))-1/8*a^5/d/(a^4+a^4*sin(d*x+c))
 

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.77 \[ \int \sec ^3(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {a \text {arctanh}(\sin (c+d x))}{8 d}-\frac {a \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {a \tan ^4(c+d x)}{4 d} \] Input:

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

Output:

-1/8*(a*ArcTanh[Sin[c + d*x]])/d - (a*Sec[c + d*x]*Tan[c + d*x])/(8*d) + ( 
a*Sec[c + d*x]^3*Tan[c + d*x])/(4*d) + (a*Tan[c + d*x]^4)/(4*d)
 

Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.81, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {3042, 3315, 27, 99, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \tan ^2(c+d x) \sec ^3(c+d x) (a \sin (c+d x)+a) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sin (c+d x)^2 (a \sin (c+d x)+a)}{\cos (c+d x)^5}dx\)

\(\Big \downarrow \) 3315

\(\displaystyle \frac {a^5 \int \frac {\sin ^2(c+d x)}{(a-a \sin (c+d x))^3 (\sin (c+d x) a+a)^2}d(a \sin (c+d x))}{d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {a^3 \int \frac {a^2 \sin ^2(c+d x)}{(a-a \sin (c+d x))^3 (\sin (c+d x) a+a)^2}d(a \sin (c+d x))}{d}\)

\(\Big \downarrow \) 99

\(\displaystyle \frac {a^3 \int \left (\frac {1}{4 (a-a \sin (c+d x))^3}-\frac {1}{8 \left (a^2-a^2 \sin ^2(c+d x)\right ) a}-\frac {1}{4 (a-a \sin (c+d x))^2 a}+\frac {1}{8 (\sin (c+d x) a+a)^2 a}\right )d(a \sin (c+d x))}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a^3 \left (-\frac {\text {arctanh}(\sin (c+d x))}{8 a^2}-\frac {1}{4 a (a-a \sin (c+d x))}-\frac {1}{8 a (a \sin (c+d x)+a)}+\frac {1}{8 (a-a \sin (c+d x))^2}\right )}{d}\)

Input:

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

Output:

(a^3*(-1/8*ArcTanh[Sin[c + d*x]]/a^2 + 1/(8*(a - a*Sin[c + d*x])^2) - 1/(4 
*a*(a - a*Sin[c + d*x])) - 1/(8*a*(a + a*Sin[c + d*x]))))/d
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 99
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_), x_] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], 
 x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] && (IntegerQ[p] | 
| (GtQ[m, 0] && GeQ[n, -1]))
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3315
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_ 
.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[1/(b^p* 
f)   Subst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2)*(c + (d/b)*x)^n, 
 x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, c, d, m, n}, x] && Intege 
rQ[(p - 1)/2] && EqQ[a^2 - b^2, 0]
 
Maple [A] (verified)

Time = 0.56 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.92

method result size
derivativedivides \(\frac {\frac {a \sin \left (d x +c \right )^{4}}{4 \cos \left (d x +c \right )^{4}}+a \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(88\)
default \(\frac {\frac {a \sin \left (d x +c \right )^{4}}{4 \cos \left (d x +c \right )^{4}}+a \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(88\)
risch \(\frac {i a \left (6 i {\mathrm e}^{4 i \left (d x +c \right )}+{\mathrm e}^{5 i \left (d x +c \right )}-6 i {\mathrm e}^{2 i \left (d x +c \right )}+6 \,{\mathrm e}^{3 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}\right )}{4 \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{4} \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{2} d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}\) \(129\)

Input:

int(sec(d*x+c)^3*(a+a*sin(d*x+c))*tan(d*x+c)^2,x,method=_RETURNVERBOSE)
 

Output:

1/d*(1/4*a*sin(d*x+c)^4/cos(d*x+c)^4+a*(1/4*sin(d*x+c)^3/cos(d*x+c)^4+1/8* 
sin(d*x+c)^3/cos(d*x+c)^2+1/8*sin(d*x+c)-1/8*ln(sec(d*x+c)+tan(d*x+c))))
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.41 \[ \int \sec ^3(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=\frac {2 \, a \cos \left (d x + c\right )^{2} - {\left (a \cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) - a \cos \left (d x + c\right )^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (a \cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) - a \cos \left (d x + c\right )^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 6 \, a \sin \left (d x + c\right ) + 2 \, a}{16 \, {\left (d \cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) - d \cos \left (d x + c\right )^{2}\right )}} \] Input:

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

Output:

1/16*(2*a*cos(d*x + c)^2 - (a*cos(d*x + c)^2*sin(d*x + c) - a*cos(d*x + c) 
^2)*log(sin(d*x + c) + 1) + (a*cos(d*x + c)^2*sin(d*x + c) - a*cos(d*x + c 
)^2)*log(-sin(d*x + c) + 1) - 6*a*sin(d*x + c) + 2*a)/(d*cos(d*x + c)^2*si 
n(d*x + c) - d*cos(d*x + c)^2)
                                                                                    
                                                                                    
 

Sympy [F]

\[ \int \sec ^3(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=a \left (\int \tan ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int \sin {\left (c + d x \right )} \tan ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx\right ) \] Input:

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

Output:

a*(Integral(tan(c + d*x)**2*sec(c + d*x)**3, x) + Integral(sin(c + d*x)*ta 
n(c + d*x)**2*sec(c + d*x)**3, x))
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.88 \[ \int \sec ^3(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {a \log \left (\sin \left (d x + c\right ) + 1\right ) - a \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left (a \sin \left (d x + c\right )^{2} + 3 \, a \sin \left (d x + c\right ) - 2 \, a\right )}}{\sin \left (d x + c\right )^{3} - \sin \left (d x + c\right )^{2} - \sin \left (d x + c\right ) + 1}}{16 \, d} \] Input:

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

Output:

-1/16*(a*log(sin(d*x + c) + 1) - a*log(sin(d*x + c) - 1) - 2*(a*sin(d*x + 
c)^2 + 3*a*sin(d*x + c) - 2*a)/(sin(d*x + c)^3 - sin(d*x + c)^2 - sin(d*x 
+ c) + 1))/d
 

Giac [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.79 \[ \int \sec ^3(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {1}{16} \, a {\left (\frac {\log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{d} - \frac {\log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{d} - \frac {2 \, {\left (\sin \left (d x + c\right )^{2} + 3 \, \sin \left (d x + c\right ) - 2\right )}}{d {\left (\sin \left (d x + c\right ) + 1\right )} {\left (\sin \left (d x + c\right ) - 1\right )}^{2}}\right )} \] Input:

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

Output:

-1/16*a*(log(abs(sin(d*x + c) + 1))/d - log(abs(sin(d*x + c) - 1))/d - 2*( 
sin(d*x + c)^2 + 3*sin(d*x + c) - 2)/(d*(sin(d*x + c) + 1)*(sin(d*x + c) - 
 1)^2))
 

Mupad [B] (verification not implemented)

Time = 35.33 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.74 \[ \int \sec ^3(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {a\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,d}-\frac {\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{4}-\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{2}+\frac {5\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{2}-\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{2}+\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}}{d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 209, normalized size of antiderivative = 2.18 \[ \int \sec ^3(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=\frac {a \left (\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{3}-\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2}-\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )+\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{3}+\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2}+\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )-\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+3 \sin \left (d x +c \right )^{3}-2 \sin \left (d x +c \right )^{2}+1\right )}{8 d \left (\sin \left (d x +c \right )^{3}-\sin \left (d x +c \right )^{2}-\sin \left (d x +c \right )+1\right )} \] Input:

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

Output:

(a*(log(tan((c + d*x)/2) - 1)*sin(c + d*x)**3 - log(tan((c + d*x)/2) - 1)* 
sin(c + d*x)**2 - log(tan((c + d*x)/2) - 1)*sin(c + d*x) + log(tan((c + d* 
x)/2) - 1) - log(tan((c + d*x)/2) + 1)*sin(c + d*x)**3 + log(tan((c + d*x) 
/2) + 1)*sin(c + d*x)**2 + log(tan((c + d*x)/2) + 1)*sin(c + d*x) - log(ta 
n((c + d*x)/2) + 1) + 3*sin(c + d*x)**3 - 2*sin(c + d*x)**2 + 1))/(8*d*(si 
n(c + d*x)**3 - sin(c + d*x)**2 - sin(c + d*x) + 1))