\(\int \frac {\sec ^2(c+d x) \tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx\) [825]

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

Optimal result

Integrand size = 29, antiderivative size = 73 \[ \int \frac {\sec ^2(c+d x) \tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\sec ^3(c+d x)}{3 a d}-\frac {\sec ^5(c+d x)}{5 a d}+\frac {\tan ^3(c+d x)}{3 a d}+\frac {\tan ^5(c+d x)}{5 a d} \] Output:

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

Mathematica [A] (verified)

Time = 1.29 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.45 \[ \int \frac {\sec ^2(c+d x) \tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\sec ^3(c+d x) (-80+66 \cos (c+d x)-32 \cos (2 (c+d x))+22 \cos (3 (c+d x))-16 \cos (4 (c+d x))-224 \sin (c+d x)+22 \sin (2 (c+d x))+32 \sin (3 (c+d x))+11 \sin (4 (c+d x)))}{960 a d (1+\sin (c+d x))} \] Input:

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

Output:

-1/960*(Sec[c + d*x]^3*(-80 + 66*Cos[c + d*x] - 32*Cos[2*(c + d*x)] + 22*C 
os[3*(c + d*x)] - 16*Cos[4*(c + d*x)] - 224*Sin[c + d*x] + 22*Sin[2*(c + d 
*x)] + 32*Sin[3*(c + d*x)] + 11*Sin[4*(c + d*x)]))/(a*d*(1 + Sin[c + d*x]) 
)
 

Rubi [A] (verified)

Time = 0.47 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.90, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.345, Rules used = {3042, 3318, 3042, 3086, 25, 244, 2009, 3087, 244, 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 \frac {\tan ^2(c+d x) \sec ^2(c+d x)}{a \sin (c+d x)+a} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3318

\(\displaystyle \frac {\int \sec ^4(c+d x) \tan ^2(c+d x)dx}{a}-\frac {\int \sec ^3(c+d x) \tan ^3(c+d x)dx}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \sec (c+d x)^4 \tan (c+d x)^2dx}{a}-\frac {\int \sec (c+d x)^3 \tan (c+d x)^3dx}{a}\)

\(\Big \downarrow \) 3086

\(\displaystyle \frac {\int \sec (c+d x)^4 \tan (c+d x)^2dx}{a}-\frac {\int -\sec ^2(c+d x) \left (1-\sec ^2(c+d x)\right )d\sec (c+d x)}{a d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int \sec ^2(c+d x) \left (1-\sec ^2(c+d x)\right )d\sec (c+d x)}{a d}+\frac {\int \sec (c+d x)^4 \tan (c+d x)^2dx}{a}\)

\(\Big \downarrow \) 244

\(\displaystyle \frac {\int \left (\sec ^2(c+d x)-\sec ^4(c+d x)\right )d\sec (c+d x)}{a d}+\frac {\int \sec (c+d x)^4 \tan (c+d x)^2dx}{a}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\int \sec (c+d x)^4 \tan (c+d x)^2dx}{a}-\frac {\frac {1}{5} \sec ^5(c+d x)-\frac {1}{3} \sec ^3(c+d x)}{a d}\)

\(\Big \downarrow \) 3087

\(\displaystyle \frac {\int \tan ^2(c+d x) \left (\tan ^2(c+d x)+1\right )d\tan (c+d x)}{a d}-\frac {\frac {1}{5} \sec ^5(c+d x)-\frac {1}{3} \sec ^3(c+d x)}{a d}\)

\(\Big \downarrow \) 244

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {1}{5} \tan ^5(c+d x)+\frac {1}{3} \tan ^3(c+d x)}{a d}-\frac {\frac {1}{5} \sec ^5(c+d x)-\frac {1}{3} \sec ^3(c+d x)}{a d}\)

Input:

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

Output:

-((-1/3*Sec[c + d*x]^3 + Sec[c + d*x]^5/5)/(a*d)) + (Tan[c + d*x]^3/3 + Ta 
n[c + d*x]^5/5)/(a*d)
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 244
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[Expand 
Integrand[(c*x)^m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && IGtQ[p 
, 0]
 

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 3086
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( 
n_.), x_Symbol] :> Simp[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 3087
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_S 
ymbol] :> Simp[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 3318
Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^( 
n_.))/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[g^2/a   Int 
[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Simp[g^2/(b*d)   Int 
[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, 
d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0]
 
Maple [C] (verified)

Result contains complex when optimal does not.

Time = 1.28 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.33

method result size
risch \(\frac {-\frac {16 \,{\mathrm e}^{3 i \left (d x +c \right )}}{15}+\frac {4 i {\mathrm e}^{4 i \left (d x +c \right )}}{3}+\frac {8 i {\mathrm e}^{2 i \left (d x +c \right )}}{15}+\frac {8 \,{\mathrm e}^{5 i \left (d x +c \right )}}{3}+\frac {8 \,{\mathrm e}^{i \left (d x +c \right )}}{15}+\frac {4 i}{15}}{\left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{5} \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{3} d a}\) \(97\)
derivativedivides \(\frac {-\frac {1}{6 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {1}{8 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {2}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}+\frac {1}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}-\frac {1}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {8}{64 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+64}}{d a}\) \(130\)
default \(\frac {-\frac {1}{6 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {1}{8 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {2}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}+\frac {1}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}-\frac {1}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {8}{64 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+64}}{d a}\) \(130\)

Input:

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

Output:

4/15*(-4*exp(3*I*(d*x+c))+5*I*exp(4*I*(d*x+c))+2*I*exp(2*I*(d*x+c))+10*exp 
(5*I*(d*x+c))+2*exp(I*(d*x+c))+I)/(exp(I*(d*x+c))+I)^5/(exp(I*(d*x+c))-I)^ 
3/d/a
 

Fricas [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.00 \[ \int \frac {\sec ^2(c+d x) \tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {2 \, \cos \left (d x + c\right )^{4} - \cos \left (d x + c\right )^{2} - 2 \, {\left (\cos \left (d x + c\right )^{2} - 2\right )} \sin \left (d x + c\right ) + 1}{15 \, {\left (a d \cos \left (d x + c\right )^{3} \sin \left (d x + c\right ) + a d \cos \left (d x + c\right )^{3}\right )}} \] Input:

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

Output:

1/15*(2*cos(d*x + c)^4 - cos(d*x + c)^2 - 2*(cos(d*x + c)^2 - 2)*sin(d*x + 
 c) + 1)/(a*d*cos(d*x + c)^3*sin(d*x + c) + a*d*cos(d*x + c)^3)
 

Sympy [F]

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

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

Output:

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 254 vs. \(2 (65) = 130\).

Time = 0.04 (sec) , antiderivative size = 254, normalized size of antiderivative = 3.48 \[ \int \frac {\sec ^2(c+d x) \tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {4 \, {\left (\frac {2 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {2 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {4 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {5 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {10 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + 1\right )}}{15 \, {\left (a + \frac {2 \, a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {6 \, a \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {6 \, a \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {2 \, a \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} - \frac {2 \, a \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} - \frac {a \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}}\right )} d} \] Input:

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.49 \[ \int \frac {\sec ^2(c+d x) \tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\frac {5 \, {\left (3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}^{3}} - \frac {3 \, {\left (5 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 40 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 50 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 40 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 9\right )}}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}^{5}}}{120 \, d} \] Input:

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

Output:

-1/120*(5*(3*tan(1/2*d*x + 1/2*c)^2 + 1)/(a*(tan(1/2*d*x + 1/2*c) - 1)^3) 
- 3*(5*tan(1/2*d*x + 1/2*c)^4 + 40*tan(1/2*d*x + 1/2*c)^3 + 50*tan(1/2*d*x 
 + 1/2*c)^2 + 40*tan(1/2*d*x + 1/2*c) + 9)/(a*(tan(1/2*d*x + 1/2*c) + 1)^5 
))/d
 

Mupad [B] (verification not implemented)

Time = 32.96 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.36 \[ \int \frac {\sec ^2(c+d x) \tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {4\,\left (10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+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-2\,{\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 )}{15\,a\,d\,{\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )}^3\,{\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )}^5} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.89 \[ \int \frac {\sec ^2(c+d x) \tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}+2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}-2 \cos \left (d x +c \right ) \sin \left (d x +c \right )-2 \cos \left (d x +c \right )-2 \sin \left (d x +c \right )^{4}-2 \sin \left (d x +c \right )^{3}+3 \sin \left (d x +c \right )^{2}-2 \sin \left (d x +c \right )-2}{15 \cos \left (d x +c \right ) a 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)^2*tan(d*x+c)^2/(a+a*sin(d*x+c)),x)
 

Output:

(2*cos(c + d*x)*sin(c + d*x)**3 + 2*cos(c + d*x)*sin(c + d*x)**2 - 2*cos(c 
 + d*x)*sin(c + d*x) - 2*cos(c + d*x) - 2*sin(c + d*x)**4 - 2*sin(c + d*x) 
**3 + 3*sin(c + d*x)**2 - 2*sin(c + d*x) - 2)/(15*cos(c + d*x)*a*d*(sin(c 
+ d*x)**3 + sin(c + d*x)**2 - sin(c + d*x) - 1))