Integrand size = 23, antiderivative size = 175 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=\frac {\left (a^3 c-3 a b^2 c+3 a^2 b d-b^3 d\right ) x}{\left (a^2+b^2\right )^3}+\frac {\left (3 a^2 b c-b^3 c-a^3 d+3 a b^2 d\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 (a^2+b^2\right ) f (a+b \tan (e+f x))^2}-\frac {2 a b c-a^2 d+b^2 d}{\left (a^2+b^2\right )^2 f (a+b \tan (e+f x))} \] Output:
(a^3*c+3*a^2*b*d-3*a*b^2*c-b^3*d)*x/(a^2+b^2)^3+(-a^3*d+3*a^2*b*c+3*a*b^2* d-b^3*c)*ln(a*cos(f*x+e)+b*sin(f*x+e))/(a^2+b^2)^3/f-1/2*(-a*d+b*c)/(a^2+b ^2)/f/(a+b*tan(f*x+e))^2-(-a^2*d+2*a*b*c+b^2*d)/(a^2+b^2)^2/f/(a+b*tan(f*x +e))
Result contains complex when optimal does not.
Time = 3.24 (sec) , antiderivative size = 243, normalized size of antiderivative = 1.39 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=-\frac {d \left (\frac {i \log (i-\tan (e+f x))}{(a+i b)^2}-\frac {i \log (i+\tan (e+f x))}{(a-i b)^2}+\frac {2 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 c-a d) \left (\frac {i \log (i-\tan (e+f x))}{(a+i 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 f} \] Input:
Integrate[(c + d*Tan[e + f*x])/(a + b*Tan[e + f*x])^3,x]
Output:
-1/2*(d*((I*Log[I - Tan[e + f*x]])/(a + I*b)^2 - (I*Log[I + Tan[e + f*x]]) /(a - I*b)^2 + (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*c - a*d)*((I*Log[I - Tan[e + f*x]])/(a + I*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))/(b*f)
Time = 0.84 (sec) , antiderivative size = 197, normalized size of antiderivative = 1.13, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {3042, 4012, 3042, 4012, 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)}{(a+b \tan (e+f x))^3} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3}dx\) |
\(\Big \downarrow \) 4012 |
\(\displaystyle \frac {\int \frac {a c+b d-(b c-a d) \tan (e+f x)}{(a+b \tan (e+f x))^2}dx}{a^2+b^2}-\frac {b c-a d}{2 f \left (a^2+b^2\right ) (a+b \tan (e+f x))^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a c+b d-(b c-a d) \tan (e+f x)}{(a+b \tan (e+f x))^2}dx}{a^2+b^2}-\frac {b c-a d}{2 f \left (a^2+b^2\right ) (a+b \tan (e+f x))^2}\) |
\(\Big \downarrow \) 4012 |
\(\displaystyle \frac {\frac {\int \frac {c a^2+2 b d a-b^2 c-\left (-d a^2+2 b c a+b^2 d\right ) \tan (e+f x)}{a+b \tan (e+f x)}dx}{a^2+b^2}-\frac {a^2 (-d)+2 a b c+b^2 d}{f \left (a^2+b^2\right ) (a+b \tan (e+f x))}}{a^2+b^2}-\frac {b c-a d}{2 f \left (a^2+b^2\right ) (a+b \tan (e+f x))^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\int \frac {c a^2+2 b d a-b^2 c-\left (-d a^2+2 b c a+b^2 d\right ) \tan (e+f x)}{a+b \tan (e+f x)}dx}{a^2+b^2}-\frac {a^2 (-d)+2 a b c+b^2 d}{f \left (a^2+b^2\right ) (a+b \tan (e+f x))}}{a^2+b^2}-\frac {b c-a d}{2 f \left (a^2+b^2\right ) (a+b \tan (e+f x))^2}\) |
\(\Big \downarrow \) 4014 |
\(\displaystyle \frac {\frac {\frac {\left (a^3 (-d)+3 a^2 b c+3 a b^2 d-b^3 c\right ) \int \frac {b-a \tan (e+f x)}{a+b \tan (e+f x)}dx}{a^2+b^2}+\frac {x \left (a^3 c+3 a^2 b d-3 a b^2 c-b^3 d\right )}{a^2+b^2}}{a^2+b^2}-\frac {a^2 (-d)+2 a b c+b^2 d}{f \left (a^2+b^2\right ) (a+b \tan (e+f x))}}{a^2+b^2}-\frac {b c-a d}{2 f \left (a^2+b^2\right ) (a+b \tan (e+f x))^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\frac {\left (a^3 (-d)+3 a^2 b c+3 a b^2 d-b^3 c\right ) \int \frac {b-a \tan (e+f x)}{a+b \tan (e+f x)}dx}{a^2+b^2}+\frac {x \left (a^3 c+3 a^2 b d-3 a b^2 c-b^3 d\right )}{a^2+b^2}}{a^2+b^2}-\frac {a^2 (-d)+2 a b c+b^2 d}{f \left (a^2+b^2\right ) (a+b \tan (e+f x))}}{a^2+b^2}-\frac {b c-a d}{2 f \left (a^2+b^2\right ) (a+b \tan (e+f x))^2}\) |
\(\Big \downarrow \) 4013 |
\(\displaystyle \frac {\frac {\frac {\left (a^3 (-d)+3 a^2 b c+3 a b^2 d-b^3 c\right ) \log (a \cos (e+f x)+b \sin (e+f x))}{f \left (a^2+b^2\right )}+\frac {x \left (a^3 c+3 a^2 b d-3 a b^2 c-b^3 d\right )}{a^2+b^2}}{a^2+b^2}-\frac {a^2 (-d)+2 a b c+b^2 d}{f \left (a^2+b^2\right ) (a+b \tan (e+f x))}}{a^2+b^2}-\frac {b c-a d}{2 f \left (a^2+b^2\right ) (a+b \tan (e+f x))^2}\) |
Input:
Int[(c + d*Tan[e + f*x])/(a + b*Tan[e + f*x])^3,x]
Output:
-1/2*(b*c - a*d)/((a^2 + b^2)*f*(a + b*Tan[e + f*x])^2) + ((((a^3*c - 3*a* b^2*c + 3*a^2*b*d - b^3*d)*x)/(a^2 + b^2) + ((3*a^2*b*c - b^3*c - a^3*d + 3*a*b^2*d)*Log[a*Cos[e + f*x] + b*Sin[e + f*x]])/((a^2 + b^2)*f))/(a^2 + b ^2) - (2*a*b*c - a^2*d + b^2*d)/((a^2 + b^2)*f*(a + b*Tan[e + f*x])))/(a^2 + b^2)
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*c - a*d)*((a + b*Tan[e + f*x])^(m + 1)/ (f*(m + 1)*(a^2 + b^2))), x] + Simp[1/(a^2 + b^2) Int[(a + b*Tan[e + f*x] )^(m + 1)*Simp[a*c + b*d - (b*c - a*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a , b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && LtQ[m, -1 ]
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]
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]
Time = 0.22 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.18
method | result | size |
derivativedivides | \(\frac {-\frac {\left (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}+\frac {a d -b c}{2 \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )^{2}}+\frac {a^{2} d -2 a b c -b^{2} d}{\left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (f x +e \right )\right )}+\frac {\frac {\left (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (a^{3} c +3 a^{2} b d -3 a \,b^{2} c -b^{3} d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}}{f}\) | \(206\) |
default | \(\frac {-\frac {\left (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}+\frac {a d -b c}{2 \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )^{2}}+\frac {a^{2} d -2 a b c -b^{2} d}{\left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (f x +e \right )\right )}+\frac {\frac {\left (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (a^{3} c +3 a^{2} b d -3 a \,b^{2} c -b^{3} d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3}}}{f}\) | \(206\) |
norman | \(\frac {\frac {\left (a^{3} c +3 a^{2} b d -3 a \,b^{2} c -b^{3} d \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 a^{2} b d -3 a \,b^{2} c -b^{3} d \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 {2 a^{3} b d -3 a^{2} b^{2} c -b^{4} c}{2 b f \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {b \left (-a^{2} b d +2 a \,b^{2} c +b^{3} d \right ) \tan \left (f x +e \right )^{2}}{2 f a \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {2 b \left (a^{3} c +3 a^{2} b d -3 a \,b^{2} c -b^{3} d \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 (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \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 (a^{3} d -3 a^{2} b c -3 a \,b^{2} d +b^{3} c \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 )}\) | \(435\) |
risch | \(\frac {i x d}{3 i a^{2} b -i b^{3}-a^{3}+3 a \,b^{2}}-\frac {x c}{3 i a^{2} b -i b^{3}-a^{3}+3 a \,b^{2}}+\frac {2 i a^{3} d x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}-\frac {6 i a^{2} b c x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}-\frac {6 i a \,b^{2} d x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}+\frac {2 i b^{3} c x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}+\frac {2 i a^{3} d e}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {6 i a^{2} b c e}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {6 i a \,b^{2} d e}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}+\frac {2 i b^{3} c e}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {2 i \left (-i a^{2} b^{2} d \,{\mathrm e}^{2 i \left (f x +e \right )}+2 i a \,b^{3} c \,{\mathrm e}^{2 i \left (f x +e \right )}-b^{4} c \,{\mathrm e}^{2 i \left (f x +e \right )}+2 i a^{2} b^{2} d -3 i a \,b^{3} c -a \,b^{3} d +i b^{4} d \,{\mathrm e}^{2 i \left (f x +e \right )}+2 a^{3} b d \,{\mathrm e}^{2 i \left (f x +e \right )}-3 a^{2} b^{2} c \,{\mathrm e}^{2 i \left (f x +e \right )}-i b^{4} d +2 a^{3} b d -3 a^{2} b^{2} c \right )}{\left (i b +a \right )^{2} \left (-i b \,{\mathrm e}^{2 i \left (f x +e \right )}+a \,{\mathrm e}^{2 i \left (f x +e \right )}+i b +a \right )^{2} f \left (-i b +a \right )^{3}}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) a^{3} d}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) a^{2} b c}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) a \,b^{2} d}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) b^{3} c}{f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}\) | \(803\) |
parallelrisch | \(\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right )^{2} a^{4} b^{3} d -3 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right )^{2} a^{3} b^{4} c -3 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right )^{2} a^{2} b^{5} d +\ln \left (1+\tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right )^{2} a \,b^{6} c -2 \ln \left (a +b \tan \left (f x +e \right )\right ) \tan \left (f x +e \right )^{2} a^{4} b^{3} d +6 \ln \left (a +b \tan \left (f x +e \right )\right ) \tan \left (f x +e \right )^{2} a^{3} b^{4} c +6 \ln \left (a +b \tan \left (f x +e \right )\right ) \tan \left (f x +e \right )^{2} a^{2} b^{5} d -2 \ln \left (a +b \tan \left (f x +e \right )\right ) \tan \left (f x +e \right )^{2} a \,b^{6} c +2 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right ) a^{5} b^{2} d -6 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right ) a^{4} b^{3} c -6 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right ) a^{3} b^{4} d +2 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right ) a^{2} b^{5} c -4 \ln \left (a +b \tan \left (f x +e \right )\right ) \tan \left (f x +e \right ) a^{5} b^{2} d +12 \ln \left (a +b \tan \left (f x +e \right )\right ) \tan \left (f x +e \right ) a^{4} b^{3} c +12 \ln \left (a +b \tan \left (f x +e \right )\right ) \tan \left (f x +e \right ) a^{3} b^{4} d -4 \ln \left (a +b \tan \left (f x +e \right )\right ) \tan \left (f x +e \right ) a^{2} b^{5} c +2 x \,a^{6} b c f +6 x \,a^{5} b^{2} d f -6 x \,a^{4} b^{3} c f -2 x \,a^{3} b^{4} d f +2 a^{6} b d -3 a^{5} b^{2} c -4 a^{3} b^{4} c -a \,b^{6} c +2 a^{4} b^{3} d +\ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{3} b^{4} c -2 \ln \left (a +b \tan \left (f x +e \right )\right ) a^{6} b d +6 \ln \left (a +b \tan \left (f x +e \right )\right ) a^{5} b^{2} c +6 \ln \left (a +b \tan \left (f x +e \right )\right ) a^{4} b^{3} d -2 \ln \left (a +b \tan \left (f x +e \right )\right ) a^{3} b^{4} c -\tan \left (f x +e \right )^{2} a^{4} b^{3} d +2 \tan \left (f x +e \right )^{2} a^{3} b^{4} c -2 x \tan \left (f x +e \right )^{2} a \,b^{6} d f +4 x \tan \left (f x +e \right ) a^{5} b^{2} c f +12 x \tan \left (f x +e \right ) a^{4} b^{3} d f -12 x \tan \left (f x +e \right ) a^{3} b^{4} c f -4 x \tan \left (f x +e \right ) a^{2} b^{5} d f +2 x \tan \left (f x +e \right )^{2} a^{4} b^{3} c f +6 x \tan \left (f x +e \right )^{2} a^{3} b^{4} d f -6 x \tan \left (f x +e \right )^{2} a^{2} b^{5} c f +\tan \left (f x +e \right )^{2} b^{7} d +2 \tan \left (f x +e \right )^{2} a \,b^{6} c +\ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{6} b d -3 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{5} b^{2} c -3 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{4} b^{3} d}{2 \left (a +b \tan \left (f x +e \right )\right )^{2} \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right ) a b f}\) | \(917\) |
Input:
int((c+d*tan(f*x+e))/(a+b*tan(f*x+e))^3,x,method=_RETURNVERBOSE)
Output:
1/f*(-(a^3*d-3*a^2*b*c-3*a*b^2*d+b^3*c)/(a^2+b^2)^3*ln(a+b*tan(f*x+e))+1/2 *(a*d-b*c)/(a^2+b^2)/(a+b*tan(f*x+e))^2+(a^2*d-2*a*b*c-b^2*d)/(a^2+b^2)^2/ (a+b*tan(f*x+e))+1/(a^2+b^2)^3*(1/2*(a^3*d-3*a^2*b*c-3*a*b^2*d+b^3*c)*ln(1 +tan(f*x+e)^2)+(a^3*c+3*a^2*b*d-3*a*b^2*c-b^3*d)*arctan(tan(f*x+e))))
Leaf count of result is larger than twice the leaf count of optimal. 501 vs. \(2 (173) = 346\).
Time = 0.13 (sec) , antiderivative size = 501, normalized size of antiderivative = 2.86 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=\frac {2 \, {\left ({\left (a^{5} - 3 \, a^{3} b^{2}\right )} c + {\left (3 \, a^{4} b - a^{2} b^{3}\right )} d\right )} f x + {\left (2 \, {\left ({\left (a^{3} b^{2} - 3 \, a b^{4}\right )} c + {\left (3 \, a^{2} b^{3} - b^{5}\right )} d\right )} f x + {\left (5 \, a^{2} b^{3} - b^{5}\right )} c - 3 \, {\left (a^{3} b^{2} - a b^{4}\right )} d\right )} \tan \left (f x + e\right )^{2} - {\left (7 \, a^{2} b^{3} + b^{5}\right )} c + {\left (5 \, a^{3} b^{2} - a b^{4}\right )} d + {\left ({\left ({\left (3 \, a^{2} b^{3} - b^{5}\right )} c - {\left (a^{3} b^{2} - 3 \, a b^{4}\right )} d\right )} \tan \left (f x + e\right )^{2} + {\left (3 \, a^{4} b - a^{2} b^{3}\right )} c - {\left (a^{5} - 3 \, a^{3} b^{2}\right )} d + 2 \, {\left ({\left (3 \, a^{3} b^{2} - a b^{4}\right )} c - {\left (a^{4} b - 3 \, a^{2} b^{3}\right )} d\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) + 2 \, {\left (2 \, {\left ({\left (a^{4} b - 3 \, a^{2} b^{3}\right )} c + {\left (3 \, a^{3} b^{2} - a b^{4}\right )} d\right )} f x + 3 \, {\left (a^{3} b^{2} - a b^{4}\right )} c - {\left (2 \, a^{4} b - 3 \, a^{2} b^{3} + b^{5}\right )} d\right )} \tan \left (f x + e\right )}{2 \, {\left ({\left (a^{6} b^{2} + 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} + b^{8}\right )} f \tan \left (f x + e\right )^{2} + 2 \, {\left (a^{7} b + 3 \, a^{5} b^{3} + 3 \, a^{3} b^{5} + a b^{7}\right )} f \tan \left (f x + e\right ) + {\left (a^{8} + 3 \, a^{6} b^{2} + 3 \, a^{4} b^{4} + a^{2} b^{6}\right )} f\right )}} \] Input:
integrate((c+d*tan(f*x+e))/(a+b*tan(f*x+e))^3,x, algorithm="fricas")
Output:
1/2*(2*((a^5 - 3*a^3*b^2)*c + (3*a^4*b - a^2*b^3)*d)*f*x + (2*((a^3*b^2 - 3*a*b^4)*c + (3*a^2*b^3 - b^5)*d)*f*x + (5*a^2*b^3 - b^5)*c - 3*(a^3*b^2 - a*b^4)*d)*tan(f*x + e)^2 - (7*a^2*b^3 + b^5)*c + (5*a^3*b^2 - a*b^4)*d + (((3*a^2*b^3 - b^5)*c - (a^3*b^2 - 3*a*b^4)*d)*tan(f*x + e)^2 + (3*a^4*b - a^2*b^3)*c - (a^5 - 3*a^3*b^2)*d + 2*((3*a^3*b^2 - a*b^4)*c - (a^4*b - 3* a^2*b^3)*d)*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*(2*((a^4*b - 3*a^2*b^3)*c + (3*a^3*b^2 - a*b ^4)*d)*f*x + 3*(a^3*b^2 - a*b^4)*c - (2*a^4*b - 3*a^2*b^3 + b^5)*d)*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)
Exception generated. \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=\text {Exception raised: AttributeError} \] Input:
integrate((c+d*tan(f*x+e))/(a+b*tan(f*x+e))**3,x)
Output:
Exception raised: AttributeError >> 'NoneType' object has no attribute 'pr imitive'
Time = 0.13 (sec) , antiderivative size = 333, normalized size of antiderivative = 1.90 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=\frac {\frac {2 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c + {\left (3 \, a^{2} b - b^{3}\right )} d\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 - {\left (a^{3} - 3 \, a b^{2}\right )} d\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 - {\left (a^{3} - 3 \, a b^{2}\right )} d\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 + b^{3}\right )} c - {\left (3 \, a^{3} - a b^{2}\right )} d + 2 \, {\left (2 \, a b^{2} c - {\left (a^{2} b - b^{3}\right )} d\right )} \tan \left (f x + e\right )}{a^{6} + 2 \, a^{4} b^{2} + a^{2} b^{4} + {\left (a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}\right )} \tan \left (f x + e\right )^{2} + 2 \, {\left (a^{5} b + 2 \, a^{3} b^{3} + a b^{5}\right )} \tan \left (f x + e\right )}}{2 \, f} \] Input:
integrate((c+d*tan(f*x+e))/(a+b*tan(f*x+e))^3,x, algorithm="maxima")
Output:
1/2*(2*((a^3 - 3*a*b^2)*c + (3*a^2*b - b^3)*d)*(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 - (a^3 - 3*a*b^2)*d)*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 - (a ^3 - 3*a*b^2)*d)*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 + b^3)*c - (3*a^3 - a*b^2)*d + 2*(2*a*b^2*c - (a^2*b - b^3) *d)*tan(f*x + e))/(a^6 + 2*a^4*b^2 + a^2*b^4 + (a^4*b^2 + 2*a^2*b^4 + b^6) *tan(f*x + e)^2 + 2*(a^5*b + 2*a^3*b^3 + a*b^5)*tan(f*x + e)))/f
Time = 0.26 (sec) , antiderivative size = 316, normalized size of antiderivative = 1.81 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=\frac {{\left (a^{3} c - 3 \, a b^{2} c + 3 \, a^{2} b d - b^{3} d\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 - b^{3} c - a^{3} d + 3 \, a b^{2} d\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 - b^{4} c - a^{3} b d + 3 \, a b^{3} d\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 c + 6 \, a^{2} b^{3} c + b^{5} c - 3 \, a^{5} d - 2 \, a^{3} b^{2} d + a b^{4} d + 2 \, {\left (2 \, a^{3} b^{2} c + 2 \, a b^{4} c - a^{4} b d + b^{5} d\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} f} \] Input:
integrate((c+d*tan(f*x+e))/(a+b*tan(f*x+e))^3,x, algorithm="giac")
Output:
(a^3*c - 3*a*b^2*c + 3*a^2*b*d - b^3*d)*(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 - b^3*c - a^3*d + 3*a*b^2*d)*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 - b^4*c - a^3*b*d + 3*a*b^3*d)*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*c + 6*a^2*b^3*c + b^5*c - 3*a^5*d - 2*a^3*b^2*d + a*b^4*d + 2*(2*a^3*b^2*c + 2*a*b^4*c - a^4*b*d + b ^5*d)*tan(f*x + e))/((a^2 + b^2)^3*(b*tan(f*x + e) + a)^2*f)
Time = 2.69 (sec) , antiderivative size = 279, normalized size of antiderivative = 1.59 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx=-\frac {\ln \left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (\frac {a\,d-3\,b\,c}{{\left (a^2+b^2\right )}^2}-\frac {4\,b^2\,\left (a\,d-b\,c\right )}{{\left (a^2+b^2\right )}^3}\right )}{f}-\frac {\frac {-3\,d\,a^3+5\,c\,a^2\,b+d\,a\,b^2+c\,b^3}{2\,\left (a^4+2\,a^2\,b^2+b^4\right )}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-d\,a^2\,b+2\,c\,a\,b^2+d\,b^3\right )}{a^4+2\,a^2\,b^2+b^4}}{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 (-d+c\,1{}\mathrm {i}\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 (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (c-d\,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))/(a + b*tan(e + f*x))^3,x)
Output:
(log(tan(e + f*x) - 1i)*(c*1i - d))/(2*f*(3*a*b^2 - a^2*b*3i - a^3 + b^3*1 i)) - ((b^3*c - 3*a^3*d + 5*a^2*b*c + a*b^2*d)/(2*(a^4 + b^4 + 2*a^2*b^2)) + (tan(e + f*x)*(b^3*d + 2*a*b^2*c - a^2*b*d))/(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(a + b*tan(e + f* x))*((a*d - 3*b*c)/(a^2 + b^2)^2 - (4*b^2*(a*d - b*c))/(a^2 + b^2)^3))/f + (log(tan(e + f*x) + 1i)*(c - d*1i))/(2*f*(a*b^2*3i - 3*a^2*b - a^3*1i + b ^3))
Time = 0.24 (sec) , antiderivative size = 998, normalized size of antiderivative = 5.70 \[ \int \frac {c+d \tan (e+f x)}{(a+b \tan (e+f x))^3} \, dx =\text {Too large to display} \] Input:
int((c+d*tan(f*x+e))/(a+b*tan(f*x+e))^3,x)
Output:
(log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2*a**4*b**2*d - 3*log(tan(e + f*x) **2 + 1)*tan(e + f*x)**2*a**3*b**3*c - 3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2*a**2*b**4*d + log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2*a*b**5*c + 2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)*a**5*b*d - 6*log(tan(e + f*x)**2 + 1)*tan(e + f*x)*a**4*b**2*c - 6*log(tan(e + f*x)**2 + 1)*tan(e + f*x)*a** 3*b**3*d + 2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)*a**2*b**4*c + log(tan(e + f*x)**2 + 1)*a**6*d - 3*log(tan(e + f*x)**2 + 1)*a**5*b*c - 3*log(tan(e + f*x)**2 + 1)*a**4*b**2*d + log(tan(e + f*x)**2 + 1)*a**3*b**3*c - 2*log (tan(e + f*x)*b + a)*tan(e + f*x)**2*a**4*b**2*d + 6*log(tan(e + f*x)*b + a)*tan(e + f*x)**2*a**3*b**3*c + 6*log(tan(e + f*x)*b + a)*tan(e + f*x)**2 *a**2*b**4*d - 2*log(tan(e + f*x)*b + a)*tan(e + f*x)**2*a*b**5*c - 4*log( tan(e + f*x)*b + a)*tan(e + f*x)*a**5*b*d + 12*log(tan(e + f*x)*b + a)*tan (e + f*x)*a**4*b**2*c + 12*log(tan(e + f*x)*b + a)*tan(e + f*x)*a**3*b**3* d - 4*log(tan(e + f*x)*b + a)*tan(e + f*x)*a**2*b**4*c - 2*log(tan(e + f*x )*b + a)*a**6*d + 6*log(tan(e + f*x)*b + a)*a**5*b*c + 6*log(tan(e + f*x)* b + a)*a**4*b**2*d - 2*log(tan(e + f*x)*b + a)*a**3*b**3*c + 2*tan(e + f*x )**2*a**4*b**2*c*f*x - tan(e + f*x)**2*a**4*b**2*d + 2*tan(e + f*x)**2*a** 3*b**3*c + 6*tan(e + f*x)**2*a**3*b**3*d*f*x - 6*tan(e + f*x)**2*a**2*b**4 *c*f*x + 2*tan(e + f*x)**2*a*b**5*c - 2*tan(e + f*x)**2*a*b**5*d*f*x + tan (e + f*x)**2*b**6*d + 4*tan(e + f*x)*a**5*b*c*f*x + 12*tan(e + f*x)*a**...