Integrand size = 21, antiderivative size = 113 \[ \int (a+a \sin (c+d x))^4 \tan ^2(c+d x) \, dx=-\frac {95 a^4 x}{8}+\frac {12 a^4 \cos (c+d x)}{d}-\frac {4 a^4 \cos ^3(c+d x)}{3 d}+\frac {8 a^4 \cos (c+d x)}{d (1-\sin (c+d x))}+\frac {31 a^4 \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^4 \cos (c+d x) \sin ^3(c+d x)}{4 d} \] Output:
-95/8*a^4*x+12*a^4*cos(d*x+c)/d-4/3*a^4*cos(d*x+c)^3/d+8*a^4*cos(d*x+c)/d/ (1-sin(d*x+c))+31/8*a^4*cos(d*x+c)*sin(d*x+c)/d+1/4*a^4*cos(d*x+c)*sin(d*x +c)^3/d
Time = 6.95 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.11 \[ \int (a+a \sin (c+d x))^4 \tan ^2(c+d x) \, dx=\frac {(a+a \sin (c+d x))^4 \left (-1140 (c+d x)+1056 \cos (c+d x)-32 \cos (3 (c+d x))+\frac {1536 \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )}+192 \sin (2 (c+d x))-3 \sin (4 (c+d x))\right )}{96 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^8} \] Input:
Integrate[(a + a*Sin[c + d*x])^4*Tan[c + d*x]^2,x]
Output:
((a + a*Sin[c + d*x])^4*(-1140*(c + d*x) + 1056*Cos[c + d*x] - 32*Cos[3*(c + d*x)] + (1536*Sin[(c + d*x)/2])/(Cos[(c + d*x)/2] - Sin[(c + d*x)/2]) + 192*Sin[2*(c + d*x)] - 3*Sin[4*(c + d*x)]))/(96*d*(Cos[(c + d*x)/2] + Sin [(c + d*x)/2])^8)
Time = 0.38 (sec) , antiderivative size = 117, 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, 3188, 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) (a \sin (c+d x)+a)^4 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x)^2 (a \sin (c+d x)+a)^4dx\) |
\(\Big \downarrow \) 3188 |
\(\displaystyle a^2 \int \left (-a^2 \sin ^4(c+d x)-4 a^2 \sin ^3(c+d x)-7 a^2 \sin ^2(c+d x)-8 a^2 \sin (c+d x)-8 a^2+\frac {8 a^2}{1-\sin (c+d x)}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle a^2 \left (-\frac {4 a^2 \cos ^3(c+d x)}{3 d}+\frac {12 a^2 \cos (c+d x)}{d}+\frac {a^2 \sin ^3(c+d x) \cos (c+d x)}{4 d}+\frac {31 a^2 \sin (c+d x) \cos (c+d x)}{8 d}+\frac {8 a^2 \cos (c+d x)}{d (1-\sin (c+d x))}-\frac {95 a^2 x}{8}\right )\) |
Input:
Int[(a + a*Sin[c + d*x])^4*Tan[c + d*x]^2,x]
Output:
a^2*((-95*a^2*x)/8 + (12*a^2*Cos[c + d*x])/d - (4*a^2*Cos[c + d*x]^3)/(3*d ) + (8*a^2*Cos[c + d*x])/(d*(1 - Sin[c + d*x])) + (31*a^2*Cos[c + d*x]*Sin [c + d*x])/(8*d) + (a^2*Cos[c + d*x]*Sin[c + d*x]^3)/(4*d))
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*tan[(e_.) + (f_.)*(x_)]^(p_ ), x_Symbol] :> Simp[a^p Int[ExpandIntegrand[Sin[e + f*x]^p*((a + b*Sin[e + f*x])^(m - p/2)/(a - b*Sin[e + f*x])^(p/2)), x], x], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0] && IntegersQ[m, p/2] && (LtQ[p, 0] || GtQ[m - p/2, 0])
Result contains complex when optimal does not.
Time = 19.93 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.02
method | result | size |
risch | \(-\frac {95 a^{4} x}{8}+\frac {11 a^{4} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {11 a^{4} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {16 a^{4}}{d \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}-\frac {a^{4} \sin \left (4 d x +4 c \right )}{32 d}-\frac {a^{4} \cos \left (3 d x +3 c \right )}{3 d}+\frac {2 a^{4} \sin \left (2 d x +2 c \right )}{d}\) | \(115\) |
derivativedivides | \(\frac {a^{4} \left (\frac {\sin \left (d x +c \right )^{7}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{5}+\frac {5 \sin \left (d x +c \right )^{3}}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )-\frac {15 d x}{8}-\frac {15 c}{8}\right )+4 a^{4} \left (\frac {\sin \left (d x +c \right )^{6}}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin \left (d x +c \right )^{4}+\frac {4 \sin \left (d x +c \right )^{2}}{3}\right ) \cos \left (d x +c \right )\right )+6 a^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+4 a^{4} \left (\frac {\sin \left (d x +c \right )^{4}}{\cos \left (d x +c \right )}+\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )\right )+a^{4} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(231\) |
default | \(\frac {a^{4} \left (\frac {\sin \left (d x +c \right )^{7}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{5}+\frac {5 \sin \left (d x +c \right )^{3}}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )-\frac {15 d x}{8}-\frac {15 c}{8}\right )+4 a^{4} \left (\frac {\sin \left (d x +c \right )^{6}}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin \left (d x +c \right )^{4}+\frac {4 \sin \left (d x +c \right )^{2}}{3}\right ) \cos \left (d x +c \right )\right )+6 a^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+4 a^{4} \left (\frac {\sin \left (d x +c \right )^{4}}{\cos \left (d x +c \right )}+\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )\right )+a^{4} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(231\) |
parts | \(\frac {a^{4} \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {a^{4} \left (\frac {\sin \left (d x +c \right )^{7}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{5}+\frac {5 \sin \left (d x +c \right )^{3}}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )-\frac {15 d x}{8}-\frac {15 c}{8}\right )}{d}+\frac {4 a^{4} \left (\frac {\sin \left (d x +c \right )^{4}}{\cos \left (d x +c \right )}+\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )\right )}{d}+\frac {6 a^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )}{d}+\frac {4 a^{4} \left (\frac {\sin \left (d x +c \right )^{6}}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin \left (d x +c \right )^{4}+\frac {4 \sin \left (d x +c \right )^{2}}{3}\right ) \cos \left (d x +c \right )\right )}{d}\) | \(244\) |
Input:
int((a+a*sin(d*x+c))^4*tan(d*x+c)^2,x,method=_RETURNVERBOSE)
Output:
-95/8*a^4*x+11/2/d*a^4*exp(I*(d*x+c))+11/2*a^4/d*exp(-I*(d*x+c))+16*a^4/d/ (exp(I*(d*x+c))-I)-1/32/d*a^4*sin(4*d*x+4*c)-1/3*a^4/d*cos(3*d*x+3*c)+2*a^ 4/d*sin(2*d*x+2*c)
Time = 0.11 (sec) , antiderivative size = 179, normalized size of antiderivative = 1.58 \[ \int (a+a \sin (c+d x))^4 \tan ^2(c+d x) \, dx=-\frac {6 \, a^{4} \cos \left (d x + c\right )^{5} + 32 \, a^{4} \cos \left (d x + c\right )^{4} - 73 \, a^{4} \cos \left (d x + c\right )^{3} + 285 \, a^{4} d x - 288 \, a^{4} \cos \left (d x + c\right )^{2} - 192 \, a^{4} + 3 \, {\left (95 \, a^{4} d x - 127 \, a^{4}\right )} \cos \left (d x + c\right ) + {\left (6 \, a^{4} \cos \left (d x + c\right )^{4} - 26 \, a^{4} \cos \left (d x + c\right )^{3} - 285 \, a^{4} d x - 99 \, a^{4} \cos \left (d x + c\right )^{2} + 189 \, a^{4} \cos \left (d x + c\right ) - 192 \, a^{4}\right )} \sin \left (d x + c\right )}{24 \, {\left (d \cos \left (d x + c\right ) - d \sin \left (d x + c\right ) + d\right )}} \] Input:
integrate((a+a*sin(d*x+c))^4*tan(d*x+c)^2,x, algorithm="fricas")
Output:
-1/24*(6*a^4*cos(d*x + c)^5 + 32*a^4*cos(d*x + c)^4 - 73*a^4*cos(d*x + c)^ 3 + 285*a^4*d*x - 288*a^4*cos(d*x + c)^2 - 192*a^4 + 3*(95*a^4*d*x - 127*a ^4)*cos(d*x + c) + (6*a^4*cos(d*x + c)^4 - 26*a^4*cos(d*x + c)^3 - 285*a^4 *d*x - 99*a^4*cos(d*x + c)^2 + 189*a^4*cos(d*x + c) - 192*a^4)*sin(d*x + c ))/(d*cos(d*x + c) - d*sin(d*x + c) + d)
\[ \int (a+a \sin (c+d x))^4 \tan ^2(c+d x) \, dx=a^{4} \left (\int 4 \sin {\left (c + d x \right )} \tan ^{2}{\left (c + d x \right )}\, dx + \int 6 \sin ^{2}{\left (c + d x \right )} \tan ^{2}{\left (c + d x \right )}\, dx + \int 4 \sin ^{3}{\left (c + d x \right )} \tan ^{2}{\left (c + d x \right )}\, dx + \int \sin ^{4}{\left (c + d x \right )} \tan ^{2}{\left (c + d x \right )}\, dx + \int \tan ^{2}{\left (c + d x \right )}\, dx\right ) \] Input:
integrate((a+a*sin(d*x+c))**4*tan(d*x+c)**2,x)
Output:
a**4*(Integral(4*sin(c + d*x)*tan(c + d*x)**2, x) + Integral(6*sin(c + d*x )**2*tan(c + d*x)**2, x) + Integral(4*sin(c + d*x)**3*tan(c + d*x)**2, x) + Integral(sin(c + d*x)**4*tan(c + d*x)**2, x) + Integral(tan(c + d*x)**2, x))
Time = 0.12 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.60 \[ \int (a+a \sin (c+d x))^4 \tan ^2(c+d x) \, dx=-\frac {32 \, {\left (\cos \left (d x + c\right )^{3} - \frac {3}{\cos \left (d x + c\right )} - 6 \, \cos \left (d x + c\right )\right )} a^{4} + 3 \, {\left (15 \, d x + 15 \, c - \frac {9 \, \tan \left (d x + c\right )^{3} + 7 \, \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{4} + 2 \, \tan \left (d x + c\right )^{2} + 1} - 8 \, \tan \left (d x + c\right )\right )} a^{4} + 72 \, {\left (3 \, d x + 3 \, c - \frac {\tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1} - 2 \, \tan \left (d x + c\right )\right )} a^{4} + 24 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{4} - 96 \, a^{4} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{24 \, d} \] Input:
integrate((a+a*sin(d*x+c))^4*tan(d*x+c)^2,x, algorithm="maxima")
Output:
-1/24*(32*(cos(d*x + c)^3 - 3/cos(d*x + c) - 6*cos(d*x + c))*a^4 + 3*(15*d *x + 15*c - (9*tan(d*x + c)^3 + 7*tan(d*x + c))/(tan(d*x + c)^4 + 2*tan(d* x + c)^2 + 1) - 8*tan(d*x + c))*a^4 + 72*(3*d*x + 3*c - tan(d*x + c)/(tan( d*x + c)^2 + 1) - 2*tan(d*x + c))*a^4 + 24*(d*x + c - tan(d*x + c))*a^4 - 96*a^4*(1/cos(d*x + c) + cos(d*x + c)))/d
Timed out. \[ \int (a+a \sin (c+d x))^4 \tan ^2(c+d x) \, dx=\text {Timed out} \] Input:
integrate((a+a*sin(d*x+c))^4*tan(d*x+c)^2,x, algorithm="giac")
Output:
Timed out
Time = 20.33 (sec) , antiderivative size = 363, normalized size of antiderivative = 3.21 \[ \int (a+a \sin (c+d x))^4 \tan ^2(c+d x) \, dx=-\frac {95\,a^4\,x}{8}-\frac {\frac {95\,a^4\,\left (c+d\,x\right )}{8}-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {95\,a^4\,\left (c+d\,x\right )}{8}-\frac {a^4\,\left (285\,c+285\,d\,x-326\right )}{24}\right )-\frac {a^4\,\left (285\,c+285\,d\,x-896\right )}{24}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (\frac {95\,a^4\,\left (c+d\,x\right )}{8}-\frac {a^4\,\left (285\,c+285\,d\,x-570\right )}{24}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (\frac {95\,a^4\,\left (c+d\,x\right )}{2}-\frac {a^4\,\left (1140\,c+1140\,d\,x-570\right )}{24}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {95\,a^4\,\left (c+d\,x\right )}{2}-\frac {a^4\,\left (1140\,c+1140\,d\,x-1430\right )}{24}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {95\,a^4\,\left (c+d\,x\right )}{2}-\frac {a^4\,\left (1140\,c+1140\,d\,x-2154\right )}{24}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {95\,a^4\,\left (c+d\,x\right )}{2}-\frac {a^4\,\left (1140\,c+1140\,d\,x-3014\right )}{24}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {285\,a^4\,\left (c+d\,x\right )}{4}-\frac {a^4\,\left (1710\,c+1710\,d\,x-1770\right )}{24}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {285\,a^4\,\left (c+d\,x\right )}{4}-\frac {a^4\,\left (1710\,c+1710\,d\,x-3606\right )}{24}\right )}{d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^4} \] Input:
int(tan(c + d*x)^2*(a + a*sin(c + d*x))^4,x)
Output:
- (95*a^4*x)/8 - ((95*a^4*(c + d*x))/8 - tan(c/2 + (d*x)/2)*((95*a^4*(c + d*x))/8 - (a^4*(285*c + 285*d*x - 326))/24) - (a^4*(285*c + 285*d*x - 896) )/24 + tan(c/2 + (d*x)/2)^8*((95*a^4*(c + d*x))/8 - (a^4*(285*c + 285*d*x - 570))/24) - tan(c/2 + (d*x)/2)^7*((95*a^4*(c + d*x))/2 - (a^4*(1140*c + 1140*d*x - 570))/24) - tan(c/2 + (d*x)/2)^3*((95*a^4*(c + d*x))/2 - (a^4*( 1140*c + 1140*d*x - 1430))/24) + tan(c/2 + (d*x)/2)^6*((95*a^4*(c + d*x))/ 2 - (a^4*(1140*c + 1140*d*x - 2154))/24) + tan(c/2 + (d*x)/2)^2*((95*a^4*( c + d*x))/2 - (a^4*(1140*c + 1140*d*x - 3014))/24) - tan(c/2 + (d*x)/2)^5* ((285*a^4*(c + d*x))/4 - (a^4*(1710*c + 1710*d*x - 1770))/24) + tan(c/2 + (d*x)/2)^4*((285*a^4*(c + d*x))/4 - (a^4*(1710*c + 1710*d*x - 3606))/24))/ (d*(tan(c/2 + (d*x)/2) - 1)*(tan(c/2 + (d*x)/2)^2 + 1)^4)
Time = 0.22 (sec) , antiderivative size = 107, normalized size of antiderivative = 0.95 \[ \int (a+a \sin (c+d x))^4 \tan ^2(c+d x) \, dx=\frac {a^{4} \left (24 \cos \left (d x +c \right ) \tan \left (d x +c \right )-261 \cos \left (d x +c \right ) c -285 \cos \left (d x +c \right ) d x -448 \cos \left (d x +c \right )-6 \sin \left (d x +c \right )^{5}-32 \sin \left (d x +c \right )^{4}-87 \sin \left (d x +c \right )^{3}-224 \sin \left (d x +c \right )^{2}+261 \sin \left (d x +c \right )+448\right )}{24 \cos \left (d x +c \right ) d} \] Input:
int((a+a*sin(d*x+c))^4*tan(d*x+c)^2,x)
Output:
(a**4*(24*cos(c + d*x)*tan(c + d*x) - 261*cos(c + d*x)*c - 285*cos(c + d*x )*d*x - 448*cos(c + d*x) - 6*sin(c + d*x)**5 - 32*sin(c + d*x)**4 - 87*sin (c + d*x)**3 - 224*sin(c + d*x)**2 + 261*sin(c + d*x) + 448))/(24*cos(c + d*x)*d)