Integrand size = 21, antiderivative size = 71 \[ \int (a+a \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {5 a^2 x}{2}+\frac {2 a^2 \cos (c+d x)}{d}+\frac {2 a^2 \cos (c+d x)}{d (1-\sin (c+d x))}+\frac {a^2 \cos (c+d x) \sin (c+d x)}{2 d} \] Output:
-5/2*a^2*x+2*a^2*cos(d*x+c)/d+2*a^2*cos(d*x+c)/d/(1-sin(d*x+c))+1/2*a^2*co s(d*x+c)*sin(d*x+c)/d
Time = 0.23 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.69 \[ \int (a+a \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {a^2 \sec (c+d x) (1+\sin (c+d x))^{5/2} \left (-10 \arcsin \left (\frac {\sqrt {1-\sin (c+d x)}}{\sqrt {2}}\right ) \sqrt {1-\sin (c+d x)}+\sqrt {1+\sin (c+d x)} \left (-8+3 \sin (c+d x)+\sin ^2(c+d x)\right )\right )}{2 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4} \] Input:
Integrate[(a + a*Sin[c + d*x])^2*Tan[c + d*x]^2,x]
Output:
-1/2*(a^2*Sec[c + d*x]*(1 + Sin[c + d*x])^(5/2)*(-10*ArcSin[Sqrt[1 - Sin[c + d*x]]/Sqrt[2]]*Sqrt[1 - Sin[c + d*x]] + Sqrt[1 + Sin[c + d*x]]*(-8 + 3* Sin[c + d*x] + Sin[c + d*x]^2)))/(d*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^ 4)
Time = 0.29 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.89, 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)^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x)^2 (a \sin (c+d x)+a)^2dx\) |
\(\Big \downarrow \) 3188 |
\(\displaystyle a^2 \int \left (-\sin ^2(c+d x)-2 \sin (c+d x)+\frac {2}{1-\sin (c+d x)}-2\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle a^2 \left (\frac {2 \cos (c+d x)}{d}+\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {2 \cos (c+d x)}{d (1-\sin (c+d x))}-\frac {5 x}{2}\right )\) |
Input:
Int[(a + a*Sin[c + d*x])^2*Tan[c + d*x]^2,x]
Output:
a^2*((-5*x)/2 + (2*Cos[c + d*x])/d + (2*Cos[c + d*x])/(d*(1 - Sin[c + d*x] )) + (Cos[c + d*x]*Sin[c + d*x])/(2*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 = 1.43 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.11
method | result | size |
risch | \(-\frac {5 a^{2} x}{2}+\frac {a^{2} {\mathrm e}^{i \left (d x +c \right )}}{d}+\frac {a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{d}+\frac {4 a^{2}}{d \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}+\frac {a^{2} \sin \left (2 d x +2 c \right )}{4 d}\) | \(79\) |
derivativedivides | \(\frac {a^{2} \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 )+2 a^{2} \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^{2} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(117\) |
default | \(\frac {a^{2} \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 )+2 a^{2} \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^{2} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(117\) |
parts | \(\frac {a^{2} \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {a^{2} \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 {2 a^{2} \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}\) | \(124\) |
Input:
int((a+a*sin(d*x+c))^2*tan(d*x+c)^2,x,method=_RETURNVERBOSE)
Output:
-5/2*a^2*x+a^2/d*exp(I*(d*x+c))+a^2/d*exp(-I*(d*x+c))+4*a^2/d/(exp(I*(d*x+ c))-I)+1/4*a^2/d*sin(2*d*x+2*c)
Time = 0.08 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.76 \[ \int (a+a \sin (c+d x))^2 \tan ^2(c+d x) \, dx=\frac {a^{2} \cos \left (d x + c\right )^{3} - 5 \, a^{2} d x + 4 \, a^{2} \cos \left (d x + c\right )^{2} + 4 \, a^{2} - {\left (5 \, a^{2} d x - 7 \, a^{2}\right )} \cos \left (d x + c\right ) + {\left (5 \, a^{2} d x + a^{2} \cos \left (d x + c\right )^{2} - 3 \, a^{2} \cos \left (d x + c\right ) + 4 \, a^{2}\right )} \sin \left (d x + c\right )}{2 \, {\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))^2*tan(d*x+c)^2,x, algorithm="fricas")
Output:
1/2*(a^2*cos(d*x + c)^3 - 5*a^2*d*x + 4*a^2*cos(d*x + c)^2 + 4*a^2 - (5*a^ 2*d*x - 7*a^2)*cos(d*x + c) + (5*a^2*d*x + a^2*cos(d*x + c)^2 - 3*a^2*cos( d*x + c) + 4*a^2)*sin(d*x + c))/(d*cos(d*x + c) - d*sin(d*x + c) + d)
\[ \int (a+a \sin (c+d x))^2 \tan ^2(c+d x) \, dx=a^{2} \left (\int 2 \sin {\left (c + d x \right )} \tan ^{2}{\left (c + d x \right )}\, dx + \int \sin ^{2}{\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))**2*tan(d*x+c)**2,x)
Output:
a**2*(Integral(2*sin(c + d*x)*tan(c + d*x)**2, x) + Integral(sin(c + d*x)* *2*tan(c + d*x)**2, x) + Integral(tan(c + d*x)**2, x))
Time = 0.11 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.18 \[ \int (a+a \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {{\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^{2} + 2 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{2} - 4 \, a^{2} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{2 \, d} \] Input:
integrate((a+a*sin(d*x+c))^2*tan(d*x+c)^2,x, algorithm="maxima")
Output:
-1/2*((3*d*x + 3*c - tan(d*x + c)/(tan(d*x + c)^2 + 1) - 2*tan(d*x + c))*a ^2 + 2*(d*x + c - tan(d*x + c))*a^2 - 4*a^2*(1/cos(d*x + c) + cos(d*x + c) ))/d
Leaf count of result is larger than twice the leaf count of optimal. 5370 vs. \(2 (65) = 130\).
Time = 5.52 (sec) , antiderivative size = 5370, normalized size of antiderivative = 75.63 \[ \int (a+a \sin (c+d x))^2 \tan ^2(c+d x) \, dx=\text {Too large to display} \] Input:
integrate((a+a*sin(d*x+c))^2*tan(d*x+c)^2,x, algorithm="giac")
Output:
-1/2*(5*a^2*d*x*tan(d*x)^3*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^3 + 5*a^2*d* x*tan(d*x)^3*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c) - 5*a^2*d*x*tan(d*x)^2*tan (1/2*d*x)^4*tan(1/2*c)^4*tan(c)^2 - 20*a^2*d*x*tan(d*x)^3*tan(1/2*d*x)^3*t an(1/2*c)^3*tan(c)^3 + 5*a^2*d*x*tan(d*x)*tan(1/2*d*x)^4*tan(1/2*c)^4*tan( c)^3 - 8*a^2*tan(d*x)^3*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^3 + 5*a^2*tan(d *x)^3*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^2 + 5*a^2*tan(d*x)^2*tan(1/2*d*x) ^4*tan(1/2*c)^4*tan(c)^3 - 5*a^2*d*x*tan(d*x)^2*tan(1/2*d*x)^4*tan(1/2*c)^ 4 - 20*a^2*d*x*tan(d*x)^3*tan(1/2*d*x)^3*tan(1/2*c)^3*tan(c) + 5*a^2*d*x*t an(d*x)*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c) - 8*a^2*tan(d*x)^3*tan(1/2*d*x) ^4*tan(1/2*c)^4*tan(c) + 20*a^2*d*x*tan(d*x)^2*tan(1/2*d*x)^3*tan(1/2*c)^3 *tan(c)^2 - 5*a^2*d*x*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^2 + 8*a^2*tan(d*x )^2*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^2 - 5*a^2*d*x*tan(d*x)^3*tan(1/2*d* x)^4*tan(c)^3 - 20*a^2*d*x*tan(d*x)^3*tan(1/2*d*x)^3*tan(1/2*c)*tan(c)^3 - 20*a^2*d*x*tan(d*x)^3*tan(1/2*d*x)*tan(1/2*c)^3*tan(c)^3 - 20*a^2*d*x*tan (d*x)*tan(1/2*d*x)^3*tan(1/2*c)^3*tan(c)^3 + 32*a^2*tan(d*x)^3*tan(1/2*d*x )^3*tan(1/2*c)^3*tan(c)^3 - 5*a^2*d*x*tan(d*x)^3*tan(1/2*c)^4*tan(c)^3 - 8 *a^2*tan(d*x)*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^3 + 4*a^2*tan(d*x)^3*tan( 1/2*d*x)^4*tan(1/2*c)^4 + 2*a^2*tan(d*x)^2*tan(1/2*d*x)^4*tan(1/2*c)^4*tan (c) - 20*a^2*tan(d*x)^3*tan(1/2*d*x)^3*tan(1/2*c)^3*tan(c)^2 + 2*a^2*tan(d *x)*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^2 - 20*a^2*tan(d*x)^2*tan(1/2*d*...
Time = 33.59 (sec) , antiderivative size = 213, normalized size of antiderivative = 3.00 \[ \int (a+a \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {5\,a^2\,x}{2}-\frac {\frac {5\,a^2\,\left (c+d\,x\right )}{2}-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {5\,a^2\,\left (c+d\,x\right )}{2}-\frac {a^2\,\left (5\,c+5\,d\,x-6\right )}{2}\right )-\frac {a^2\,\left (5\,c+5\,d\,x-16\right )}{2}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {5\,a^2\,\left (c+d\,x\right )}{2}-\frac {a^2\,\left (5\,c+5\,d\,x-10\right )}{2}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (5\,a^2\,\left (c+d\,x\right )-\frac {a^2\,\left (10\,c+10\,d\,x-10\right )}{2}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (5\,a^2\,\left (c+d\,x\right )-\frac {a^2\,\left (10\,c+10\,d\,x-22\right )}{2}\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 )}^2} \] Input:
int(tan(c + d*x)^2*(a + a*sin(c + d*x))^2,x)
Output:
- (5*a^2*x)/2 - ((5*a^2*(c + d*x))/2 - tan(c/2 + (d*x)/2)*((5*a^2*(c + d*x ))/2 - (a^2*(5*c + 5*d*x - 6))/2) - (a^2*(5*c + 5*d*x - 16))/2 + tan(c/2 + (d*x)/2)^4*((5*a^2*(c + d*x))/2 - (a^2*(5*c + 5*d*x - 10))/2) - tan(c/2 + (d*x)/2)^3*(5*a^2*(c + d*x) - (a^2*(10*c + 10*d*x - 10))/2) + tan(c/2 + ( d*x)/2)^2*(5*a^2*(c + d*x) - (a^2*(10*c + 10*d*x - 22))/2))/(d*(tan(c/2 + (d*x)/2) - 1)*(tan(c/2 + (d*x)/2)^2 + 1)^2)
Time = 0.17 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.23 \[ \int (a+a \sin (c+d x))^2 \tan ^2(c+d x) \, dx=\frac {a^{2} \left (2 \cos \left (d x +c \right ) \tan \left (d x +c \right )-3 \cos \left (d x +c \right ) c -5 \cos \left (d x +c \right ) d x -8 \cos \left (d x +c \right )-\sin \left (d x +c \right )^{3}-4 \sin \left (d x +c \right )^{2}+3 \sin \left (d x +c \right )+8\right )}{2 \cos \left (d x +c \right ) d} \] Input:
int((a+a*sin(d*x+c))^2*tan(d*x+c)^2,x)
Output:
(a**2*(2*cos(c + d*x)*tan(c + d*x) - 3*cos(c + d*x)*c - 5*cos(c + d*x)*d*x - 8*cos(c + d*x) - sin(c + d*x)**3 - 4*sin(c + d*x)**2 + 3*sin(c + d*x) + 8))/(2*cos(c + d*x)*d)