\(\int \frac {(a+b \tan (e+f x))^4}{c+d \tan (e+f x)} \, dx\) [1209]

Optimal result
Mathematica [C] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [C] (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 = 25, antiderivative size = 190 \[ \int \frac {(a+b \tan (e+f x))^4}{c+d \tan (e+f x)} \, dx=\frac {\left (a^4 c-6 a^2 b^2 c+b^4 c+4 a^3 b d-4 a b^3 d\right ) x}{c^2+d^2}-\frac {\left (4 a^3 b c-4 a b^3 c-a^4 d+6 a^2 b^2 d-b^4 d\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right ) f}+\frac {(b c-a d)^4 \log (c+d \tan (e+f x))}{d^3 \left (c^2+d^2\right ) f}-\frac {b^3 (b c-3 a d) \tan (e+f x)}{d^2 f}+\frac {b^2 (a+b \tan (e+f x))^2}{2 d f} \] Output:

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.91 (sec) , antiderivative size = 160, normalized size of antiderivative = 0.84 \[ \int \frac {(a+b \tan (e+f x))^4}{c+d \tan (e+f x)} \, dx=\frac {\frac {\frac {(a+i b)^4 d^2 \log (i-\tan (e+f x))}{i c-d}-\frac {(a-i b)^4 d^2 \log (i+\tan (e+f x))}{i c+d}+\frac {2 (b c-a d)^4 \log (c+d \tan (e+f x))}{d \left (c^2+d^2\right )}}{d}-\frac {2 b^3 (b c-3 a d) \tan (e+f x)}{d}+b^2 (a+b \tan (e+f x))^2}{2 d f} \] Input:

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

Output:

((((a + I*b)^4*d^2*Log[I - Tan[e + f*x]])/(I*c - d) - ((a - I*b)^4*d^2*Log 
[I + Tan[e + f*x]])/(I*c + d) + (2*(b*c - a*d)^4*Log[c + d*Tan[e + f*x]])/ 
(d*(c^2 + d^2)))/d - (2*b^3*(b*c - 3*a*d)*Tan[e + f*x])/d + b^2*(a + b*Tan 
[e + f*x])^2)/(2*d*f)
 

Rubi [A] (verified)

Time = 1.21 (sec) , antiderivative size = 207, normalized size of antiderivative = 1.09, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.440, Rules used = {3042, 4049, 27, 3042, 4120, 3042, 4109, 3042, 3956, 4100, 16}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4049

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4120

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4109

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3956

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

\(\Big \downarrow \) 4100

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

\(\Big \downarrow \) 16

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 16
Int[(c_.)/((a_.) + (b_.)*(x_)), x_Symbol] :> Simp[c*(Log[RemoveContent[a + 
b*x, x]]/b), x] /; FreeQ[{a, b, c}, x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

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 4049
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b^2*(a + b*Tan[e + f*x])^(m - 2)*((c 
+ d*Tan[e + f*x])^(n + 1)/(d*f*(m + n - 1))), x] + Simp[1/(d*(m + n - 1)) 
 Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^n*Simp[a^3*d*(m + n 
- 1) - b^2*(b*c*(m - 2) + a*d*(1 + n)) + b*d*(m + n - 1)*(3*a^2 - b^2)*Tan[ 
e + f*x] - b^2*(b*c*(m - 2) - a*d*(3*m + 2*n - 4))*Tan[e + f*x]^2, x], x], 
x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2 
, 0] && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && GtQ[m, 2] && (GeQ[n, -1] || I 
ntegerQ[m]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])) 
)
 

rule 4100
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + 
 (f_.)*(x_)]^2), x_Symbol] :> Simp[A/(b*f)   Subst[Int[(a + x)^m, x], x, b* 
Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]
 

rule 4109
Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2 
)/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*A + b*B - a 
*C)*(x/(a^2 + b^2)), x] + (Simp[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2)   Int[( 
1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Simp[(A*b - a*B - b*C)/( 
a^2 + b^2)   Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] & 
& NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a*B - b*C 
, 0]
 

rule 4120
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) 
*(x_)])^(n_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f 
_.)*(x_)]^2), x_Symbol] :> Simp[b*C*Tan[e + f*x]*((c + d*Tan[e + f*x])^(n + 
 1)/(d*f*(n + 2))), x] - Simp[1/(d*(n + 2))   Int[(c + d*Tan[e + f*x])^n*Si 
mp[b*c*C - a*A*d*(n + 2) - (A*b + a*B - b*C)*d*(n + 2)*Tan[e + f*x] - (a*C* 
d*(n + 2) - b*(c*C - B*d*(n + 2)))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, 
b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] && 
  !LtQ[n, -1]
 
Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 221, normalized size of antiderivative = 1.16

method result size
derivativedivides \(\frac {\frac {b^{3} \left (\frac {b d \tan \left (f x +e \right )^{2}}{2}+4 a d \tan \left (f x +e \right )-\tan \left (f x +e \right ) b c \right )}{d^{2}}+\frac {\frac {\left (-a^{4} d +4 a^{3} b c +6 a^{2} b^{2} d -4 a \,b^{3} c -b^{4} d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (a^{4} c +4 a^{3} b d -6 a^{2} b^{2} c -4 a \,b^{3} d +b^{4} c \right ) \arctan \left (\tan \left (f x +e \right )\right )}{c^{2}+d^{2}}+\frac {\left (a^{4} d^{4}-4 a^{3} b c \,d^{3}+6 a^{2} b^{2} c^{2} d^{2}-4 a \,c^{3} b^{3} d +b^{4} c^{4}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{d^{3} \left (c^{2}+d^{2}\right )}}{f}\) \(221\)
default \(\frac {\frac {b^{3} \left (\frac {b d \tan \left (f x +e \right )^{2}}{2}+4 a d \tan \left (f x +e \right )-\tan \left (f x +e \right ) b c \right )}{d^{2}}+\frac {\frac {\left (-a^{4} d +4 a^{3} b c +6 a^{2} b^{2} d -4 a \,b^{3} c -b^{4} d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (a^{4} c +4 a^{3} b d -6 a^{2} b^{2} c -4 a \,b^{3} d +b^{4} c \right ) \arctan \left (\tan \left (f x +e \right )\right )}{c^{2}+d^{2}}+\frac {\left (a^{4} d^{4}-4 a^{3} b c \,d^{3}+6 a^{2} b^{2} c^{2} d^{2}-4 a \,c^{3} b^{3} d +b^{4} c^{4}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{d^{3} \left (c^{2}+d^{2}\right )}}{f}\) \(221\)
norman \(\frac {\left (a^{4} c +4 a^{3} b d -6 a^{2} b^{2} c -4 a \,b^{3} d +b^{4} c \right ) x}{c^{2}+d^{2}}+\frac {b^{3} \left (4 a d -b c \right ) \tan \left (f x +e \right )}{d^{2} f}+\frac {b^{4} \tan \left (f x +e \right )^{2}}{2 f d}+\frac {\left (a^{4} d^{4}-4 a^{3} b c \,d^{3}+6 a^{2} b^{2} c^{2} d^{2}-4 a \,c^{3} b^{3} d +b^{4} c^{4}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right ) d^{3} f}-\frac {\left (a^{4} d -4 a^{3} b c -6 a^{2} b^{2} d +4 a \,b^{3} c +b^{4} d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \left (c^{2}+d^{2}\right )}\) \(226\)
parallelrisch \(-\frac {-2 x \,a^{4} c \,d^{3} f -8 x \,a^{3} b \,d^{4} f +12 x \,a^{2} b^{2} c \,d^{3} f +8 x a \,b^{3} d^{4} f -2 x \,b^{4} c \,d^{3} f -\tan \left (f x +e \right )^{2} b^{4} c^{2} d^{2}-\tan \left (f x +e \right )^{2} b^{4} d^{4}+\ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{4} d^{4}-4 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{3} b c \,d^{3}-6 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{2} b^{2} d^{4}+4 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a \,b^{3} c \,d^{3}+\ln \left (1+\tan \left (f x +e \right )^{2}\right ) b^{4} d^{4}-2 \ln \left (c +d \tan \left (f x +e \right )\right ) a^{4} d^{4}+8 \ln \left (c +d \tan \left (f x +e \right )\right ) a^{3} b c \,d^{3}-12 \ln \left (c +d \tan \left (f x +e \right )\right ) a^{2} b^{2} c^{2} d^{2}+8 \ln \left (c +d \tan \left (f x +e \right )\right ) a \,b^{3} c^{3} d -2 \ln \left (c +d \tan \left (f x +e \right )\right ) b^{4} c^{4}-8 \tan \left (f x +e \right ) a \,b^{3} c^{2} d^{2}-8 \tan \left (f x +e \right ) a \,b^{3} d^{4}+2 \tan \left (f x +e \right ) b^{4} c^{3} d +2 \tan \left (f x +e \right ) b^{4} c \,d^{3}}{2 \left (c^{2}+d^{2}\right ) d^{3} f}\) \(380\)
risch \(-\frac {12 i a^{2} b^{2} c^{2} e}{\left (c^{2}+d^{2}\right ) d f}+\frac {8 i a \,c^{3} b^{3} e}{\left (c^{2}+d^{2}\right ) d^{2} f}+\frac {6 x \,a^{2} b^{2}}{i d -c}-\frac {2 i b^{4} x}{d}+\frac {4 i x \,a^{3} b}{i d -c}-\frac {4 i x a \,b^{3}}{i d -c}-\frac {2 i d \,a^{4} x}{c^{2}+d^{2}}+\frac {12 i b^{2} a^{2} x}{d}+\frac {2 i b^{4} c^{2} x}{d^{3}}-\frac {2 i b^{4} e}{f d}+\frac {d \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) a^{4}}{\left (c^{2}+d^{2}\right ) f}-\frac {6 b^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a^{2}}{d f}-\frac {b^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c^{2}}{d^{3} f}+\frac {b^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{d f}-\frac {2 i d \,a^{4} e}{\left (c^{2}+d^{2}\right ) f}+\frac {8 i a^{3} b c x}{c^{2}+d^{2}}+\frac {8 i a^{3} b c e}{\left (c^{2}+d^{2}\right ) f}-\frac {12 i a^{2} b^{2} c^{2} x}{\left (c^{2}+d^{2}\right ) d}+\frac {8 i a \,c^{3} b^{3} x}{\left (c^{2}+d^{2}\right ) d^{2}}-\frac {2 i b^{4} c^{4} e}{\left (c^{2}+d^{2}\right ) d^{3} f}-\frac {8 i b^{3} a c e}{d^{2} f}+\frac {6 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) a^{2} b^{2} c^{2}}{\left (c^{2}+d^{2}\right ) d f}-\frac {4 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) a \,c^{3} b^{3}}{\left (c^{2}+d^{2}\right ) d^{2} f}-\frac {2 i b^{4} c^{4} x}{\left (c^{2}+d^{2}\right ) d^{3}}+\frac {12 i b^{2} a^{2} e}{d f}-\frac {8 i b^{3} a c x}{d^{2}}+\frac {2 i b^{4} c^{2} e}{d^{3} f}-\frac {4 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) a^{3} b c}{\left (c^{2}+d^{2}\right ) f}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) b^{4} c^{4}}{\left (c^{2}+d^{2}\right ) d^{3} f}+\frac {4 b^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a c}{d^{2} f}+\frac {2 i b^{3} \left (4 a d \,{\mathrm e}^{2 i \left (f x +e \right )}-b c \,{\mathrm e}^{2 i \left (f x +e \right )}-i b d \,{\mathrm e}^{2 i \left (f x +e \right )}+4 a d -b c \right )}{f \,d^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}-\frac {x \,a^{4}}{i d -c}-\frac {x \,b^{4}}{i d -c}\) \(848\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 299, normalized size of antiderivative = 1.57 \[ \int \frac {(a+b \tan (e+f x))^4}{c+d \tan (e+f x)} \, dx=\frac {2 \, {\left ({\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} c d^{3} + 4 \, {\left (a^{3} b - a b^{3}\right )} d^{4}\right )} f x + {\left (b^{4} c^{2} d^{2} + b^{4} d^{4}\right )} \tan \left (f x + e\right )^{2} + {\left (b^{4} c^{4} - 4 \, a b^{3} c^{3} d + 6 \, a^{2} b^{2} c^{2} d^{2} - 4 \, a^{3} b c d^{3} + a^{4} d^{4}\right )} \log \left (\frac {d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - {\left (b^{4} c^{4} - 4 \, a b^{3} c^{3} d + 6 \, a^{2} b^{2} c^{2} d^{2} - 4 \, a b^{3} c d^{3} + {\left (6 \, a^{2} b^{2} - b^{4}\right )} d^{4}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \, {\left (b^{4} c^{3} d - 4 \, a b^{3} c^{2} d^{2} + b^{4} c d^{3} - 4 \, a b^{3} d^{4}\right )} \tan \left (f x + e\right )}{2 \, {\left (c^{2} d^{3} + d^{5}\right )} f} \] Input:

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

Output:

1/2*(2*((a^4 - 6*a^2*b^2 + b^4)*c*d^3 + 4*(a^3*b - a*b^3)*d^4)*f*x + (b^4* 
c^2*d^2 + b^4*d^4)*tan(f*x + e)^2 + (b^4*c^4 - 4*a*b^3*c^3*d + 6*a^2*b^2*c 
^2*d^2 - 4*a^3*b*c*d^3 + a^4*d^4)*log((d^2*tan(f*x + e)^2 + 2*c*d*tan(f*x 
+ e) + c^2)/(tan(f*x + e)^2 + 1)) - (b^4*c^4 - 4*a*b^3*c^3*d + 6*a^2*b^2*c 
^2*d^2 - 4*a*b^3*c*d^3 + (6*a^2*b^2 - b^4)*d^4)*log(1/(tan(f*x + e)^2 + 1) 
) - 2*(b^4*c^3*d - 4*a*b^3*c^2*d^2 + b^4*c*d^3 - 4*a*b^3*d^4)*tan(f*x + e) 
)/((c^2*d^3 + d^5)*f)
 

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 1.33 (sec) , antiderivative size = 2516, normalized size of antiderivative = 13.24 \[ \int \frac {(a+b \tan (e+f x))^4}{c+d \tan (e+f x)} \, dx=\text {Too large to display} \] Input:

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

Output:

Piecewise((zoo*x*(a + b*tan(e))**4/tan(e), Eq(c, 0) & Eq(d, 0) & Eq(f, 0)) 
, ((a**4*x + 2*a**3*b*log(tan(e + f*x)**2 + 1)/f - 6*a**2*b**2*x + 6*a**2* 
b**2*tan(e + f*x)/f - 2*a*b**3*log(tan(e + f*x)**2 + 1)/f + 2*a*b**3*tan(e 
 + f*x)**2/f + b**4*x + b**4*tan(e + f*x)**3/(3*f) - b**4*tan(e + f*x)/f)/ 
c, Eq(d, 0)), (I*a**4*f*x*tan(e + f*x)/(2*d*f*tan(e + f*x) - 2*I*d*f) + a* 
*4*f*x/(2*d*f*tan(e + f*x) - 2*I*d*f) + I*a**4/(2*d*f*tan(e + f*x) - 2*I*d 
*f) + 4*a**3*b*f*x*tan(e + f*x)/(2*d*f*tan(e + f*x) - 2*I*d*f) - 4*I*a**3* 
b*f*x/(2*d*f*tan(e + f*x) - 2*I*d*f) - 4*a**3*b/(2*d*f*tan(e + f*x) - 2*I* 
d*f) + 6*I*a**2*b**2*f*x*tan(e + f*x)/(2*d*f*tan(e + f*x) - 2*I*d*f) + 6*a 
**2*b**2*f*x/(2*d*f*tan(e + f*x) - 2*I*d*f) + 6*a**2*b**2*log(tan(e + f*x) 
**2 + 1)*tan(e + f*x)/(2*d*f*tan(e + f*x) - 2*I*d*f) - 6*I*a**2*b**2*log(t 
an(e + f*x)**2 + 1)/(2*d*f*tan(e + f*x) - 2*I*d*f) - 6*I*a**2*b**2/(2*d*f* 
tan(e + f*x) - 2*I*d*f) - 12*a*b**3*f*x*tan(e + f*x)/(2*d*f*tan(e + f*x) - 
 2*I*d*f) + 12*I*a*b**3*f*x/(2*d*f*tan(e + f*x) - 2*I*d*f) + 4*I*a*b**3*lo 
g(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*d*f*tan(e + f*x) - 2*I*d*f) + 4*a*b 
**3*log(tan(e + f*x)**2 + 1)/(2*d*f*tan(e + f*x) - 2*I*d*f) + 8*a*b**3*tan 
(e + f*x)**2/(2*d*f*tan(e + f*x) - 2*I*d*f) + 12*a*b**3/(2*d*f*tan(e + f*x 
) - 2*I*d*f) - 3*I*b**4*f*x*tan(e + f*x)/(2*d*f*tan(e + f*x) - 2*I*d*f) - 
3*b**4*f*x/(2*d*f*tan(e + f*x) - 2*I*d*f) - 2*b**4*log(tan(e + f*x)**2 + 1 
)*tan(e + f*x)/(2*d*f*tan(e + f*x) - 2*I*d*f) + 2*I*b**4*log(tan(e + f*...
 

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 224, normalized size of antiderivative = 1.18 \[ \int \frac {(a+b \tan (e+f x))^4}{c+d \tan (e+f x)} \, dx=\frac {\frac {2 \, {\left ({\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} c + 4 \, {\left (a^{3} b - a b^{3}\right )} d\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} + \frac {2 \, {\left (b^{4} c^{4} - 4 \, a b^{3} c^{3} d + 6 \, a^{2} b^{2} c^{2} d^{2} - 4 \, a^{3} b c d^{3} + a^{4} d^{4}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{2} d^{3} + d^{5}} + \frac {{\left (4 \, {\left (a^{3} b - a b^{3}\right )} c - {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}} + \frac {b^{4} d \tan \left (f x + e\right )^{2} - 2 \, {\left (b^{4} c - 4 \, a b^{3} d\right )} \tan \left (f x + e\right )}{d^{2}}}{2 \, f} \] Input:

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

Output:

1/2*(2*((a^4 - 6*a^2*b^2 + b^4)*c + 4*(a^3*b - a*b^3)*d)*(f*x + e)/(c^2 + 
d^2) + 2*(b^4*c^4 - 4*a*b^3*c^3*d + 6*a^2*b^2*c^2*d^2 - 4*a^3*b*c*d^3 + a^ 
4*d^4)*log(d*tan(f*x + e) + c)/(c^2*d^3 + d^5) + (4*(a^3*b - a*b^3)*c - (a 
^4 - 6*a^2*b^2 + b^4)*d)*log(tan(f*x + e)^2 + 1)/(c^2 + d^2) + (b^4*d*tan( 
f*x + e)^2 - 2*(b^4*c - 4*a*b^3*d)*tan(f*x + e))/d^2)/f
 

Giac [A] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 244, normalized size of antiderivative = 1.28 \[ \int \frac {(a+b \tan (e+f x))^4}{c+d \tan (e+f x)} \, dx=\frac {{\left (a^{4} c - 6 \, a^{2} b^{2} c + b^{4} c + 4 \, a^{3} b d - 4 \, a b^{3} d\right )} {\left (f x + e\right )}}{c^{2} f + d^{2} f} + \frac {{\left (4 \, a^{3} b c - 4 \, a b^{3} c - a^{4} d + 6 \, a^{2} b^{2} d - b^{4} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{2 \, {\left (c^{2} f + d^{2} f\right )}} + \frac {{\left (b^{4} c^{4} - 4 \, a b^{3} c^{3} d + 6 \, a^{2} b^{2} c^{2} d^{2} - 4 \, a^{3} b c d^{3} + a^{4} d^{4}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{2} d^{3} f + d^{5} f} + \frac {b^{4} d f \tan \left (f x + e\right )^{2} - 2 \, b^{4} c f \tan \left (f x + e\right ) + 8 \, a b^{3} d f \tan \left (f x + e\right )}{2 \, d^{2} f^{2}} \] Input:

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

Output:

(a^4*c - 6*a^2*b^2*c + b^4*c + 4*a^3*b*d - 4*a*b^3*d)*(f*x + e)/(c^2*f + d 
^2*f) + 1/2*(4*a^3*b*c - 4*a*b^3*c - a^4*d + 6*a^2*b^2*d - b^4*d)*log(tan( 
f*x + e)^2 + 1)/(c^2*f + d^2*f) + (b^4*c^4 - 4*a*b^3*c^3*d + 6*a^2*b^2*c^2 
*d^2 - 4*a^3*b*c*d^3 + a^4*d^4)*log(abs(d*tan(f*x + e) + c))/(c^2*d^3*f + 
d^5*f) + 1/2*(b^4*d*f*tan(f*x + e)^2 - 2*b^4*c*f*tan(f*x + e) + 8*a*b^3*d* 
f*tan(f*x + e))/(d^2*f^2)
 

Mupad [B] (verification not implemented)

Time = 2.91 (sec) , antiderivative size = 235, normalized size of antiderivative = 1.24 \[ \int \frac {(a+b \tan (e+f x))^4}{c+d \tan (e+f x)} \, dx=\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {4\,a\,b^3}{d}-\frac {b^4\,c}{d^2}\right )}{f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (a^4-a^3\,b\,4{}\mathrm {i}-6\,a^2\,b^2+a\,b^3\,4{}\mathrm {i}+b^4\right )}{2\,f\,\left (d+c\,1{}\mathrm {i}\right )}+\frac {b^4\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,d\,f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (a^4\,1{}\mathrm {i}-4\,a^3\,b-a^2\,b^2\,6{}\mathrm {i}+4\,a\,b^3+b^4\,1{}\mathrm {i}\right )}{2\,f\,\left (c+d\,1{}\mathrm {i}\right )}+\frac {\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a^4\,d^4-4\,a^3\,b\,c\,d^3+6\,a^2\,b^2\,c^2\,d^2-4\,a\,b^3\,c^3\,d+b^4\,c^4\right )}{f\,\left (c^2\,d^3+d^5\right )} \] Input:

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

Output:

(tan(e + f*x)*((4*a*b^3)/d - (b^4*c)/d^2))/f - (log(tan(e + f*x) + 1i)*(a* 
b^3*4i - a^3*b*4i + a^4 + b^4 - 6*a^2*b^2))/(2*f*(c*1i + d)) + (b^4*tan(e 
+ f*x)^2)/(2*d*f) - (log(tan(e + f*x) - 1i)*(4*a*b^3 - 4*a^3*b + a^4*1i + 
b^4*1i - a^2*b^2*6i))/(2*f*(c + d*1i)) + (log(c + d*tan(e + f*x))*(a^4*d^4 
 + b^4*c^4 + 6*a^2*b^2*c^2*d^2 - 4*a*b^3*c^3*d - 4*a^3*b*c*d^3))/(f*(d^5 + 
 c^2*d^3))
 

Reduce [B] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 379, normalized size of antiderivative = 1.99 \[ \int \frac {(a+b \tan (e+f x))^4}{c+d \tan (e+f x)} \, dx=\frac {-\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) a^{4} d^{4}+4 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) a^{3} b c \,d^{3}+6 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) a^{2} b^{2} d^{4}-4 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) a \,b^{3} c \,d^{3}-\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) b^{4} d^{4}+2 \,\mathrm {log}\left (d \tan \left (f x +e \right )+c \right ) a^{4} d^{4}-8 \,\mathrm {log}\left (d \tan \left (f x +e \right )+c \right ) a^{3} b c \,d^{3}+12 \,\mathrm {log}\left (d \tan \left (f x +e \right )+c \right ) a^{2} b^{2} c^{2} d^{2}-8 \,\mathrm {log}\left (d \tan \left (f x +e \right )+c \right ) a \,b^{3} c^{3} d +2 \,\mathrm {log}\left (d \tan \left (f x +e \right )+c \right ) b^{4} c^{4}+\tan \left (f x +e \right )^{2} b^{4} c^{2} d^{2}+\tan \left (f x +e \right )^{2} b^{4} d^{4}+8 \tan \left (f x +e \right ) a \,b^{3} c^{2} d^{2}+8 \tan \left (f x +e \right ) a \,b^{3} d^{4}-2 \tan \left (f x +e \right ) b^{4} c^{3} d -2 \tan \left (f x +e \right ) b^{4} c \,d^{3}+2 a^{4} c \,d^{3} f x +8 a^{3} b \,d^{4} f x -12 a^{2} b^{2} c \,d^{3} f x -8 a \,b^{3} d^{4} f x +2 b^{4} c \,d^{3} f x}{2 d^{3} f \left (c^{2}+d^{2}\right )} \] Input:

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

Output:

( - log(tan(e + f*x)**2 + 1)*a**4*d**4 + 4*log(tan(e + f*x)**2 + 1)*a**3*b 
*c*d**3 + 6*log(tan(e + f*x)**2 + 1)*a**2*b**2*d**4 - 4*log(tan(e + f*x)** 
2 + 1)*a*b**3*c*d**3 - log(tan(e + f*x)**2 + 1)*b**4*d**4 + 2*log(tan(e + 
f*x)*d + c)*a**4*d**4 - 8*log(tan(e + f*x)*d + c)*a**3*b*c*d**3 + 12*log(t 
an(e + f*x)*d + c)*a**2*b**2*c**2*d**2 - 8*log(tan(e + f*x)*d + c)*a*b**3* 
c**3*d + 2*log(tan(e + f*x)*d + c)*b**4*c**4 + tan(e + f*x)**2*b**4*c**2*d 
**2 + tan(e + f*x)**2*b**4*d**4 + 8*tan(e + f*x)*a*b**3*c**2*d**2 + 8*tan( 
e + f*x)*a*b**3*d**4 - 2*tan(e + f*x)*b**4*c**3*d - 2*tan(e + f*x)*b**4*c* 
d**3 + 2*a**4*c*d**3*f*x + 8*a**3*b*d**4*f*x - 12*a**2*b**2*c*d**3*f*x - 8 
*a*b**3*d**4*f*x + 2*b**4*c*d**3*f*x)/(2*d**3*f*(c**2 + d**2))