Integrand size = 21, antiderivative size = 89 \[ \int (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-a^2 x-\frac {3 b^2 x}{2}+\frac {2 a b \cos (c+d x)}{d}+\frac {2 a b \sec (c+d x)}{d}+\frac {b^2 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a^2 \tan (c+d x)}{d}+\frac {b^2 \tan (c+d x)}{d} \] Output:
-a^2*x-3/2*b^2*x+2*a*b*cos(d*x+c)/d+2*a*b*sec(d*x+c)/d+1/2*b^2*cos(d*x+c)* sin(d*x+c)/d+a^2*tan(d*x+c)/d+b^2*tan(d*x+c)/d
Time = 0.37 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.87 \[ \int (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=\frac {-4 \left (2 a^2+3 b^2\right ) (c+d x)+b \sec (c+d x) (24 a+8 a \cos (2 (c+d x))+b \sin (3 (c+d x)))+\left (8 a^2+9 b^2\right ) \tan (c+d x)}{8 d} \] Input:
Integrate[(a + b*Sin[c + d*x])^2*Tan[c + d*x]^2,x]
Output:
(-4*(2*a^2 + 3*b^2)*(c + d*x) + b*Sec[c + d*x]*(24*a + 8*a*Cos[2*(c + d*x) ] + b*Sin[3*(c + d*x)]) + (8*a^2 + 9*b^2)*Tan[c + d*x])/(8*d)
Time = 0.34 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.06, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 3201, 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+b \sin (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x)^2 (a+b \sin (c+d x))^2dx\) |
\(\Big \downarrow \) 3201 |
\(\displaystyle \int \left (a^2 \tan ^2(c+d x)+2 a b \sin (c+d x) \tan ^2(c+d x)+b^2 \sin ^2(c+d x) \tan ^2(c+d x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a^2 \tan (c+d x)}{d}+a^2 (-x)+\frac {2 a b \cos (c+d x)}{d}+\frac {2 a b \sec (c+d x)}{d}+\frac {3 b^2 \tan (c+d x)}{2 d}-\frac {b^2 \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac {3 b^2 x}{2}\) |
Input:
Int[(a + b*Sin[c + d*x])^2*Tan[c + d*x]^2,x]
Output:
-(a^2*x) - (3*b^2*x)/2 + (2*a*b*Cos[c + d*x])/d + (2*a*b*Sec[c + d*x])/d + (a^2*Tan[c + d*x])/d + (3*b^2*Tan[c + d*x])/(2*d) - (b^2*Sin[c + d*x]^2*T an[c + d*x])/(2*d)
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((g_.)*tan[(e_.) + (f_.)*( x_)])^(p_.), x_Symbol] :> Int[ExpandIntegrand[(g*Tan[e + f*x])^p, (a + b*Si n[e + f*x])^m, x], x] /; FreeQ[{a, b, e, f, g, p}, x] && NeQ[a^2 - b^2, 0] && IGtQ[m, 0]
Time = 2.20 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.30
method | result | size |
derivativedivides | \(\frac {a^{2} \left (\tan \left (d x +c \right )-d x -c \right )+2 a b \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 )+b^{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}\) | \(116\) |
default | \(\frac {a^{2} \left (\tan \left (d x +c \right )-d x -c \right )+2 a b \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 )+b^{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}\) | \(116\) |
parts | \(\frac {a^{2} \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {b^{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 b \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}\) | \(123\) |
risch | \(-a^{2} x -\frac {3 b^{2} x}{2}-\frac {i {\mathrm e}^{2 i \left (d x +c \right )} b^{2}}{8 d}+\frac {a b \,{\mathrm e}^{i \left (d x +c \right )}}{d}+\frac {a b \,{\mathrm e}^{-i \left (d x +c \right )}}{d}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} b^{2}}{8 d}+\frac {2 i a^{2}+2 i b^{2}+4 a b \,{\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}\) | \(124\) |
Input:
int((a+b*sin(d*x+c))^2*tan(d*x+c)^2,x,method=_RETURNVERBOSE)
Output:
1/d*(a^2*(tan(d*x+c)-d*x-c)+2*a*b*(sin(d*x+c)^4/cos(d*x+c)+(2+sin(d*x+c)^2 )*cos(d*x+c))+b^2*(sin(d*x+c)^5/cos(d*x+c)+(sin(d*x+c)^3+3/2*sin(d*x+c))*c os(d*x+c)-3/2*d*x-3/2*c))
Time = 0.10 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.91 \[ \int (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {{\left (2 \, a^{2} + 3 \, b^{2}\right )} d x \cos \left (d x + c\right ) - 4 \, a b \cos \left (d x + c\right )^{2} - 4 \, a b - {\left (b^{2} \cos \left (d x + c\right )^{2} + 2 \, a^{2} + 2 \, b^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \] Input:
integrate((a+b*sin(d*x+c))^2*tan(d*x+c)^2,x, algorithm="fricas")
Output:
-1/2*((2*a^2 + 3*b^2)*d*x*cos(d*x + c) - 4*a*b*cos(d*x + c)^2 - 4*a*b - (b ^2*cos(d*x + c)^2 + 2*a^2 + 2*b^2)*sin(d*x + c))/(d*cos(d*x + c))
\[ \int (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \tan ^{2}{\left (c + d x \right )}\, dx \] Input:
integrate((a+b*sin(d*x+c))**2*tan(d*x+c)**2,x)
Output:
Integral((a + b*sin(c + d*x))**2*tan(c + d*x)**2, x)
Time = 0.11 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.93 \[ \int (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {2 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{2} + {\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 )} b^{2} - 4 \, a b {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{2 \, d} \] Input:
integrate((a+b*sin(d*x+c))^2*tan(d*x+c)^2,x, algorithm="maxima")
Output:
-1/2*(2*(d*x + c - tan(d*x + c))*a^2 + (3*d*x + 3*c - tan(d*x + c)/(tan(d* x + c)^2 + 1) - 2*tan(d*x + c))*b^2 - 4*a*b*(1/cos(d*x + c) + cos(d*x + c) ))/d
Leaf count of result is larger than twice the leaf count of optimal. 7670 vs. \(2 (85) = 170\).
Time = 4.81 (sec) , antiderivative size = 7670, normalized size of antiderivative = 86.18 \[ \int (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=\text {Too large to display} \] Input:
integrate((a+b*sin(d*x+c))^2*tan(d*x+c)^2,x, algorithm="giac")
Output:
-1/2*(2*a^2*d*x*tan(d*x)^3*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^3 + 3*b^2*d* x*tan(d*x)^3*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^3 + 2*a^2*d*x*tan(d*x)^3*t an(1/2*d*x)^4*tan(1/2*c)^4*tan(c) + 3*b^2*d*x*tan(d*x)^3*tan(1/2*d*x)^4*ta n(1/2*c)^4*tan(c) - 2*a^2*d*x*tan(d*x)^2*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c )^2 - 3*b^2*d*x*tan(d*x)^2*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^2 - 8*a^2*d* x*tan(d*x)^3*tan(1/2*d*x)^3*tan(1/2*c)^3*tan(c)^3 - 12*b^2*d*x*tan(d*x)^3* tan(1/2*d*x)^3*tan(1/2*c)^3*tan(c)^3 + 2*a^2*d*x*tan(d*x)*tan(1/2*d*x)^4*t an(1/2*c)^4*tan(c)^3 + 3*b^2*d*x*tan(d*x)*tan(1/2*d*x)^4*tan(1/2*c)^4*tan( c)^3 - 8*a*b*tan(d*x)^3*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^3 + 2*a^2*tan(d *x)^3*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^2 + 3*b^2*tan(d*x)^3*tan(1/2*d*x) ^4*tan(1/2*c)^4*tan(c)^2 + 2*a^2*tan(d*x)^2*tan(1/2*d*x)^4*tan(1/2*c)^4*ta n(c)^3 + 3*b^2*tan(d*x)^2*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c)^3 - 2*a^2*d*x *tan(d*x)^2*tan(1/2*d*x)^4*tan(1/2*c)^4 - 3*b^2*d*x*tan(d*x)^2*tan(1/2*d*x )^4*tan(1/2*c)^4 - 8*a^2*d*x*tan(d*x)^3*tan(1/2*d*x)^3*tan(1/2*c)^3*tan(c) - 12*b^2*d*x*tan(d*x)^3*tan(1/2*d*x)^3*tan(1/2*c)^3*tan(c) + 2*a^2*d*x*ta n(d*x)*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c) + 3*b^2*d*x*tan(d*x)*tan(1/2*d*x )^4*tan(1/2*c)^4*tan(c) - 8*a*b*tan(d*x)^3*tan(1/2*d*x)^4*tan(1/2*c)^4*tan (c) + 8*a^2*d*x*tan(d*x)^2*tan(1/2*d*x)^3*tan(1/2*c)^3*tan(c)^2 + 12*b^2*d *x*tan(d*x)^2*tan(1/2*d*x)^3*tan(1/2*c)^3*tan(c)^2 - 2*a^2*d*x*tan(1/2*d*x )^4*tan(1/2*c)^4*tan(c)^2 - 3*b^2*d*x*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c...
Time = 21.01 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.65 \[ \int (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=\frac {\left (2\,a^2+3\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (4\,a^2+2\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\left (2\,a^2+3\,b^2\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+8\,a\,b}{d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {x\,\left (2\,a^2+3\,b^2\right )}{2} \] Input:
int(tan(c + d*x)^2*(a + b*sin(c + d*x))^2,x)
Output:
(8*a*b + tan(c/2 + (d*x)/2)^3*(4*a^2 + 2*b^2) + tan(c/2 + (d*x)/2)^5*(2*a^ 2 + 3*b^2) + tan(c/2 + (d*x)/2)*(2*a^2 + 3*b^2) + 8*a*b*tan(c/2 + (d*x)/2) ^2)/(d*(tan(c/2 + (d*x)/2)^2 - tan(c/2 + (d*x)/2)^4 - tan(c/2 + (d*x)/2)^6 + 1)) - (x*(2*a^2 + 3*b^2))/2
Time = 0.20 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.34 \[ \int (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx=\frac {2 \cos \left (d x +c \right ) \tan \left (d x +c \right ) a^{2}-2 \cos \left (d x +c \right ) a^{2} d x -8 \cos \left (d x +c \right ) a b -3 \cos \left (d x +c \right ) b^{2} c -3 \cos \left (d x +c \right ) b^{2} d x -\sin \left (d x +c \right )^{3} b^{2}-4 \sin \left (d x +c \right )^{2} a b +3 \sin \left (d x +c \right ) b^{2}+8 a b}{2 \cos \left (d x +c \right ) d} \] Input:
int((a+b*sin(d*x+c))^2*tan(d*x+c)^2,x)
Output:
(2*cos(c + d*x)*tan(c + d*x)*a**2 - 2*cos(c + d*x)*a**2*d*x - 8*cos(c + d* x)*a*b - 3*cos(c + d*x)*b**2*c - 3*cos(c + d*x)*b**2*d*x - sin(c + d*x)**3 *b**2 - 4*sin(c + d*x)**2*a*b + 3*sin(c + d*x)*b**2 + 8*a*b)/(2*cos(c + d* x)*d)