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

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

Optimal result

Integrand size = 19, antiderivative size = 130 \[ \int \tan (c+d x) (a+b \tan (c+d x))^4 \, dx=-4 a b \left (a^2-b^2\right ) x-\frac {\left (a^4-6 a^2 b^2+b^4\right ) \log (\cos (c+d x))}{d}+\frac {a b \left (a^2-3 b^2\right ) \tan (c+d x)}{d}+\frac {\left (a^2-b^2\right ) (a+b \tan (c+d x))^2}{2 d}+\frac {a (a+b \tan (c+d x))^3}{3 d}+\frac {(a+b \tan (c+d x))^4}{4 d} \] Output:

-4*a*b*(a^2-b^2)*x-(a^4-6*a^2*b^2+b^4)*ln(cos(d*x+c))/d+a*b*(a^2-3*b^2)*ta 
n(d*x+c)/d+1/2*(a^2-b^2)*(a+b*tan(d*x+c))^2/d+1/3*a*(a+b*tan(d*x+c))^3/d+1 
/4*(a+b*tan(d*x+c))^4/d
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 1.14 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.95 \[ \int \tan (c+d x) (a+b \tan (c+d x))^4 \, dx=\frac {6 \left ((a+i b)^4 \log (i-\tan (c+d x))+(a-i b)^4 \log (i+\tan (c+d x))\right )+48 a b \left (a^2-b^2\right ) \tan (c+d x)-6 b^2 \left (-6 a^2+b^2\right ) \tan ^2(c+d x)+16 a b^3 \tan ^3(c+d x)+3 b^4 \tan ^4(c+d x)}{12 d} \] Input:

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

Output:

(6*((a + I*b)^4*Log[I - Tan[c + d*x]] + (a - I*b)^4*Log[I + Tan[c + d*x]]) 
 + 48*a*b*(a^2 - b^2)*Tan[c + d*x] - 6*b^2*(-6*a^2 + b^2)*Tan[c + d*x]^2 + 
 16*a*b^3*Tan[c + d*x]^3 + 3*b^4*Tan[c + d*x]^4)/(12*d)
 

Rubi [A] (verified)

Time = 0.66 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.526, Rules used = {3042, 4011, 3042, 4011, 3042, 4011, 3042, 4008, 3042, 3956}

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 (c+d x) (a+b \tan (c+d x))^4 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4011

\(\displaystyle \int (a \tan (c+d x)-b) (a+b \tan (c+d x))^3dx+\frac {(a+b \tan (c+d x))^4}{4 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a \tan (c+d x)-b) (a+b \tan (c+d x))^3dx+\frac {(a+b \tan (c+d x))^4}{4 d}\)

\(\Big \downarrow \) 4011

\(\displaystyle \int (a+b \tan (c+d x))^2 \left (\left (a^2-b^2\right ) \tan (c+d x)-2 a b\right )dx+\frac {(a+b \tan (c+d x))^4}{4 d}+\frac {a (a+b \tan (c+d x))^3}{3 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+b \tan (c+d x))^2 \left (\left (a^2-b^2\right ) \tan (c+d x)-2 a b\right )dx+\frac {(a+b \tan (c+d x))^4}{4 d}+\frac {a (a+b \tan (c+d x))^3}{3 d}\)

\(\Big \downarrow \) 4011

\(\displaystyle \int (a+b \tan (c+d x)) \left (a \left (a^2-3 b^2\right ) \tan (c+d x)-b \left (3 a^2-b^2\right )\right )dx+\frac {\left (a^2-b^2\right ) (a+b \tan (c+d x))^2}{2 d}+\frac {(a+b \tan (c+d x))^4}{4 d}+\frac {a (a+b \tan (c+d x))^3}{3 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+b \tan (c+d x)) \left (a \left (a^2-3 b^2\right ) \tan (c+d x)-b \left (3 a^2-b^2\right )\right )dx+\frac {\left (a^2-b^2\right ) (a+b \tan (c+d x))^2}{2 d}+\frac {(a+b \tan (c+d x))^4}{4 d}+\frac {a (a+b \tan (c+d x))^3}{3 d}\)

\(\Big \downarrow \) 4008

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3956

\(\displaystyle \frac {\left (a^2-b^2\right ) (a+b \tan (c+d x))^2}{2 d}+\frac {a b \left (a^2-3 b^2\right ) \tan (c+d x)}{d}-4 a b x \left (a^2-b^2\right )-\frac {\left (a^4-6 a^2 b^2+b^4\right ) \log (\cos (c+d x))}{d}+\frac {(a+b \tan (c+d x))^4}{4 d}+\frac {a (a+b \tan (c+d x))^3}{3 d}\)

Input:

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

Output:

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

Defintions of rubi rules used

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3956
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d 
*x], x]]/d, x] /; FreeQ[{c, d}, x]
 

rule 4008
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) 
*(x_)]), x_Symbol] :> Simp[(a*c - b*d)*x, x] + (Simp[b*d*(Tan[e + f*x]/f), 
x] + Simp[(b*c + a*d)   Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, 
f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
 

rule 4011
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[d*((a + b*Tan[e + f*x])^m/(f*m)), x] + Int 
[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x], x] 
, x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 
 0] && GtQ[m, 0]
 
Maple [A] (verified)

Time = 0.48 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.00

method result size
norman \(\left (-4 a^{3} b +4 a \,b^{3}\right ) x +\frac {b^{4} \tan \left (d x +c \right )^{4}}{4 d}+\frac {4 a \,b^{3} \tan \left (d x +c \right )^{3}}{3 d}+\frac {b^{2} \left (6 a^{2}-b^{2}\right ) \tan \left (d x +c \right )^{2}}{2 d}+\frac {4 a b \left (a^{2}-b^{2}\right ) \tan \left (d x +c \right )}{d}+\frac {\left (a^{4}-6 b^{2} a^{2}+b^{4}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}\) \(130\)
derivativedivides \(\frac {\frac {b^{4} \tan \left (d x +c \right )^{4}}{4}+\frac {4 a \,b^{3} \tan \left (d x +c \right )^{3}}{3}+3 b^{2} a^{2} \tan \left (d x +c \right )^{2}-\frac {b^{4} \tan \left (d x +c \right )^{2}}{2}+4 a^{3} b \tan \left (d x +c \right )-4 a \,b^{3} \tan \left (d x +c \right )+\frac {\left (a^{4}-6 b^{2} a^{2}+b^{4}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-4 a^{3} b +4 a \,b^{3}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(135\)
default \(\frac {\frac {b^{4} \tan \left (d x +c \right )^{4}}{4}+\frac {4 a \,b^{3} \tan \left (d x +c \right )^{3}}{3}+3 b^{2} a^{2} \tan \left (d x +c \right )^{2}-\frac {b^{4} \tan \left (d x +c \right )^{2}}{2}+4 a^{3} b \tan \left (d x +c \right )-4 a \,b^{3} \tan \left (d x +c \right )+\frac {\left (a^{4}-6 b^{2} a^{2}+b^{4}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-4 a^{3} b +4 a \,b^{3}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(135\)
parallelrisch \(\frac {3 b^{4} \tan \left (d x +c \right )^{4}+16 a \,b^{3} \tan \left (d x +c \right )^{3}-48 a^{3} b d x +48 a \,b^{3} d x +36 b^{2} a^{2} \tan \left (d x +c \right )^{2}-6 b^{4} \tan \left (d x +c \right )^{2}+6 \ln \left (1+\tan \left (d x +c \right )^{2}\right ) a^{4}-36 \ln \left (1+\tan \left (d x +c \right )^{2}\right ) a^{2} b^{2}+6 \ln \left (1+\tan \left (d x +c \right )^{2}\right ) b^{4}+48 a^{3} b \tan \left (d x +c \right )-48 a \,b^{3} \tan \left (d x +c \right )}{12 d}\) \(154\)
parts \(\frac {a^{4} \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}+\frac {b^{4} \left (\frac {\tan \left (d x +c \right )^{4}}{4}-\frac {\tan \left (d x +c \right )^{2}}{2}+\frac {\ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}\right )}{d}+\frac {4 a \,b^{3} \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 {4 a^{3} b \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {3 b^{2} a^{2} \tan \left (d x +c \right )^{2}}{d}-\frac {3 b^{2} a^{2} \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{d}\) \(163\)
risch \(-4 a^{3} b x +4 a \,b^{3} x +i a^{4} x -6 i a^{2} b^{2} x +i b^{4} x +\frac {2 i a^{4} c}{d}-\frac {12 i a^{2} b^{2} c}{d}+\frac {2 i b^{4} c}{d}+\frac {4 i b \left (-9 i a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}+3 i b^{3} {\mathrm e}^{6 i \left (d x +c \right )}+6 a^{3} {\mathrm e}^{6 i \left (d x +c \right )}-12 a \,b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-18 i a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}+3 i b^{3} {\mathrm e}^{4 i \left (d x +c \right )}+18 a^{3} {\mathrm e}^{4 i \left (d x +c \right )}-24 a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-9 i a^{2} b \,{\mathrm e}^{2 i \left (d x +c \right )}+3 i b^{3} {\mathrm e}^{2 i \left (d x +c \right )}+18 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-20 a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+6 a^{3}-8 a \,b^{2}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) a^{4}}{d}+\frac {6 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) b^{2} a^{2}}{d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) b^{4}}{d}\) \(348\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.95 \[ \int \tan (c+d x) (a+b \tan (c+d x))^4 \, dx=\frac {3 \, b^{4} \tan \left (d x + c\right )^{4} + 16 \, a b^{3} \tan \left (d x + c\right )^{3} - 48 \, {\left (a^{3} b - a b^{3}\right )} d x + 6 \, {\left (6 \, a^{2} b^{2} - b^{4}\right )} \tan \left (d x + c\right )^{2} - 6 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 48 \, {\left (a^{3} b - a b^{3}\right )} \tan \left (d x + c\right )}{12 \, d} \] Input:

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

Output:

1/12*(3*b^4*tan(d*x + c)^4 + 16*a*b^3*tan(d*x + c)^3 - 48*(a^3*b - a*b^3)* 
d*x + 6*(6*a^2*b^2 - b^4)*tan(d*x + c)^2 - 6*(a^4 - 6*a^2*b^2 + b^4)*log(1 
/(tan(d*x + c)^2 + 1)) + 48*(a^3*b - a*b^3)*tan(d*x + c))/d
 

Sympy [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.44 \[ \int \tan (c+d x) (a+b \tan (c+d x))^4 \, dx=\begin {cases} \frac {a^{4} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - 4 a^{3} b x + \frac {4 a^{3} b \tan {\left (c + d x \right )}}{d} - \frac {3 a^{2} b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} + \frac {3 a^{2} b^{2} \tan ^{2}{\left (c + d x \right )}}{d} + 4 a b^{3} x + \frac {4 a b^{3} \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac {4 a b^{3} \tan {\left (c + d x \right )}}{d} + \frac {b^{4} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {b^{4} \tan ^{4}{\left (c + d x \right )}}{4 d} - \frac {b^{4} \tan ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tan {\left (c \right )}\right )^{4} \tan {\left (c \right )} & \text {otherwise} \end {cases} \] Input:

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

Output:

Piecewise((a**4*log(tan(c + d*x)**2 + 1)/(2*d) - 4*a**3*b*x + 4*a**3*b*tan 
(c + d*x)/d - 3*a**2*b**2*log(tan(c + d*x)**2 + 1)/d + 3*a**2*b**2*tan(c + 
 d*x)**2/d + 4*a*b**3*x + 4*a*b**3*tan(c + d*x)**3/(3*d) - 4*a*b**3*tan(c 
+ d*x)/d + b**4*log(tan(c + d*x)**2 + 1)/(2*d) + b**4*tan(c + d*x)**4/(4*d 
) - b**4*tan(c + d*x)**2/(2*d), Ne(d, 0)), (x*(a + b*tan(c))**4*tan(c), Tr 
ue))
 

Maxima [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.95 \[ \int \tan (c+d x) (a+b \tan (c+d x))^4 \, dx=\frac {3 \, b^{4} \tan \left (d x + c\right )^{4} + 16 \, a b^{3} \tan \left (d x + c\right )^{3} + 6 \, {\left (6 \, a^{2} b^{2} - b^{4}\right )} \tan \left (d x + c\right )^{2} - 48 \, {\left (a^{3} b - a b^{3}\right )} {\left (d x + c\right )} + 6 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 48 \, {\left (a^{3} b - a b^{3}\right )} \tan \left (d x + c\right )}{12 \, d} \] Input:

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

Output:

1/12*(3*b^4*tan(d*x + c)^4 + 16*a*b^3*tan(d*x + c)^3 + 6*(6*a^2*b^2 - b^4) 
*tan(d*x + c)^2 - 48*(a^3*b - a*b^3)*(d*x + c) + 6*(a^4 - 6*a^2*b^2 + b^4) 
*log(tan(d*x + c)^2 + 1) + 48*(a^3*b - a*b^3)*tan(d*x + c))/d
 

Giac [A] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.22 \[ \int \tan (c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {4 \, {\left (a^{3} b - a b^{3}\right )} {\left (d x + c\right )}}{d} + \frac {{\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} + \frac {3 \, b^{4} d^{3} \tan \left (d x + c\right )^{4} + 16 \, a b^{3} d^{3} \tan \left (d x + c\right )^{3} + 36 \, a^{2} b^{2} d^{3} \tan \left (d x + c\right )^{2} - 6 \, b^{4} d^{3} \tan \left (d x + c\right )^{2} + 48 \, a^{3} b d^{3} \tan \left (d x + c\right ) - 48 \, a b^{3} d^{3} \tan \left (d x + c\right )}{12 \, d^{4}} \] Input:

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

Output:

-4*(a^3*b - a*b^3)*(d*x + c)/d + 1/2*(a^4 - 6*a^2*b^2 + b^4)*log(tan(d*x + 
 c)^2 + 1)/d + 1/12*(3*b^4*d^3*tan(d*x + c)^4 + 16*a*b^3*d^3*tan(d*x + c)^ 
3 + 36*a^2*b^2*d^3*tan(d*x + c)^2 - 6*b^4*d^3*tan(d*x + c)^2 + 48*a^3*b*d^ 
3*tan(d*x + c) - 48*a*b^3*d^3*tan(d*x + c))/d^4
 

Mupad [B] (verification not implemented)

Time = 1.05 (sec) , antiderivative size = 168, normalized size of antiderivative = 1.29 \[ \int \tan (c+d x) (a+b \tan (c+d x))^4 \, dx=\frac {\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )\,\left (\frac {a^4}{2}-3\,a^2\,b^2+\frac {b^4}{2}\right )}{d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {b^4}{2}-3\,a^2\,b^2\right )}{d}+\frac {b^4\,{\mathrm {tan}\left (c+d\,x\right )}^4}{4\,d}-\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (4\,a\,b^3-4\,a^3\,b\right )}{d}+\frac {4\,a\,b^3\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,d}+\frac {4\,a\,b\,\mathrm {atan}\left (\frac {4\,a\,b\,\mathrm {tan}\left (c+d\,x\right )\,\left (a+b\right )\,\left (a-b\right )}{4\,a\,b^3-4\,a^3\,b}\right )\,\left (a+b\right )\,\left (a-b\right )}{d} \] Input:

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

Output:

(log(tan(c + d*x)^2 + 1)*(a^4/2 + b^4/2 - 3*a^2*b^2))/d - (tan(c + d*x)^2* 
(b^4/2 - 3*a^2*b^2))/d + (b^4*tan(c + d*x)^4)/(4*d) - (tan(c + d*x)*(4*a*b 
^3 - 4*a^3*b))/d + (4*a*b^3*tan(c + d*x)^3)/(3*d) + (4*a*b*atan((4*a*b*tan 
(c + d*x)*(a + b)*(a - b))/(4*a*b^3 - 4*a^3*b))*(a + b)*(a - b))/d
 

Reduce [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.18 \[ \int \tan (c+d x) (a+b \tan (c+d x))^4 \, dx=\frac {6 \,\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) a^{4}-36 \,\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) a^{2} b^{2}+6 \,\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) b^{4}+3 \tan \left (d x +c \right )^{4} b^{4}+16 \tan \left (d x +c \right )^{3} a \,b^{3}+36 \tan \left (d x +c \right )^{2} a^{2} b^{2}-6 \tan \left (d x +c \right )^{2} b^{4}+48 \tan \left (d x +c \right ) a^{3} b -48 \tan \left (d x +c \right ) a \,b^{3}-48 a^{3} b d x +48 a \,b^{3} d x}{12 d} \] Input:

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

Output:

(6*log(tan(c + d*x)**2 + 1)*a**4 - 36*log(tan(c + d*x)**2 + 1)*a**2*b**2 + 
 6*log(tan(c + d*x)**2 + 1)*b**4 + 3*tan(c + d*x)**4*b**4 + 16*tan(c + d*x 
)**3*a*b**3 + 36*tan(c + d*x)**2*a**2*b**2 - 6*tan(c + d*x)**2*b**4 + 48*t 
an(c + d*x)*a**3*b - 48*tan(c + d*x)*a*b**3 - 48*a**3*b*d*x + 48*a*b**3*d* 
x)/(12*d)