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

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

Optimal result

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

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(383\) vs. \(2(180)=360\).

Time = 4.05 (sec) , antiderivative size = 383, normalized size of antiderivative = 2.13 \[ \int \sin (c+d x) (a+b \tan (c+d x))^4 \, dx=\frac {72 a^2 b^2-22 b^4-12 \left (a^4-6 a^2 b^2+b^4\right ) \cos (c+d x)-24 a b \left (2 a^2-3 b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+24 a b \left (2 a^2-3 b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {b^3 (12 a+b)}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {2 b^4 \sin \left (\frac {1}{2} (c+d x)\right )}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^3}+\frac {2 b^2 \left (36 a^2-11 b^2\right ) \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 )}-\frac {2 b^4 \sin \left (\frac {1}{2} (c+d x)\right )}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^3}+\frac {b^3 (-12 a+b)}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {2 b^2 \left (-36 a^2+11 b^2\right ) \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 )}-48 a b \left (a^2-b^2\right ) \sin (c+d x)}{12 d} \] Input:

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

Output:

(72*a^2*b^2 - 22*b^4 - 12*(a^4 - 6*a^2*b^2 + b^4)*Cos[c + d*x] - 24*a*b*(2 
*a^2 - 3*b^2)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 24*a*b*(2*a^2 - 3 
*b^2)*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + (b^3*(12*a + b))/(Cos[(c 
+ d*x)/2] - Sin[(c + d*x)/2])^2 + (2*b^4*Sin[(c + d*x)/2])/(Cos[(c + d*x)/ 
2] - Sin[(c + d*x)/2])^3 + (2*b^2*(36*a^2 - 11*b^2)*Sin[(c + d*x)/2])/(Cos 
[(c + d*x)/2] - Sin[(c + d*x)/2]) - (2*b^4*Sin[(c + d*x)/2])/(Cos[(c + d*x 
)/2] + Sin[(c + d*x)/2])^3 + (b^3*(-12*a + b))/(Cos[(c + d*x)/2] + Sin[(c 
+ d*x)/2])^2 + (2*b^2*(-36*a^2 + 11*b^2)*Sin[(c + d*x)/2])/(Cos[(c + d*x)/ 
2] + Sin[(c + d*x)/2]) - 48*a*b*(a^2 - b^2)*Sin[c + d*x])/(12*d)
 

Rubi [A] (verified)

Time = 0.41 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3042, 4000, 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 \sin (c+d x) (a+b \tan (c+d x))^4 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4000

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

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {a^4 \cos (c+d x)}{d}+\frac {4 a^3 b \text {arctanh}(\sin (c+d x))}{d}-\frac {4 a^3 b \sin (c+d x)}{d}+\frac {6 a^2 b^2 \cos (c+d x)}{d}+\frac {6 a^2 b^2 \sec (c+d x)}{d}-\frac {6 a b^3 \text {arctanh}(\sin (c+d x))}{d}+\frac {6 a b^3 \sin (c+d x)}{d}+\frac {2 a b^3 \sin (c+d x) \tan ^2(c+d x)}{d}-\frac {b^4 \cos (c+d x)}{d}+\frac {b^4 \sec ^3(c+d x)}{3 d}-\frac {2 b^4 \sec (c+d x)}{d}\)

Input:

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

Output:

(4*a^3*b*ArcTanh[Sin[c + d*x]])/d - (6*a*b^3*ArcTanh[Sin[c + d*x]])/d - (a 
^4*Cos[c + d*x])/d + (6*a^2*b^2*Cos[c + d*x])/d - (b^4*Cos[c + d*x])/d + ( 
6*a^2*b^2*Sec[c + d*x])/d - (2*b^4*Sec[c + d*x])/d + (b^4*Sec[c + d*x]^3)/ 
(3*d) - (4*a^3*b*Sin[c + d*x])/d + (6*a*b^3*Sin[c + d*x])/d + (2*a*b^3*Sin 
[c + d*x]*Tan[c + d*x]^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 4000
Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n 
_.), x_Symbol] :> Int[Expand[Sin[e + f*x]^m*(a + b*Tan[e + f*x])^n, x], x] 
/; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IGtQ[n, 0]
 
Maple [A] (verified)

Time = 4.22 (sec) , antiderivative size = 217, normalized size of antiderivative = 1.21

method result size
derivativedivides \(\frac {-a^{4} \cos \left (d x +c \right )+4 a^{3} b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+6 b^{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 )+4 a \,b^{3} \left (\frac {\sin \left (d x +c \right )^{5}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{3}}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+b^{4} \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}\) \(217\)
default \(\frac {-a^{4} \cos \left (d x +c \right )+4 a^{3} b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+6 b^{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 )+4 a \,b^{3} \left (\frac {\sin \left (d x +c \right )^{5}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{3}}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+b^{4} \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}\) \(217\)
risch \(\frac {2 i {\mathrm e}^{i \left (d x +c \right )} a^{3} b}{d}-\frac {2 i {\mathrm e}^{i \left (d x +c \right )} a \,b^{3}}{d}-\frac {{\mathrm e}^{i \left (d x +c \right )} a^{4}}{2 d}+\frac {3 \,{\mathrm e}^{i \left (d x +c \right )} b^{2} a^{2}}{d}-\frac {{\mathrm e}^{i \left (d x +c \right )} b^{4}}{2 d}-\frac {2 i {\mathrm e}^{-i \left (d x +c \right )} a^{3} b}{d}+\frac {2 i {\mathrm e}^{-i \left (d x +c \right )} a \,b^{3}}{d}-\frac {{\mathrm e}^{-i \left (d x +c \right )} a^{4}}{2 d}+\frac {3 \,{\mathrm e}^{-i \left (d x +c \right )} b^{2} a^{2}}{d}-\frac {{\mathrm e}^{-i \left (d x +c \right )} b^{4}}{2 d}-\frac {4 b^{2} {\mathrm e}^{i \left (d x +c \right )} \left (-9 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+3 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-18 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+4 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-9 a^{2}+3 b^{2}-3 i a b \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {4 a^{3} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {6 a \,b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {4 a^{3} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {6 a \,b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) \(412\)

Input:

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

Output:

1/d*(-a^4*cos(d*x+c)+4*a^3*b*(-sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c)))+6*b^2 
*a^2*(sin(d*x+c)^4/cos(d*x+c)+(2+sin(d*x+c)^2)*cos(d*x+c))+4*a*b^3*(1/2*si 
n(d*x+c)^5/cos(d*x+c)^2+1/2*sin(d*x+c)^3+3/2*sin(d*x+c)-3/2*ln(sec(d*x+c)+ 
tan(d*x+c)))+b^4*(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)))
 

Fricas [A] (verification not implemented)

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

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

Output:

-1/3*(3*(a^4 - 6*a^2*b^2 + b^4)*cos(d*x + c)^4 - 3*(2*a^3*b - 3*a*b^3)*cos 
(d*x + c)^3*log(sin(d*x + c) + 1) + 3*(2*a^3*b - 3*a*b^3)*cos(d*x + c)^3*l 
og(-sin(d*x + c) + 1) - b^4 - 6*(3*a^2*b^2 - b^4)*cos(d*x + c)^2 - 6*(a*b^ 
3*cos(d*x + c) - 2*(a^3*b - a*b^3)*cos(d*x + c)^3)*sin(d*x + c))/(d*cos(d* 
x + c)^3)
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 166, normalized size of antiderivative = 0.92 \[ \int \sin (c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {3 \, a b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\sin \left (d x + c\right ) - 1\right ) - 4 \, \sin \left (d x + c\right )\right )} - 18 \, a^{2} b^{2} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} + b^{4} {\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 \, a^{3} b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} + 3 \, a^{4} \cos \left (d x + c\right )}{3 \, d} \] Input:

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

Output:

-1/3*(3*a*b^3*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) + 3*log(sin(d*x + c) + 
1) - 3*log(sin(d*x + c) - 1) - 4*sin(d*x + c)) - 18*a^2*b^2*(1/cos(d*x + c 
) + cos(d*x + c)) + b^4*((6*cos(d*x + c)^2 - 1)/cos(d*x + c)^3 + 3*cos(d*x 
 + c)) - 6*a^3*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1) - 2*sin(d* 
x + c)) + 3*a^4*cos(d*x + c))/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 19074 vs. \(2 (178) = 356\).

Time = 8.11 (sec) , antiderivative size = 19074, normalized size of antiderivative = 105.97 \[ \int \sin (c+d x) (a+b \tan (c+d x))^4 \, dx=\text {Too large to display} \] Input:

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

Output:

-1/3*(6*a^3*b*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1/ 
2*c) + 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan 
(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^ 
2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)^8*tan(1/2*c)^8 - 9*a*b^3*log(2*(tan(1/ 
2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1/2*c) + 2*tan(1/2*d*x)*tan(1 
/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 
1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1))*tan( 
1/2*d*x)^8*tan(1/2*c)^8 - 6*a^3*b*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*t 
an(1/2*d*x)^2*tan(1/2*c) - 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + 
tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2* 
c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)^8*tan(1/2*c)^8 + 9 
*a*b^3*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^2*tan(1/2*c) - 
2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d* 
x) + 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan 
(1/2*c)^2 + 1))*tan(1/2*d*x)^8*tan(1/2*c)^8 + 3*a^4*tan(1/2*d*x)^8*tan(1/2 
*c)^8 - 36*a^2*b^2*tan(1/2*d*x)^8*tan(1/2*c)^8 + 8*b^4*tan(1/2*d*x)^8*tan( 
1/2*c)^8 - 12*a^3*b*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2* 
tan(1/2*c) + 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 - 
 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2 
*d*x)^2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)^8*tan(1/2*c)^6 + 18*a*b^3*log...
 

Mupad [B] (verification not implemented)

Time = 4.45 (sec) , antiderivative size = 268, normalized size of antiderivative = 1.49 \[ \int \sin (c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (6\,a^4-48\,a^2\,b^2+\frac {32\,b^4}{3}\right )+2\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (12\,a\,b^3-8\,a^3\,b\right )-2\,a^4-\frac {16\,b^4}{3}+24\,a^2\,b^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (6\,a^4-24\,a^2\,b^2\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (12\,a\,b^3-8\,a^3\,b\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (20\,a\,b^3-24\,a^3\,b\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (20\,a\,b^3-24\,a^3\,b\right )}{d\,\left ({\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 )}^2-1\right )}-\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (12\,a\,b^3-8\,a^3\,b\right )}{d} \] Input:

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

Output:

- (tan(c/2 + (d*x)/2)^2*(6*a^4 + (32*b^4)/3 - 48*a^2*b^2) + 2*a^4*tan(c/2 
+ (d*x)/2)^6 + tan(c/2 + (d*x)/2)*(12*a*b^3 - 8*a^3*b) - 2*a^4 - (16*b^4)/ 
3 + 24*a^2*b^2 - tan(c/2 + (d*x)/2)^4*(6*a^4 - 24*a^2*b^2) - tan(c/2 + (d* 
x)/2)^7*(12*a*b^3 - 8*a^3*b) - tan(c/2 + (d*x)/2)^3*(20*a*b^3 - 24*a^3*b) 
+ tan(c/2 + (d*x)/2)^5*(20*a*b^3 - 24*a^3*b))/(d*(2*tan(c/2 + (d*x)/2)^2 - 
 2*tan(c/2 + (d*x)/2)^6 + tan(c/2 + (d*x)/2)^8 - 1)) - (atanh(tan(c/2 + (d 
*x)/2))*(12*a*b^3 - 8*a^3*b))/d
 

Reduce [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 354, normalized size of antiderivative = 1.97 \[ \int \sin (c+d x) (a+b \tan (c+d x))^4 \, dx=\frac {-\cos \left (d x +c \right )^{2} \tan \left (d x +c \right )^{2} b^{4}-12 \cos \left (d x +c \right )^{2} \tan \left (d x +c \right ) a \,b^{3}-6 \cos \left (d x +c \right )^{2} a^{4}+2 \cos \left (d x +c \right )^{2} b^{4}-24 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a^{3} b +36 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a \,b^{3}+24 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a^{3} b -36 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a \,b^{3}+2 \cos \left (d x +c \right ) \sin \left (d x +c \right ) \tan \left (d x +c \right )^{3} b^{4}+12 \cos \left (d x +c \right ) \sin \left (d x +c \right ) \tan \left (d x +c \right )^{2} a \,b^{3}+2 \cos \left (d x +c \right ) \sin \left (d x +c \right ) \tan \left (d x +c \right ) b^{4}-24 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{3} b +48 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a \,b^{3}-72 \cos \left (d x +c \right ) a^{2} b^{2}+18 \cos \left (d x +c \right ) b^{4}-36 \sin \left (d x +c \right )^{2} a^{2} b^{2}+9 \sin \left (d x +c \right )^{2} b^{4}+72 a^{2} b^{2}-18 b^{4}}{6 \cos \left (d x +c \right ) d} \] Input:

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

Output:

( - cos(c + d*x)**2*tan(c + d*x)**2*b**4 - 12*cos(c + d*x)**2*tan(c + d*x) 
*a*b**3 - 6*cos(c + d*x)**2*a**4 + 2*cos(c + d*x)**2*b**4 - 24*cos(c + d*x 
)*log(tan((c + d*x)/2) - 1)*a**3*b + 36*cos(c + d*x)*log(tan((c + d*x)/2) 
- 1)*a*b**3 + 24*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a**3*b - 36*cos(c 
+ d*x)*log(tan((c + d*x)/2) + 1)*a*b**3 + 2*cos(c + d*x)*sin(c + d*x)*tan( 
c + d*x)**3*b**4 + 12*cos(c + d*x)*sin(c + d*x)*tan(c + d*x)**2*a*b**3 + 2 
*cos(c + d*x)*sin(c + d*x)*tan(c + d*x)*b**4 - 24*cos(c + d*x)*sin(c + d*x 
)*a**3*b + 48*cos(c + d*x)*sin(c + d*x)*a*b**3 - 72*cos(c + d*x)*a**2*b**2 
 + 18*cos(c + d*x)*b**4 - 36*sin(c + d*x)**2*a**2*b**2 + 9*sin(c + d*x)**2 
*b**4 + 72*a**2*b**2 - 18*b**4)/(6*cos(c + d*x)*d)