Integrand size = 21, antiderivative size = 91 \[ \int \frac {\tan ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {2 \sec ^3(c+d x)}{3 a^2 d}+\frac {4 \sec ^5(c+d x)}{5 a^2 d}-\frac {2 \sec ^7(c+d x)}{7 a^2 d}+\frac {\tan ^5(c+d x)}{5 a^2 d}+\frac {2 \tan ^7(c+d x)}{7 a^2 d} \] Output:
-2/3*sec(d*x+c)^3/a^2/d+4/5*sec(d*x+c)^5/a^2/d-2/7*sec(d*x+c)^7/a^2/d+1/5* tan(d*x+c)^5/a^2/d+2/7*tan(d*x+c)^7/a^2/d
Time = 0.91 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.38 \[ \int \frac {\tan ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {\sec ^3(c+d x) (672-1442 \cos (c+d x)+1664 \cos (2 (c+d x))-309 \cos (3 (c+d x))-288 \cos (4 (c+d x))+103 \cos (5 (c+d x))-1232 \sin (c+d x)-824 \sin (2 (c+d x))+1896 \sin (3 (c+d x))-412 \sin (4 (c+d x))-72 \sin (5 (c+d x)))}{13440 a^2 d (1+\sin (c+d x))^2} \] Input:
Integrate[Tan[c + d*x]^4/(a + a*Sin[c + d*x])^2,x]
Output:
-1/13440*(Sec[c + d*x]^3*(672 - 1442*Cos[c + d*x] + 1664*Cos[2*(c + d*x)] - 309*Cos[3*(c + d*x)] - 288*Cos[4*(c + d*x)] + 103*Cos[5*(c + d*x)] - 123 2*Sin[c + d*x] - 824*Sin[2*(c + d*x)] + 1896*Sin[3*(c + d*x)] - 412*Sin[4* (c + d*x)] - 72*Sin[5*(c + d*x)]))/(a^2*d*(1 + Sin[c + d*x])^2)
Time = 0.38 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.04, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 3190, 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 ^4(c+d x)}{(a \sin (c+d x)+a)^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\tan (c+d x)^4}{(a \sin (c+d x)+a)^2}dx\) |
\(\Big \downarrow \) 3190 |
\(\displaystyle \frac {\int \left (a^2 \sec ^2(c+d x) \tan ^6(c+d x)-2 a^2 \sec ^3(c+d x) \tan ^5(c+d x)+a^2 \sec ^4(c+d x) \tan ^4(c+d x)\right )dx}{a^4}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\frac {2 a^2 \tan ^7(c+d x)}{7 d}+\frac {a^2 \tan ^5(c+d x)}{5 d}-\frac {2 a^2 \sec ^7(c+d x)}{7 d}+\frac {4 a^2 \sec ^5(c+d x)}{5 d}-\frac {2 a^2 \sec ^3(c+d x)}{3 d}}{a^4}\) |
Input:
Int[Tan[c + d*x]^4/(a + a*Sin[c + d*x])^2,x]
Output:
((-2*a^2*Sec[c + d*x]^3)/(3*d) + (4*a^2*Sec[c + d*x]^5)/(5*d) - (2*a^2*Sec [c + d*x]^7)/(7*d) + (a^2*Tan[c + d*x]^5)/(5*d) + (2*a^2*Tan[c + d*x]^7)/( 7*d))/a^4
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((g_.)*tan[(e_.) + (f_.)*(x _)])^(p_.), x_Symbol] :> Simp[a^(2*m) Int[ExpandIntegrand[(g*Tan[e + f*x] )^p/Sec[e + f*x]^m, (a*Sec[e + f*x] - b*Tan[e + f*x])^(-m), x], x], x] /; F reeQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && ILtQ[m, 0]
Result contains complex when optimal does not.
Time = 0.89 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.45
method | result | size |
risch | \(-\frac {2 i \left (140 i {\mathrm e}^{7 i \left (d x +c \right )}+105 \,{\mathrm e}^{8 i \left (d x +c \right )}+84 i {\mathrm e}^{5 i \left (d x +c \right )}-140 \,{\mathrm e}^{6 i \left (d x +c \right )}+68 i {\mathrm e}^{3 i \left (d x +c \right )}+14 \,{\mathrm e}^{4 i \left (d x +c \right )}-36 i {\mathrm e}^{i \left (d x +c \right )}-132 \,{\mathrm e}^{2 i \left (d x +c \right )}+9\right )}{105 \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{7} \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{3} d \,a^{2}}\) | \(132\) |
derivativedivides | \(\frac {-\frac {1}{12 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {1}{8 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {32}{256 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-256}-\frac {4}{7 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{7}}+\frac {2}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{6}}-\frac {12}{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}{12 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {1}{8 \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 )}}{d \,a^{2}}\) | \(160\) |
default | \(\frac {-\frac {1}{12 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {1}{8 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {32}{256 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-256}-\frac {4}{7 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{7}}+\frac {2}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{6}}-\frac {12}{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}{12 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {1}{8 \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 )}}{d \,a^{2}}\) | \(160\) |
Input:
int(tan(d*x+c)^4/(a+a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
-2/105*I*(140*I*exp(7*I*(d*x+c))+105*exp(8*I*(d*x+c))+84*I*exp(5*I*(d*x+c) )-140*exp(6*I*(d*x+c))+68*I*exp(3*I*(d*x+c))+14*exp(4*I*(d*x+c))-36*I*exp( I*(d*x+c))-132*exp(2*I*(d*x+c))+9)/(exp(I*(d*x+c))+I)^7/(exp(I*(d*x+c))-I) ^3/d/a^2
Time = 0.08 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.13 \[ \int \frac {\tan ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {18 \, \cos \left (d x + c\right )^{4} - 44 \, \cos \left (d x + c\right )^{2} + {\left (9 \, \cos \left (d x + c\right )^{4} - 66 \, \cos \left (d x + c\right )^{2} + 25\right )} \sin \left (d x + c\right ) + 10}{105 \, {\left (a^{2} d \cos \left (d x + c\right )^{5} - 2 \, a^{2} d \cos \left (d x + c\right )^{3} \sin \left (d x + c\right ) - 2 \, a^{2} d \cos \left (d x + c\right )^{3}\right )}} \] Input:
integrate(tan(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="fricas")
Output:
-1/105*(18*cos(d*x + c)^4 - 44*cos(d*x + c)^2 + (9*cos(d*x + c)^4 - 66*cos (d*x + c)^2 + 25)*sin(d*x + c) + 10)/(a^2*d*cos(d*x + c)^5 - 2*a^2*d*cos(d *x + c)^3*sin(d*x + c) - 2*a^2*d*cos(d*x + c)^3)
\[ \int \frac {\tan ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\int \frac {\tan ^{4}{\left (c + d x \right )}}{\sin ^{2}{\left (c + d x \right )} + 2 \sin {\left (c + d x \right )} + 1}\, dx}{a^{2}} \] Input:
integrate(tan(d*x+c)**4/(a+a*sin(d*x+c))**2,x)
Output:
Integral(tan(c + d*x)**4/(sin(c + d*x)**2 + 2*sin(c + d*x) + 1), x)/a**2
Leaf count of result is larger than twice the leaf count of optimal. 316 vs. \(2 (81) = 162\).
Time = 0.04 (sec) , antiderivative size = 316, normalized size of antiderivative = 3.47 \[ \int \frac {\tan ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {32 \, {\left (\frac {4 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {3 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {8 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {14 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {21 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + 1\right )}}{105 \, {\left (a^{2} + \frac {4 \, a^{2} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {3 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {8 \, a^{2} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {14 \, a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {14 \, a^{2} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {8 \, a^{2} \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} - \frac {3 \, a^{2} \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} - \frac {4 \, a^{2} \sin \left (d x + c\right )^{9}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{9}} - \frac {a^{2} \sin \left (d x + c\right )^{10}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{10}}\right )} d} \] Input:
integrate(tan(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="maxima")
Output:
-32/105*(4*sin(d*x + c)/(cos(d*x + c) + 1) + 3*sin(d*x + c)^2/(cos(d*x + c ) + 1)^2 - 8*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 - 14*sin(d*x + c)^4/(cos( d*x + c) + 1)^4 - 21*sin(d*x + c)^5/(cos(d*x + c) + 1)^5 + 1)/((a^2 + 4*a^ 2*sin(d*x + c)/(cos(d*x + c) + 1) + 3*a^2*sin(d*x + c)^2/(cos(d*x + c) + 1 )^2 - 8*a^2*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 - 14*a^2*sin(d*x + c)^4/(c os(d*x + c) + 1)^4 + 14*a^2*sin(d*x + c)^6/(cos(d*x + c) + 1)^6 + 8*a^2*si n(d*x + c)^7/(cos(d*x + c) + 1)^7 - 3*a^2*sin(d*x + c)^8/(cos(d*x + c) + 1 )^8 - 4*a^2*sin(d*x + c)^9/(cos(d*x + c) + 1)^9 - a^2*sin(d*x + c)^10/(cos (d*x + c) + 1)^10)*d)
Time = 0.25 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.60 \[ \int \frac {\tan ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\frac {35 \, {\left (3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 9 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 4\right )}}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}^{3}} - \frac {105 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 735 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 2030 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 2030 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 1701 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 707 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 116}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}^{7}}}{840 \, d} \] Input:
integrate(tan(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="giac")
Output:
1/840*(35*(3*tan(1/2*d*x + 1/2*c)^2 - 9*tan(1/2*d*x + 1/2*c) + 4)/(a^2*(ta n(1/2*d*x + 1/2*c) - 1)^3) - (105*tan(1/2*d*x + 1/2*c)^6 + 735*tan(1/2*d*x + 1/2*c)^5 + 2030*tan(1/2*d*x + 1/2*c)^4 + 2030*tan(1/2*d*x + 1/2*c)^3 + 1701*tan(1/2*d*x + 1/2*c)^2 + 707*tan(1/2*d*x + 1/2*c) + 116)/(a^2*(tan(1/ 2*d*x + 1/2*c) + 1)^7))/d
Time = 34.91 (sec) , antiderivative size = 184, normalized size of antiderivative = 2.02 \[ \int \frac {\tan ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {\frac {32\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}}{105}+\frac {128\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{105}+\frac {32\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{35}-\frac {256\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{105}-\frac {64\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{15}-\frac {32\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{5}}{a^2\,d\,{\left (\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}^3\,{\left (\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}^7} \] Input:
int(tan(c + d*x)^4/(a + a*sin(c + d*x))^2,x)
Output:
-((32*cos(c/2 + (d*x)/2)^10)/105 + (128*cos(c/2 + (d*x)/2)^9*sin(c/2 + (d* x)/2))/105 - (32*cos(c/2 + (d*x)/2)^5*sin(c/2 + (d*x)/2)^5)/5 - (64*cos(c/ 2 + (d*x)/2)^6*sin(c/2 + (d*x)/2)^4)/15 - (256*cos(c/2 + (d*x)/2)^7*sin(c/ 2 + (d*x)/2)^3)/105 + (32*cos(c/2 + (d*x)/2)^8*sin(c/2 + (d*x)/2)^2)/35)/( a^2*d*(cos(c/2 + (d*x)/2) - sin(c/2 + (d*x)/2))^3*(cos(c/2 + (d*x)/2) + si n(c/2 + (d*x)/2))^7)
Time = 0.18 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.65 \[ \int \frac {\tan ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {-16 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4}-32 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}+32 \cos \left (d x +c \right ) \sin \left (d x +c \right )+16 \cos \left (d x +c \right )-9 \sin \left (d x +c \right )^{5}-18 \sin \left (d x +c \right )^{4}-48 \sin \left (d x +c \right )^{3}-8 \sin \left (d x +c \right )^{2}+32 \sin \left (d x +c \right )+16}{105 \cos \left (d x +c \right ) a^{2} d \left (\sin \left (d x +c \right )^{4}+2 \sin \left (d x +c \right )^{3}-2 \sin \left (d x +c \right )-1\right )} \] Input:
int(tan(d*x+c)^4/(a+a*sin(d*x+c))^2,x)
Output:
( - 16*cos(c + d*x)*sin(c + d*x)**4 - 32*cos(c + d*x)*sin(c + d*x)**3 + 32 *cos(c + d*x)*sin(c + d*x) + 16*cos(c + d*x) - 9*sin(c + d*x)**5 - 18*sin( c + d*x)**4 - 48*sin(c + d*x)**3 - 8*sin(c + d*x)**2 + 32*sin(c + d*x) + 1 6)/(105*cos(c + d*x)*a**2*d*(sin(c + d*x)**4 + 2*sin(c + d*x)**3 - 2*sin(c + d*x) - 1))