\(\int (a+b \sin (c+d x))^2 \tan ^4(c+d x) \, dx\) [155]

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

Optimal result

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

a^2*x+5/2*b^2*x-2*a*b*cos(d*x+c)/d-4*a*b*sec(d*x+c)/d+2/3*a*b*sec(d*x+c)^3 
/d-1/2*b^2*cos(d*x+c)*sin(d*x+c)/d-a^2*tan(d*x+c)/d-2*b^2*tan(d*x+c)/d+1/3 
*a^2*tan(d*x+c)^3/d+1/3*b^2*tan(d*x+c)^3/d
 

Mathematica [A] (verified)

Time = 0.90 (sec) , antiderivative size = 176, normalized size of antiderivative = 1.23 \[ \int (a+b \sin (c+d x))^2 \tan ^4(c+d x) \, dx=-\frac {\sec ^3(c+d x) \left (200 a b-36 \left (2 a^2+5 b^2\right ) (c+d x) \cos (c+d x)+288 a b \cos (2 (c+d x))-24 a^2 c \cos (3 (c+d x))-60 b^2 c \cos (3 (c+d x))-24 a^2 d x \cos (3 (c+d x))-60 b^2 d x \cos (3 (c+d x))+24 a b \cos (4 (c+d x))+30 b^2 \sin (c+d x)+32 a^2 \sin (3 (c+d x))+65 b^2 \sin (3 (c+d x))+3 b^2 \sin (5 (c+d x))\right )}{96 d} \] Input:

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

Output:

-1/96*(Sec[c + d*x]^3*(200*a*b - 36*(2*a^2 + 5*b^2)*(c + d*x)*Cos[c + d*x] 
 + 288*a*b*Cos[2*(c + d*x)] - 24*a^2*c*Cos[3*(c + d*x)] - 60*b^2*c*Cos[3*( 
c + d*x)] - 24*a^2*d*x*Cos[3*(c + d*x)] - 60*b^2*d*x*Cos[3*(c + d*x)] + 24 
*a*b*Cos[4*(c + d*x)] + 30*b^2*Sin[c + d*x] + 32*a^2*Sin[3*(c + d*x)] + 65 
*b^2*Sin[3*(c + d*x)] + 3*b^2*Sin[5*(c + d*x)]))/d
 

Rubi [A] (verified)

Time = 0.40 (sec) , antiderivative size = 149, 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, 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 ^4(c+d x) (a+b \sin (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \tan (c+d x)^4 (a+b \sin (c+d x))^2dx\)

\(\Big \downarrow \) 3201

\(\displaystyle \int \left (a^2 \tan ^4(c+d x)+2 a b \sin (c+d x) \tan ^4(c+d x)+b^2 \sin ^2(c+d x) \tan ^4(c+d x)\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a^2 \tan ^3(c+d x)}{3 d}-\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 ^3(c+d x)}{3 d}-\frac {4 a b \sec (c+d x)}{d}+\frac {5 b^2 \tan ^3(c+d x)}{6 d}-\frac {5 b^2 \tan (c+d x)}{2 d}-\frac {b^2 \sin ^2(c+d x) \tan ^3(c+d x)}{2 d}+\frac {5 b^2 x}{2}\)

Input:

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

Output:

a^2*x + (5*b^2*x)/2 - (2*a*b*Cos[c + d*x])/d - (4*a*b*Sec[c + d*x])/d + (2 
*a*b*Sec[c + d*x]^3)/(3*d) - (a^2*Tan[c + d*x])/d - (5*b^2*Tan[c + d*x])/( 
2*d) + (a^2*Tan[c + d*x]^3)/(3*d) + (5*b^2*Tan[c + d*x]^3)/(6*d) - (b^2*Si 
n[c + d*x]^2*Tan[c + d*x]^3)/(2*d)
 

Defintions of rubi rules used

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 3201
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]
 
Maple [A] (verified)

Time = 2.82 (sec) , antiderivative size = 185, normalized size of antiderivative = 1.29

method result size
derivativedivides \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+d x +c \right )+2 a b \left (\frac {\sin \left (d x +c \right )^{6}}{3 \cos \left (d x +c \right )^{3}}-\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 )+b^{2} \left (\frac {\sin \left (d x +c \right )^{7}}{3 \cos \left (d x +c \right )^{3}}-\frac {4 \sin \left (d x +c \right )^{7}}{3 \cos \left (d x +c \right )}-\frac {4 \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 )}{3}+\frac {5 d x}{2}+\frac {5 c}{2}\right )}{d}\) \(185\)
default \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+d x +c \right )+2 a b \left (\frac {\sin \left (d x +c \right )^{6}}{3 \cos \left (d x +c \right )^{3}}-\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 )+b^{2} \left (\frac {\sin \left (d x +c \right )^{7}}{3 \cos \left (d x +c \right )^{3}}-\frac {4 \sin \left (d x +c \right )^{7}}{3 \cos \left (d x +c \right )}-\frac {4 \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 )}{3}+\frac {5 d x}{2}+\frac {5 c}{2}\right )}{d}\) \(185\)
parts \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\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 )^{7}}{3 \cos \left (d x +c \right )^{3}}-\frac {4 \sin \left (d x +c \right )^{7}}{3 \cos \left (d x +c \right )}-\frac {4 \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 )}{3}+\frac {5 d x}{2}+\frac {5 c}{2}\right )}{d}+\frac {2 a b \left (\frac {\sin \left (d x +c \right )^{6}}{3 \cos \left (d x +c \right )^{3}}-\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}\) \(193\)
risch \(a^{2} x +\frac {5 b^{2} x}{2}+\frac {i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{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 b^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-\frac {2 \left (6 i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+9 i b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+12 a b \,{\mathrm e}^{5 i \left (d x +c \right )}+6 i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+12 i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+16 a b \,{\mathrm e}^{3 i \left (d x +c \right )}+4 i a^{2}+7 i b^{2}+12 a b \,{\mathrm e}^{i \left (d x +c \right )}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}\) \(211\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.83 \[ \int (a+b \sin (c+d x))^2 \tan ^4(c+d x) \, dx=\frac {3 \, {\left (2 \, a^{2} + 5 \, b^{2}\right )} d x \cos \left (d x + c\right )^{3} - 12 \, a b \cos \left (d x + c\right )^{4} - 24 \, a b \cos \left (d x + c\right )^{2} + 4 \, a b - {\left (3 \, b^{2} \cos \left (d x + c\right )^{4} + 2 \, {\left (4 \, a^{2} + 7 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right )}{6 \, d \cos \left (d x + c\right )^{3}} \] Input:

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

Output:

1/6*(3*(2*a^2 + 5*b^2)*d*x*cos(d*x + c)^3 - 12*a*b*cos(d*x + c)^4 - 24*a*b 
*cos(d*x + c)^2 + 4*a*b - (3*b^2*cos(d*x + c)^4 + 2*(4*a^2 + 7*b^2)*cos(d* 
x + c)^2 - 2*a^2 - 2*b^2)*sin(d*x + c))/(d*cos(d*x + c)^3)
 

Sympy [F]

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

integrate((a+b*sin(d*x+c))**2*tan(d*x+c)**4,x)
 

Output:

Integral((a + b*sin(c + d*x))**2*tan(c + d*x)**4, x)
 

Maxima [A] (verification not implemented)

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

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

Output:

1/6*(2*(tan(d*x + c)^3 + 3*d*x + 3*c - 3*tan(d*x + c))*a^2 + (2*tan(d*x + 
c)^3 + 15*d*x + 15*c - 3*tan(d*x + c)/(tan(d*x + c)^2 + 1) - 12*tan(d*x + 
c))*b^2 - 4*a*b*((6*cos(d*x + c)^2 - 1)/cos(d*x + c)^3 + 3*cos(d*x + c)))/ 
d
 

Giac [F(-1)]

Timed out. \[ \int (a+b \sin (c+d x))^2 \tan ^4(c+d x) \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
 

Mupad [B] (verification not implemented)

Time = 19.58 (sec) , antiderivative size = 235, normalized size of antiderivative = 1.64 \[ \int (a+b \sin (c+d x))^2 \tan ^4(c+d x) \, dx=\frac {x\,\left (2\,a^2+5\,b^2\right )}{2}-\frac {\left (-2\,a^2-5\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {8\,a^2}{3}+\frac {20\,b^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {28\,a^2}{3}+\frac {22\,b^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\frac {64\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{3}+\left (\frac {8\,a^2}{3}+\frac {20\,b^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\frac {32\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+\left (-2\,a^2-5\,b^2\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {32\,a\,b}{3}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,{\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 )} \] Input:

int(tan(c + d*x)^4*(a + b*sin(c + d*x))^2,x)
 

Output:

(x*(2*a^2 + 5*b^2))/2 - (tan(c/2 + (d*x)/2)^3*((8*a^2)/3 + (20*b^2)/3) - t 
an(c/2 + (d*x)/2)^9*(2*a^2 + 5*b^2) - (32*a*b)/3 + tan(c/2 + (d*x)/2)^7*(( 
8*a^2)/3 + (20*b^2)/3) + tan(c/2 + (d*x)/2)^5*((28*a^2)/3 + (22*b^2)/3) - 
tan(c/2 + (d*x)/2)*(2*a^2 + 5*b^2) + (32*a*b*tan(c/2 + (d*x)/2)^2)/3 + (64 
*a*b*tan(c/2 + (d*x)/2)^4)/3)/(d*(tan(c/2 + (d*x)/2)^2 + 2*tan(c/2 + (d*x) 
/2)^4 - 2*tan(c/2 + (d*x)/2)^6 - tan(c/2 + (d*x)/2)^8 + tan(c/2 + (d*x)/2) 
^10 - 1))
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 307, normalized size of antiderivative = 2.15 \[ \int (a+b \sin (c+d x))^2 \tan ^4(c+d x) \, dx=\frac {2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} \tan \left (d x +c \right )^{3} a^{2}-6 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} \tan \left (d x +c \right ) a^{2}+6 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a^{2} d x +32 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a b +15 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} b^{2} c +15 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} b^{2} d x -2 \cos \left (d x +c \right ) \tan \left (d x +c \right )^{3} a^{2}+6 \cos \left (d x +c \right ) \tan \left (d x +c \right ) a^{2}-6 \cos \left (d x +c \right ) a^{2} d x -32 \cos \left (d x +c \right ) a b -15 \cos \left (d x +c \right ) b^{2} c -15 \cos \left (d x +c \right ) b^{2} d x +3 \sin \left (d x +c \right )^{5} b^{2}+12 \sin \left (d x +c \right )^{4} a b -20 \sin \left (d x +c \right )^{3} b^{2}-48 \sin \left (d x +c \right )^{2} a b +15 \sin \left (d x +c \right ) b^{2}+32 a b}{6 \cos \left (d x +c \right ) d \left (\sin \left (d x +c \right )^{2}-1\right )} \] Input:

int((a+b*sin(d*x+c))^2*tan(d*x+c)^4,x)
 

Output:

(2*cos(c + d*x)*sin(c + d*x)**2*tan(c + d*x)**3*a**2 - 6*cos(c + d*x)*sin( 
c + d*x)**2*tan(c + d*x)*a**2 + 6*cos(c + d*x)*sin(c + d*x)**2*a**2*d*x + 
32*cos(c + d*x)*sin(c + d*x)**2*a*b + 15*cos(c + d*x)*sin(c + d*x)**2*b**2 
*c + 15*cos(c + d*x)*sin(c + d*x)**2*b**2*d*x - 2*cos(c + d*x)*tan(c + d*x 
)**3*a**2 + 6*cos(c + d*x)*tan(c + d*x)*a**2 - 6*cos(c + d*x)*a**2*d*x - 3 
2*cos(c + d*x)*a*b - 15*cos(c + d*x)*b**2*c - 15*cos(c + d*x)*b**2*d*x + 3 
*sin(c + d*x)**5*b**2 + 12*sin(c + d*x)**4*a*b - 20*sin(c + d*x)**3*b**2 - 
 48*sin(c + d*x)**2*a*b + 15*sin(c + d*x)*b**2 + 32*a*b)/(6*cos(c + d*x)*d 
*(sin(c + d*x)**2 - 1))