Integrand size = 39, antiderivative size = 144 \[ \int (a+b \tan (d+e x)) \left (b^2+2 a b \tan (d+e x)+a^2 \tan ^2(d+e x)\right )^2 \, dx=a \left (a^2-3 b^2\right ) \left (a^2+b^2\right ) x+\frac {b \left (3 a^2-b^2\right ) \left (a^2+b^2\right ) \log (\cos (d+e x))}{e}-\frac {a \left (a^4-b^4\right ) \tan (d+e x)}{e}+\frac {b \left (a^2+b^2\right ) (b+a \tan (d+e x))^2}{2 e}+\frac {\left (a^2+b^2\right ) (b+a \tan (d+e x))^3}{3 e}+\frac {b (b+a \tan (d+e x))^4}{4 e} \]
[Out]
Time = 0.31 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.128, Rules used = {3789, 3609, 12, 3606, 3556} \[ \int (a+b \tan (d+e x)) \left (b^2+2 a b \tan (d+e x)+a^2 \tan ^2(d+e x)\right )^2 \, dx=-\frac {a \left (a^4-b^4\right ) \tan (d+e x)}{e}+\frac {\left (a^2+b^2\right ) (a \tan (d+e x)+b)^3}{3 e}+\frac {b \left (a^2+b^2\right ) (a \tan (d+e x)+b)^2}{2 e}+\frac {b \left (3 a^2-b^2\right ) \left (a^2+b^2\right ) \log (\cos (d+e x))}{e}+a x \left (a^2-3 b^2\right ) \left (a^2+b^2\right )+\frac {b (a \tan (d+e x)+b)^4}{4 e} \]
[In]
[Out]
Rule 12
Rule 3556
Rule 3606
Rule 3609
Rule 3789
Rubi steps \begin{align*} \text {integral}& = \frac {\int \left (2 a b+2 a^2 \tan (d+e x)\right )^4 (a+b \tan (d+e x)) \, dx}{16 a^4} \\ & = \frac {b (b+a \tan (d+e x))^4}{4 e}+\frac {\int 2 a \left (a^2+b^2\right ) \tan (d+e x) \left (2 a b+2 a^2 \tan (d+e x)\right )^3 \, dx}{16 a^4} \\ & = \frac {b (b+a \tan (d+e x))^4}{4 e}+\frac {\left (a^2+b^2\right ) \int \tan (d+e x) \left (2 a b+2 a^2 \tan (d+e x)\right )^3 \, dx}{8 a^3} \\ & = \frac {\left (a^2+b^2\right ) (b+a \tan (d+e x))^3}{3 e}+\frac {b (b+a \tan (d+e x))^4}{4 e}+\frac {\left (a^2+b^2\right ) \int \left (2 a b+2 a^2 \tan (d+e x)\right )^2 \left (-2 a^2+2 a b \tan (d+e x)\right ) \, dx}{8 a^3} \\ & = \frac {b \left (a^2+b^2\right ) (b+a \tan (d+e x))^2}{2 e}+\frac {\left (a^2+b^2\right ) (b+a \tan (d+e x))^3}{3 e}+\frac {b (b+a \tan (d+e x))^4}{4 e}+\frac {\left (a^2+b^2\right ) \int \left (2 a b+2 a^2 \tan (d+e x)\right ) \left (-8 a^3 b-4 a^2 \left (a^2-b^2\right ) \tan (d+e x)\right ) \, dx}{8 a^3} \\ & = a \left (a^2-3 b^2\right ) \left (a^2+b^2\right ) x-\frac {a \left (a^4-b^4\right ) \tan (d+e x)}{e}+\frac {b \left (a^2+b^2\right ) (b+a \tan (d+e x))^2}{2 e}+\frac {\left (a^2+b^2\right ) (b+a \tan (d+e x))^3}{3 e}+\frac {b (b+a \tan (d+e x))^4}{4 e}-\left (b \left (3 a^2-b^2\right ) \left (a^2+b^2\right )\right ) \int \tan (d+e x) \, dx \\ & = a \left (a^2-3 b^2\right ) \left (a^2+b^2\right ) x+\frac {b \left (3 a^2-b^2\right ) \left (a^2+b^2\right ) \log (\cos (d+e x))}{e}-\frac {a \left (a^4-b^4\right ) \tan (d+e x)}{e}+\frac {b \left (a^2+b^2\right ) (b+a \tan (d+e x))^2}{2 e}+\frac {\left (a^2+b^2\right ) (b+a \tan (d+e x))^3}{3 e}+\frac {b (b+a \tan (d+e x))^4}{4 e} \\ \end{align*}
Result contains complex when optimal does not.
Time = 1.72 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.06 \[ \int (a+b \tan (d+e x)) \left (b^2+2 a b \tan (d+e x)+a^2 \tan ^2(d+e x)\right )^2 \, dx=\frac {6 \left (a^2+b^2\right ) \left (-i (a-i b)^3 \log (i-\tan (d+e x))+i (a+i b)^3 \log (i+\tan (d+e x))\right )-12 a \left (a^4-2 a^2 b^2-4 b^4\right ) \tan (d+e x)+18 a^2 b \left (a^2+2 b^2\right ) \tan ^2(d+e x)+4 a^3 \left (a^2+4 b^2\right ) \tan ^3(d+e x)+3 a^4 b \tan ^4(d+e x)}{12 e} \]
[In]
[Out]
Time = 0.26 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.08
method | result | size |
norman | \(\left (a^{5}-2 a^{3} b^{2}-3 a \,b^{4}\right ) x -\frac {a \left (a^{4}-2 a^{2} b^{2}-4 b^{4}\right ) \tan \left (e x +d \right )}{e}+\frac {a^{3} \left (a^{2}+4 b^{2}\right ) \tan \left (e x +d \right )^{3}}{3 e}+\frac {a^{4} b \tan \left (e x +d \right )^{4}}{4 e}+\frac {3 a^{2} b \left (a^{2}+2 b^{2}\right ) \tan \left (e x +d \right )^{2}}{2 e}-\frac {b \left (3 a^{4}+2 a^{2} b^{2}-b^{4}\right ) \ln \left (1+\tan \left (e x +d \right )^{2}\right )}{2 e}\) | \(155\) |
derivativedivides | \(\frac {\frac {a^{4} b \tan \left (e x +d \right )^{4}}{4}+\frac {a^{5} \tan \left (e x +d \right )^{3}}{3}+\frac {4 a^{3} b^{2} \tan \left (e x +d \right )^{3}}{3}+\frac {3 a^{4} b \tan \left (e x +d \right )^{2}}{2}+3 a^{2} b^{3} \tan \left (e x +d \right )^{2}-\tan \left (e x +d \right ) a^{5}+2 \tan \left (e x +d \right ) a^{3} b^{2}+4 \tan \left (e x +d \right ) a \,b^{4}+\frac {\left (-3 a^{4} b -2 a^{2} b^{3}+b^{5}\right ) \ln \left (1+\tan \left (e x +d \right )^{2}\right )}{2}+\left (a^{5}-2 a^{3} b^{2}-3 a \,b^{4}\right ) \arctan \left (\tan \left (e x +d \right )\right )}{e}\) | \(173\) |
default | \(\frac {\frac {a^{4} b \tan \left (e x +d \right )^{4}}{4}+\frac {a^{5} \tan \left (e x +d \right )^{3}}{3}+\frac {4 a^{3} b^{2} \tan \left (e x +d \right )^{3}}{3}+\frac {3 a^{4} b \tan \left (e x +d \right )^{2}}{2}+3 a^{2} b^{3} \tan \left (e x +d \right )^{2}-\tan \left (e x +d \right ) a^{5}+2 \tan \left (e x +d \right ) a^{3} b^{2}+4 \tan \left (e x +d \right ) a \,b^{4}+\frac {\left (-3 a^{4} b -2 a^{2} b^{3}+b^{5}\right ) \ln \left (1+\tan \left (e x +d \right )^{2}\right )}{2}+\left (a^{5}-2 a^{3} b^{2}-3 a \,b^{4}\right ) \arctan \left (\tan \left (e x +d \right )\right )}{e}\) | \(173\) |
parallelrisch | \(-\frac {-3 a^{4} b \tan \left (e x +d \right )^{4}-4 a^{5} \tan \left (e x +d \right )^{3}-16 a^{3} b^{2} \tan \left (e x +d \right )^{3}-12 a^{5} e x +24 a^{3} b^{2} e x +36 a \,b^{4} e x -18 a^{4} b \tan \left (e x +d \right )^{2}-36 a^{2} b^{3} \tan \left (e x +d \right )^{2}+18 \ln \left (1+\tan \left (e x +d \right )^{2}\right ) a^{4} b +12 \ln \left (1+\tan \left (e x +d \right )^{2}\right ) a^{2} b^{3}-6 \ln \left (1+\tan \left (e x +d \right )^{2}\right ) b^{5}+12 \tan \left (e x +d \right ) a^{5}-24 \tan \left (e x +d \right ) a^{3} b^{2}-48 \tan \left (e x +d \right ) a \,b^{4}}{12 e}\) | \(194\) |
parts | \(a \,b^{4} x +\frac {\left (4 a^{2} b^{3}+b^{5}\right ) \ln \left (1+\tan \left (e x +d \right )^{2}\right )}{2 e}+\frac {\left (6 a^{3} b^{2}+4 a \,b^{4}\right ) \left (\tan \left (e x +d \right )-\arctan \left (\tan \left (e x +d \right )\right )\right )}{e}+\frac {\left (4 a^{4} b +6 a^{2} b^{3}\right ) \left (\frac {\tan \left (e x +d \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (e x +d \right )^{2}\right )}{2}\right )}{e}+\frac {\left (a^{5}+4 a^{3} b^{2}\right ) \left (\frac {\tan \left (e x +d \right )^{3}}{3}-\tan \left (e x +d \right )+\arctan \left (\tan \left (e x +d \right )\right )\right )}{e}+\frac {a^{4} b \left (\frac {\tan \left (e x +d \right )^{4}}{4}-\frac {\tan \left (e x +d \right )^{2}}{2}+\frac {\ln \left (1+\tan \left (e x +d \right )^{2}\right )}{2}\right )}{e}\) | \(198\) |
risch | \(-\frac {4 i a \left (3 a^{4} {\mathrm e}^{6 i \left (e x +d \right )}+3 a^{2} b^{2} {\mathrm e}^{6 i \left (e x +d \right )}-6 b^{4} {\mathrm e}^{6 i \left (e x +d \right )}+9 i a \,b^{3} {\mathrm e}^{6 i \left (e x +d \right )}+3 i a^{3} b \,{\mathrm e}^{2 i \left (e x +d \right )}+6 a^{4} {\mathrm e}^{4 i \left (e x +d \right )}-3 a^{2} b^{2} {\mathrm e}^{4 i \left (e x +d \right )}-18 b^{4} {\mathrm e}^{4 i \left (e x +d \right )}+9 i a^{3} b \,{\mathrm e}^{4 i \left (e x +d \right )}+9 i a \,b^{3} {\mathrm e}^{2 i \left (e x +d \right )}+5 a^{4} {\mathrm e}^{2 i \left (e x +d \right )}-7 a^{2} b^{2} {\mathrm e}^{2 i \left (e x +d \right )}-18 b^{4} {\mathrm e}^{2 i \left (e x +d \right )}+18 i a \,b^{3} {\mathrm e}^{4 i \left (e x +d \right )}+3 i a^{3} b \,{\mathrm e}^{6 i \left (e x +d \right )}+2 a^{4}-a^{2} b^{2}-6 b^{4}\right )}{3 e \left (1+{\mathrm e}^{2 i \left (e x +d \right )}\right )^{4}}-\frac {6 i b d \,a^{4}}{e}+i b^{5} x +a^{5} x -2 a^{3} b^{2} x -3 a \,b^{4} x -\frac {4 i b^{3} a^{2} d}{e}+\frac {2 i b^{5} d}{e}-3 i a^{4} b x -2 i a^{2} b^{3} x +\frac {3 b \ln \left (1+{\mathrm e}^{2 i \left (e x +d \right )}\right ) a^{4}}{e}+\frac {2 b^{3} \ln \left (1+{\mathrm e}^{2 i \left (e x +d \right )}\right ) a^{2}}{e}-\frac {b^{5} \ln \left (1+{\mathrm e}^{2 i \left (e x +d \right )}\right )}{e}\) | \(416\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.03 \[ \int (a+b \tan (d+e x)) \left (b^2+2 a b \tan (d+e x)+a^2 \tan ^2(d+e x)\right )^2 \, dx=\frac {3 \, a^{4} b \tan \left (e x + d\right )^{4} + 4 \, {\left (a^{5} + 4 \, a^{3} b^{2}\right )} \tan \left (e x + d\right )^{3} + 12 \, {\left (a^{5} - 2 \, a^{3} b^{2} - 3 \, a b^{4}\right )} e x + 18 \, {\left (a^{4} b + 2 \, a^{2} b^{3}\right )} \tan \left (e x + d\right )^{2} + 6 \, {\left (3 \, a^{4} b + 2 \, a^{2} b^{3} - b^{5}\right )} \log \left (\frac {1}{\tan \left (e x + d\right )^{2} + 1}\right ) - 12 \, {\left (a^{5} - 2 \, a^{3} b^{2} - 4 \, a b^{4}\right )} \tan \left (e x + d\right )}{12 \, e} \]
[In]
[Out]
Time = 0.16 (sec) , antiderivative size = 248, normalized size of antiderivative = 1.72 \[ \int (a+b \tan (d+e x)) \left (b^2+2 a b \tan (d+e x)+a^2 \tan ^2(d+e x)\right )^2 \, dx=\begin {cases} a^{5} x + \frac {a^{5} \tan ^{3}{\left (d + e x \right )}}{3 e} - \frac {a^{5} \tan {\left (d + e x \right )}}{e} - \frac {3 a^{4} b \log {\left (\tan ^{2}{\left (d + e x \right )} + 1 \right )}}{2 e} + \frac {a^{4} b \tan ^{4}{\left (d + e x \right )}}{4 e} + \frac {3 a^{4} b \tan ^{2}{\left (d + e x \right )}}{2 e} - 2 a^{3} b^{2} x + \frac {4 a^{3} b^{2} \tan ^{3}{\left (d + e x \right )}}{3 e} + \frac {2 a^{3} b^{2} \tan {\left (d + e x \right )}}{e} - \frac {a^{2} b^{3} \log {\left (\tan ^{2}{\left (d + e x \right )} + 1 \right )}}{e} + \frac {3 a^{2} b^{3} \tan ^{2}{\left (d + e x \right )}}{e} - 3 a b^{4} x + \frac {4 a b^{4} \tan {\left (d + e x \right )}}{e} + \frac {b^{5} \log {\left (\tan ^{2}{\left (d + e x \right )} + 1 \right )}}{2 e} & \text {for}\: e \neq 0 \\x \left (a + b \tan {\left (d \right )}\right ) \left (a^{2} \tan ^{2}{\left (d \right )} + 2 a b \tan {\left (d \right )} + b^{2}\right )^{2} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.04 \[ \int (a+b \tan (d+e x)) \left (b^2+2 a b \tan (d+e x)+a^2 \tan ^2(d+e x)\right )^2 \, dx=\frac {3 \, a^{4} b \tan \left (e x + d\right )^{4} + 4 \, {\left (a^{5} + 4 \, a^{3} b^{2}\right )} \tan \left (e x + d\right )^{3} + 18 \, {\left (a^{4} b + 2 \, a^{2} b^{3}\right )} \tan \left (e x + d\right )^{2} + 12 \, {\left (a^{5} - 2 \, a^{3} b^{2} - 3 \, a b^{4}\right )} {\left (e x + d\right )} - 6 \, {\left (3 \, a^{4} b + 2 \, a^{2} b^{3} - b^{5}\right )} \log \left (\tan \left (e x + d\right )^{2} + 1\right ) - 12 \, {\left (a^{5} - 2 \, a^{3} b^{2} - 4 \, a b^{4}\right )} \tan \left (e x + d\right )}{12 \, e} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 2007 vs. \(2 (138) = 276\).
Time = 2.43 (sec) , antiderivative size = 2007, normalized size of antiderivative = 13.94 \[ \int (a+b \tan (d+e x)) \left (b^2+2 a b \tan (d+e x)+a^2 \tan ^2(d+e x)\right )^2 \, dx=\text {Too large to display} \]
[In]
[Out]
Time = 27.08 (sec) , antiderivative size = 205, normalized size of antiderivative = 1.42 \[ \int (a+b \tan (d+e x)) \left (b^2+2 a b \tan (d+e x)+a^2 \tan ^2(d+e x)\right )^2 \, dx=\frac {{\mathrm {tan}\left (d+e\,x\right )}^3\,\left (\frac {a^5}{3}+\frac {4\,a^3\,b^2}{3}\right )}{e}+\frac {\mathrm {tan}\left (d+e\,x\right )\,\left (-a^5+2\,a^3\,b^2+4\,a\,b^4\right )}{e}-\frac {\ln \left ({\mathrm {tan}\left (d+e\,x\right )}^2+1\right )\,\left (\frac {3\,a^4\,b}{2}+a^2\,b^3-\frac {b^5}{2}\right )}{e}+\frac {{\mathrm {tan}\left (d+e\,x\right )}^2\,\left (\frac {3\,a^4\,b}{2}+3\,a^2\,b^3\right )}{e}+\frac {a^4\,b\,{\mathrm {tan}\left (d+e\,x\right )}^4}{4\,e}-\frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (d+e\,x\right )\,\left (a^2-3\,b^2\right )\,\left (a^2+b^2\right )}{-a^5+2\,a^3\,b^2+3\,a\,b^4}\right )\,\left (a^2-3\,b^2\right )\,\left (a^2+b^2\right )}{e} \]
[In]
[Out]