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

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

Optimal result

Integrand size = 25, antiderivative size = 239 \[ \int \frac {(c+d \tan (e+f x))^3}{(a+b \tan (e+f x))^3} \, dx=\frac {(a c+b d) \left (8 a b c d+a^2 \left (c^2-3 d^2\right )-b^2 \left (3 c^2-d^2\right )\right ) x}{\left (a^2+b^2\right )^3}+\frac {(b c-a d) \left (8 a b c d-b^2 \left (c^2-3 d^2\right )+a^2 \left (3 c^2-d^2\right )\right ) \log (a \cos (e+f x)+b \sin (e+f x))}{\left (a^2+b^2\right )^3 f}-\frac {(b c-a d)^2 \left (4 a b c+a^2 d+5 b^2 d\right )}{2 b^2 \left (a^2+b^2\right )^2 f (a+b \tan (e+f x))}-\frac {(b c-a d)^2 (c+d \tan (e+f x))}{2 b \left (a^2+b^2\right ) f (a+b \tan (e+f x))^2} \] Output:

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

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

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

Output:

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

Rubi [A] (verified)

Time = 1.26 (sec) , antiderivative size = 274, normalized size of antiderivative = 1.15, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.360, Rules used = {3042, 4048, 3042, 4111, 27, 3042, 4014, 3042, 4013}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4048

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4111

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4014

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4013

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

Input:

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

Output:

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

Defintions of rubi rules used

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 4013
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* 
(x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si 
n[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] && EqQ[a*c + b*d, 0]
 

rule 4014
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_. 
)*(x_)]), x_Symbol] :> Simp[(a*c + b*d)*(x/(a^2 + b^2)), x] + Simp[(b*c - a 
*d)/(a^2 + b^2)   Int[(b - a*Tan[e + f*x])/(a + b*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] && N 
eQ[a*c + b*d, 0]
 

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

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

Time = 0.28 (sec) , antiderivative size = 422, normalized size of antiderivative = 1.77

method result size
derivativedivides \(\frac {\frac {\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}-3 a^{2} b \,c^{3}+9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}+b^{3} c^{3}-3 b^{3} c \,d^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (a^{3} c^{3}-3 a^{3} c \,d^{2}+9 a^{2} b \,c^{2} d -3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}-3 b^{3} c^{2} d +b^{3} d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}-\frac {-a^{3} d^{3}+3 a^{2} b c \,d^{2}-3 a \,b^{2} c^{2} d +b^{3} c^{3}}{2 b^{2} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )^{2}}-\frac {a^{4} d^{3}-3 a^{2} b^{2} c^{2} d +3 a^{2} b^{2} d^{3}+2 a \,c^{3} b^{3}-6 a \,b^{3} c \,d^{2}+3 b^{4} c^{2} d}{\left (a^{2}+b^{2}\right )^{2} b^{2} \left (a +b \tan \left (f x +e \right )\right )}-\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}-3 a^{2} b \,c^{3}+9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}+b^{3} c^{3}-3 b^{3} c \,d^{2}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}}{f}\) \(422\)
default \(\frac {\frac {\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}-3 a^{2} b \,c^{3}+9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}+b^{3} c^{3}-3 b^{3} c \,d^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (a^{3} c^{3}-3 a^{3} c \,d^{2}+9 a^{2} b \,c^{2} d -3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}-3 b^{3} c^{2} d +b^{3} d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}-\frac {-a^{3} d^{3}+3 a^{2} b c \,d^{2}-3 a \,b^{2} c^{2} d +b^{3} c^{3}}{2 b^{2} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )^{2}}-\frac {a^{4} d^{3}-3 a^{2} b^{2} c^{2} d +3 a^{2} b^{2} d^{3}+2 a \,c^{3} b^{3}-6 a \,b^{3} c \,d^{2}+3 b^{4} c^{2} d}{\left (a^{2}+b^{2}\right )^{2} b^{2} \left (a +b \tan \left (f x +e \right )\right )}-\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}-3 a^{2} b \,c^{3}+9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}+b^{3} c^{3}-3 b^{3} c \,d^{2}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}}{f}\) \(422\)
norman \(\frac {\frac {\left (-a^{4} d^{3}+3 a^{2} b^{2} c^{2} d -3 a^{2} b^{2} d^{3}-2 a \,c^{3} b^{3}+6 a \,b^{3} c \,d^{2}-3 b^{4} c^{2} d \right ) \tan \left (f x +e \right )}{f b \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {\left (a^{3} c^{3}-3 a^{3} c \,d^{2}+9 a^{2} b \,c^{2} d -3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}-3 b^{3} c^{2} d +b^{3} d^{3}\right ) a^{2} x}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (a^{2}+b^{2}\right )}+\frac {b^{2} \left (a^{3} c^{3}-3 a^{3} c \,d^{2}+9 a^{2} b \,c^{2} d -3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}-3 b^{3} c^{2} d +b^{3} d^{3}\right ) x \tan \left (f x +e \right )^{2}}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (a^{2}+b^{2}\right )}+\frac {-a^{5} d^{3}-3 a^{4} c \,d^{2} b +9 a^{3} b^{2} c^{2} d -5 a^{3} b^{2} d^{3}-5 a^{2} b^{3} c^{3}+9 a^{2} b^{3} c \,d^{2}-3 b^{4} c^{2} d a -b^{5} c^{3}}{2 f \,b^{2} \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {2 b \left (a^{3} c^{3}-3 a^{3} c \,d^{2}+9 a^{2} b \,c^{2} d -3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}-3 b^{3} c^{2} d +b^{3} d^{3}\right ) a x \tan \left (f x +e \right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (a^{2}+b^{2}\right )}}{\left (a +b \tan \left (f x +e \right )\right )^{2}}+\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}-3 a^{2} b \,c^{3}+9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}+b^{3} c^{3}-3 b^{3} c \,d^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}-3 a^{2} b \,c^{3}+9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}+b^{3} c^{3}-3 b^{3} c \,d^{2}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}\) \(760\)
risch \(\text {Expression too large to display}\) \(1681\)
parallelrisch \(\text {Expression too large to display}\) \(2023\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 898 vs. \(2 (235) = 470\).

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

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

Output:

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

Sympy [F(-2)]

Exception generated. \[ \int \frac {(c+d \tan (e+f x))^3}{(a+b \tan (e+f x))^3} \, dx=\text {Exception raised: AttributeError} \] Input:

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

Output:

Exception raised: AttributeError >> 'NoneType' object has no attribute 'pr 
imitive'
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 533 vs. \(2 (235) = 470\).

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

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

Output:

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 606 vs. \(2 (235) = 470\).

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

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

Output:

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

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

(3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2*a**4*b**3*c**2*d - log(tan(e + 
 f*x)**2 + 1)*tan(e + f*x)**2*a**4*b**3*d**3 - 3*log(tan(e + f*x)**2 + 1)* 
tan(e + f*x)**2*a**3*b**4*c**3 + 9*log(tan(e + f*x)**2 + 1)*tan(e + f*x)** 
2*a**3*b**4*c*d**2 - 9*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2*a**2*b**5* 
c**2*d + 3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2*a**2*b**5*d**3 + log(t 
an(e + f*x)**2 + 1)*tan(e + f*x)**2*a*b**6*c**3 - 3*log(tan(e + f*x)**2 + 
1)*tan(e + f*x)**2*a*b**6*c*d**2 + 6*log(tan(e + f*x)**2 + 1)*tan(e + f*x) 
*a**5*b**2*c**2*d - 2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)*a**5*b**2*d**3 
 - 6*log(tan(e + f*x)**2 + 1)*tan(e + f*x)*a**4*b**3*c**3 + 18*log(tan(e + 
 f*x)**2 + 1)*tan(e + f*x)*a**4*b**3*c*d**2 - 18*log(tan(e + f*x)**2 + 1)* 
tan(e + f*x)*a**3*b**4*c**2*d + 6*log(tan(e + f*x)**2 + 1)*tan(e + f*x)*a* 
*3*b**4*d**3 + 2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)*a**2*b**5*c**3 - 6* 
log(tan(e + f*x)**2 + 1)*tan(e + f*x)*a**2*b**5*c*d**2 + 3*log(tan(e + f*x 
)**2 + 1)*a**6*b*c**2*d - log(tan(e + f*x)**2 + 1)*a**6*b*d**3 - 3*log(tan 
(e + f*x)**2 + 1)*a**5*b**2*c**3 + 9*log(tan(e + f*x)**2 + 1)*a**5*b**2*c* 
d**2 - 9*log(tan(e + f*x)**2 + 1)*a**4*b**3*c**2*d + 3*log(tan(e + f*x)**2 
 + 1)*a**4*b**3*d**3 + log(tan(e + f*x)**2 + 1)*a**3*b**4*c**3 - 3*log(tan 
(e + f*x)**2 + 1)*a**3*b**4*c*d**2 - 6*log(tan(e + f*x)*b + a)*tan(e + f*x 
)**2*a**4*b**3*c**2*d + 2*log(tan(e + f*x)*b + a)*tan(e + f*x)**2*a**4*b** 
3*d**3 + 6*log(tan(e + f*x)*b + a)*tan(e + f*x)**2*a**3*b**4*c**3 - 18*...