Integrand size = 21, antiderivative size = 78 \[ \int \frac {\sec ^2(x) (a+b \tan (x))^3}{c+d \tan (x)} \, dx=-\frac {(b c-a d)^3 \log (c+d \tan (x))}{d^4}+\frac {b (b c-a d)^2 \tan (x)}{d^3}-\frac {(b c-a d) (a+b \tan (x))^2}{2 d^2}+\frac {(a+b \tan (x))^3}{3 d} \]
-(-a*d+b*c)^3*ln(c+d*tan(x))/d^4+b*(-a*d+b*c)^2*tan(x)/d^3-1/2*(-a*d+b*c)* (a+b*tan(x))^2/d^2+1/3*(a+b*tan(x))^3/d
Time = 0.46 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.56 \[ \int \frac {\sec ^2(x) (a+b \tan (x))^3}{c+d \tan (x)} \, dx=\frac {(c \cos (x)+d \sin (x)) (a+b \tan (x))^3 \left (-6 (b c-a d)^3 \cos ^2(x) \log (c+d \tan (x))+6 b^3 c^2 d \cos (x) \sin (x)+b d^2 \left (9 a (-b c+a d) \sin (2 x)+b \left (-3 b c+9 a d+2 b d \sin ^2(x) \tan (x)\right )\right )\right )}{6 d^4 (a \cos (x)+b \sin (x))^3 (c+d \tan (x))} \]
((c*Cos[x] + d*Sin[x])*(a + b*Tan[x])^3*(-6*(b*c - a*d)^3*Cos[x]^2*Log[c + d*Tan[x]] + 6*b^3*c^2*d*Cos[x]*Sin[x] + b*d^2*(9*a*(-(b*c) + a*d)*Sin[2*x ] + b*(-3*b*c + 9*a*d + 2*b*d*Sin[x]^2*Tan[x]))))/(6*d^4*(a*Cos[x] + b*Sin [x])^3*(c + d*Tan[x]))
Time = 0.34 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 4842, 49, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sec ^2(x) (a+b \tan (x))^3}{c+d \tan (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sec (x)^2 (a+b \tan (x))^3}{c+d \tan (x)}dx\) |
\(\Big \downarrow \) 4842 |
\(\displaystyle \int \frac {(a+b \tan (x))^3}{c+d \tan (x)}d\tan (x)\) |
\(\Big \downarrow \) 49 |
\(\displaystyle \int \left (\frac {(a d-b c)^3}{d^3 (c+d \tan (x))}+\frac {b (b c-a d)^2}{d^3}-\frac {b (b c-a d) (a+b \tan (x))}{d^2}+\frac {b (a+b \tan (x))^2}{d}\right )d\tan (x)\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {(b c-a d)^3 \log (c+d \tan (x))}{d^4}+\frac {b \tan (x) (b c-a d)^2}{d^3}-\frac {(b c-a d) (a+b \tan (x))^2}{2 d^2}+\frac {(a+b \tan (x))^3}{3 d}\) |
-(((b*c - a*d)^3*Log[c + d*Tan[x]])/d^4) + (b*(b*c - a*d)^2*Tan[x])/d^3 - ((b*c - a*d)*(a + b*Tan[x])^2)/(2*d^2) + (a + b*Tan[x])^3/(3*d)
3.8.3.3.1 Defintions of rubi rules used
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int [ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && IGtQ[m, 0] && IGtQ[m + n + 2, 0]
Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))]^2, x_Symbol] :> With[{d = FreeFac tors[Tan[c*(a + b*x)], x]}, Simp[d/(b*c) Subst[Int[SubstFor[1, Tan[c*(a + b*x)]/d, u, x], x], x, Tan[c*(a + b*x)]/d], x] /; FunctionOfQ[Tan[c*(a + b *x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && NonsumQ[u] && (EqQ[F, Sec] | | EqQ[F, sec])
Time = 3.90 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.49
method | result | size |
derivativedivides | \(\frac {b \left (\frac {b^{2} \tan \left (x \right )^{3} d^{2}}{3}+\frac {3 a b \,d^{2} \tan \left (x \right )^{2}}{2}-\frac {b^{2} c d \tan \left (x \right )^{2}}{2}+3 \tan \left (x \right ) d^{2} a^{2}-3 \tan \left (x \right ) c d a b +\tan \left (x \right ) b^{2} c^{2}\right )}{d^{3}}+\frac {\left (d^{3} a^{3}-3 c \,d^{2} a^{2} b +3 c^{2} d a \,b^{2}-b^{3} c^{3}\right ) \ln \left (c +d \tan \left (x \right )\right )}{d^{4}}\) | \(116\) |
default | \(\frac {b \left (\frac {b^{2} \tan \left (x \right )^{3} d^{2}}{3}+\frac {3 a b \,d^{2} \tan \left (x \right )^{2}}{2}-\frac {b^{2} c d \tan \left (x \right )^{2}}{2}+3 \tan \left (x \right ) d^{2} a^{2}-3 \tan \left (x \right ) c d a b +\tan \left (x \right ) b^{2} c^{2}\right )}{d^{3}}+\frac {\left (d^{3} a^{3}-3 c \,d^{2} a^{2} b +3 c^{2} d a \,b^{2}-b^{3} c^{3}\right ) \ln \left (c +d \tan \left (x \right )\right )}{d^{4}}\) | \(116\) |
risch | \(\frac {2 i b \left (9 a^{2} d^{2} {\mathrm e}^{4 i x}-9 a b c d \,{\mathrm e}^{4 i x}+3 b^{2} c^{2} {\mathrm e}^{4 i x}-3 b^{2} d^{2} {\mathrm e}^{4 i x}-9 i a b \,d^{2} {\mathrm e}^{4 i x}+3 i b^{2} c d \,{\mathrm e}^{4 i x}+18 a^{2} d^{2} {\mathrm e}^{2 i x}-18 a b c d \,{\mathrm e}^{2 i x}+6 b^{2} c^{2} {\mathrm e}^{2 i x}-9 i a b \,d^{2} {\mathrm e}^{2 i x}+3 i b^{2} c d \,{\mathrm e}^{2 i x}+9 d^{2} a^{2}-9 c d a b +3 b^{2} c^{2}-b^{2} d^{2}\right )}{3 d^{3} \left ({\mathrm e}^{2 i x}+1\right )^{3}}-\frac {\ln \left ({\mathrm e}^{2 i x}+1\right ) a^{3}}{d}+\frac {3 \ln \left ({\mathrm e}^{2 i x}+1\right ) c \,a^{2} b}{d^{2}}-\frac {3 \ln \left ({\mathrm e}^{2 i x}+1\right ) c^{2} a \,b^{2}}{d^{3}}+\frac {\ln \left ({\mathrm e}^{2 i x}+1\right ) b^{3} c^{3}}{d^{4}}+\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {i d +c}{i d -c}\right ) a^{3}}{d}-\frac {3 \ln \left ({\mathrm e}^{2 i x}-\frac {i d +c}{i d -c}\right ) c \,a^{2} b}{d^{2}}+\frac {3 \ln \left ({\mathrm e}^{2 i x}-\frac {i d +c}{i d -c}\right ) c^{2} a \,b^{2}}{d^{3}}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {i d +c}{i d -c}\right ) b^{3} c^{3}}{d^{4}}\) | \(400\) |
b/d^3*(1/3*b^2*tan(x)^3*d^2+3/2*a*b*d^2*tan(x)^2-1/2*b^2*c*d*tan(x)^2+3*ta n(x)*d^2*a^2-3*tan(x)*c*d*a*b+tan(x)*b^2*c^2)+(a^3*d^3-3*a^2*b*c*d^2+3*a*b ^2*c^2*d-b^3*c^3)/d^4*ln(c+d*tan(x))
Leaf count of result is larger than twice the leaf count of optimal. 201 vs. \(2 (74) = 148\).
Time = 0.30 (sec) , antiderivative size = 201, normalized size of antiderivative = 2.58 \[ \int \frac {\sec ^2(x) (a+b \tan (x))^3}{c+d \tan (x)} \, dx=-\frac {3 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \cos \left (x\right )^{3} \log \left (2 \, c d \cos \left (x\right ) \sin \left (x\right ) + {\left (c^{2} - d^{2}\right )} \cos \left (x\right )^{2} + d^{2}\right ) - 3 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \cos \left (x\right )^{3} \log \left (\cos \left (x\right )^{2}\right ) + 3 \, {\left (b^{3} c d^{2} - 3 \, a b^{2} d^{3}\right )} \cos \left (x\right ) - 2 \, {\left (b^{3} d^{3} + {\left (3 \, b^{3} c^{2} d - 9 \, a b^{2} c d^{2} + {\left (9 \, a^{2} b - b^{3}\right )} d^{3}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{6 \, d^{4} \cos \left (x\right )^{3}} \]
-1/6*(3*(b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d^3)*cos(x)^3*log(2 *c*d*cos(x)*sin(x) + (c^2 - d^2)*cos(x)^2 + d^2) - 3*(b^3*c^3 - 3*a*b^2*c^ 2*d + 3*a^2*b*c*d^2 - a^3*d^3)*cos(x)^3*log(cos(x)^2) + 3*(b^3*c*d^2 - 3*a *b^2*d^3)*cos(x) - 2*(b^3*d^3 + (3*b^3*c^2*d - 9*a*b^2*c*d^2 + (9*a^2*b - b^3)*d^3)*cos(x)^2)*sin(x))/(d^4*cos(x)^3)
Time = 2.84 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.22 \[ \int \frac {\sec ^2(x) (a+b \tan (x))^3}{c+d \tan (x)} \, dx=\frac {b^{3} \tan ^{3}{\left (x \right )}}{3 d} + \frac {\left (3 a b^{2} d - b^{3} c\right ) \tan ^{2}{\left (x \right )}}{2 d^{2}} + \frac {\left (a d - b c\right )^{3} \left (\begin {cases} \frac {\tan {\left (x \right )}}{c} & \text {for}\: d = 0 \\\frac {\log {\left (c + d \tan {\left (x \right )} \right )}}{d} & \text {otherwise} \end {cases}\right )}{d^{3}} + \frac {\left (3 a^{2} b d^{2} - 3 a b^{2} c d + b^{3} c^{2}\right ) \tan {\left (x \right )}}{d^{3}} \]
b**3*tan(x)**3/(3*d) + (3*a*b**2*d - b**3*c)*tan(x)**2/(2*d**2) + (a*d - b *c)**3*Piecewise((tan(x)/c, Eq(d, 0)), (log(c + d*tan(x))/d, True))/d**3 + (3*a**2*b*d**2 - 3*a*b**2*c*d + b**3*c**2)*tan(x)/d**3
Time = 0.21 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.51 \[ \int \frac {\sec ^2(x) (a+b \tan (x))^3}{c+d \tan (x)} \, dx=\frac {2 \, b^{3} d^{2} \tan \left (x\right )^{3} - 3 \, {\left (b^{3} c d - 3 \, a b^{2} d^{2}\right )} \tan \left (x\right )^{2} + 6 \, {\left (b^{3} c^{2} - 3 \, a b^{2} c d + 3 \, a^{2} b d^{2}\right )} \tan \left (x\right )}{6 \, d^{3}} - \frac {{\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left (d \tan \left (x\right ) + c\right )}{d^{4}} \]
1/6*(2*b^3*d^2*tan(x)^3 - 3*(b^3*c*d - 3*a*b^2*d^2)*tan(x)^2 + 6*(b^3*c^2 - 3*a*b^2*c*d + 3*a^2*b*d^2)*tan(x))/d^3 - (b^3*c^3 - 3*a*b^2*c^2*d + 3*a^ 2*b*c*d^2 - a^3*d^3)*log(d*tan(x) + c)/d^4
Time = 0.28 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.58 \[ \int \frac {\sec ^2(x) (a+b \tan (x))^3}{c+d \tan (x)} \, dx=\frac {2 \, b^{3} d^{2} \tan \left (x\right )^{3} - 3 \, b^{3} c d \tan \left (x\right )^{2} + 9 \, a b^{2} d^{2} \tan \left (x\right )^{2} + 6 \, b^{3} c^{2} \tan \left (x\right ) - 18 \, a b^{2} c d \tan \left (x\right ) + 18 \, a^{2} b d^{2} \tan \left (x\right )}{6 \, d^{3}} - \frac {{\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left ({\left | d \tan \left (x\right ) + c \right |}\right )}{d^{4}} \]
1/6*(2*b^3*d^2*tan(x)^3 - 3*b^3*c*d*tan(x)^2 + 9*a*b^2*d^2*tan(x)^2 + 6*b^ 3*c^2*tan(x) - 18*a*b^2*c*d*tan(x) + 18*a^2*b*d^2*tan(x))/d^3 - (b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d^3)*log(abs(d*tan(x) + c))/d^4
Time = 28.90 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.56 \[ \int \frac {\sec ^2(x) (a+b \tan (x))^3}{c+d \tan (x)} \, dx=\mathrm {tan}\left (x\right )\,\left (\frac {3\,a^2\,b}{d}-\frac {c\,\left (\frac {3\,a\,b^2}{d}-\frac {b^3\,c}{d^2}\right )}{d}\right )+{\mathrm {tan}\left (x\right )}^2\,\left (\frac {3\,a\,b^2}{2\,d}-\frac {b^3\,c}{2\,d^2}\right )+\frac {b^3\,{\mathrm {tan}\left (x\right )}^3}{3\,d}+\frac {\ln \left (c+d\,\mathrm {tan}\left (x\right )\right )\,\left (a^3\,d^3-3\,a^2\,b\,c\,d^2+3\,a\,b^2\,c^2\,d-b^3\,c^3\right )}{d^4} \]