Integrand size = 14, antiderivative size = 96 \[ \int (c+d x)^2 \tan (a+b x) \, dx=\frac {i (c+d x)^3}{3 d}-\frac {(c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac {i d (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}-\frac {d^2 \operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{2 b^3} \] Output:
1/3*I*(d*x+c)^3/d-(d*x+c)^2*ln(1+exp(2*I*(b*x+a)))/b+I*d*(d*x+c)*polylog(2 ,-exp(2*I*(b*x+a)))/b^2-1/2*d^2*polylog(3,-exp(2*I*(b*x+a)))/b^3
Time = 0.03 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.04 \[ \int (c+d x)^2 \tan (a+b x) \, dx=\frac {2 i b^2 (c+d x)^2 \left (b (c+d x)+3 i d \log \left (1+e^{2 i (a+b x)}\right )\right )+6 i b d^2 (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )-3 d^3 \operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{6 b^3 d} \] Input:
Integrate[(c + d*x)^2*Tan[a + b*x],x]
Output:
((2*I)*b^2*(c + d*x)^2*(b*(c + d*x) + (3*I)*d*Log[1 + E^((2*I)*(a + b*x))] ) + (6*I)*b*d^2*(c + d*x)*PolyLog[2, -E^((2*I)*(a + b*x))] - 3*d^3*PolyLog [3, -E^((2*I)*(a + b*x))])/(6*b^3*d)
Time = 0.50 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.18, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3042, 4202, 2620, 3011, 2720, 7143}
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 (c+d x)^2 \tan (a+b x) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x)^2 \tan (a+b x)dx\) |
\(\Big \downarrow \) 4202 |
\(\displaystyle \frac {i (c+d x)^3}{3 d}-2 i \int \frac {e^{2 i (a+b x)} (c+d x)^2}{1+e^{2 i (a+b x)}}dx\) |
\(\Big \downarrow \) 2620 |
\(\displaystyle \frac {i (c+d x)^3}{3 d}-2 i \left (\frac {i d \int (c+d x) \log \left (1+e^{2 i (a+b x)}\right )dx}{b}-\frac {i (c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{2 b}\right )\) |
\(\Big \downarrow \) 3011 |
\(\displaystyle \frac {i (c+d x)^3}{3 d}-2 i \left (\frac {i d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{2 b}-\frac {i d \int \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )dx}{2 b}\right )}{b}-\frac {i (c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{2 b}\right )\) |
\(\Big \downarrow \) 2720 |
\(\displaystyle \frac {i (c+d x)^3}{3 d}-2 i \left (\frac {i d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{2 b}-\frac {d \int e^{-2 i (a+b x)} \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )de^{2 i (a+b x)}}{4 b^2}\right )}{b}-\frac {i (c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{2 b}\right )\) |
\(\Big \downarrow \) 7143 |
\(\displaystyle \frac {i (c+d x)^3}{3 d}-2 i \left (\frac {i d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{2 b}-\frac {d \operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{4 b^2}\right )}{b}-\frac {i (c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{2 b}\right )\) |
Input:
Int[(c + d*x)^2*Tan[a + b*x],x]
Output:
((I/3)*(c + d*x)^3)/d - (2*I)*(((-1/2*I)*(c + d*x)^2*Log[1 + E^((2*I)*(a + b*x))])/b + (I*d*(((I/2)*(c + d*x)*PolyLog[2, -E^((2*I)*(a + b*x))])/b - (d*PolyLog[3, -E^((2*I)*(a + b*x))])/(4*b^2)))/b)
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ ((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp [((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si mp[d*(m/(b*f*g*n*Log[F])) Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x )))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Simp[v/D[v, x] Subst[Int[FunctionOfExponentialFunction[u, x]/x, x], x, v], x]] /; Funct ionOfExponentialQ[u, x] && !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; FreeQ [{a, m, n}, x] && IntegerQ[m*n]] && !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x)) *(F_)[v_] /; FreeQ[{a, b, c}, x] && InverseFunctionQ[F[x]]]
Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.) *(x_))^(m_.), x_Symbol] :> Simp[(-(f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + b*x)))^n]/(b*c*n*Log[F])), x] + Simp[g*(m/(b*c*n*Log[F])) Int[(f + g*x)^( m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e , f, g, n}, x] && GtQ[m, 0]
Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[I *((c + d*x)^(m + 1)/(d*(m + 1))), x] - Simp[2*I Int[(c + d*x)^m*(E^(2*I*( e + f*x))/(1 + E^(2*I*(e + f*x)))), x], x] /; FreeQ[{c, d, e, f}, x] && IGt Q[m, 0]
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_S ymbol] :> Simp[PolyLog[n + 1, c*(a + b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d , e, n, p}, x] && EqQ[b*d, a*e]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 265 vs. \(2 (84 ) = 168\).
Time = 0.34 (sec) , antiderivative size = 266, normalized size of antiderivative = 2.77
method | result | size |
risch | \(\frac {4 i c d a x}{b}-\frac {4 i d^{2} a^{3}}{3 b^{3}}+\frac {2 i c d \,a^{2}}{b^{2}}-\frac {i c^{3}}{3 d}-\frac {4 c d a \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {c^{2} \ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}{b}+\frac {2 c^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b}-\frac {2 i d^{2} a^{2} x}{b^{2}}+\frac {i d^{2} x^{3}}{3}+i d c \,x^{2}-i c^{2} x -\frac {d^{2} \ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right ) x^{2}}{b}-\frac {d^{2} \operatorname {polylog}\left (3, -{\mathrm e}^{2 i \left (b x +a \right )}\right )}{2 b^{3}}+\frac {i d c \operatorname {polylog}\left (2, -{\mathrm e}^{2 i \left (b x +a \right )}\right )}{b^{2}}-\frac {2 d c \ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right ) x}{b}+\frac {i d^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{2 i \left (b x +a \right )}\right ) x}{b^{2}}+\frac {2 d^{2} a^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}\) | \(266\) |
Input:
int((d*x+c)^2*tan(b*x+a),x,method=_RETURNVERBOSE)
Output:
4*I/b*c*d*a*x-4/3*I/b^3*d^2*a^3+2*I/b^2*c*d*a^2-1/3*I/d*c^3-4/b^2*c*d*a*ln (exp(I*(b*x+a)))-1/b*c^2*ln(exp(2*I*(b*x+a))+1)+2/b*c^2*ln(exp(I*(b*x+a))) -2*I/b^2*d^2*a^2*x+1/3*I*d^2*x^3+I*d*c*x^2-I*c^2*x-1/b*d^2*ln(exp(2*I*(b*x +a))+1)*x^2-1/2*d^2*polylog(3,-exp(2*I*(b*x+a)))/b^3+I/b^2*d*c*polylog(2,- exp(2*I*(b*x+a)))-2/b*d*c*ln(exp(2*I*(b*x+a))+1)*x+I/b^2*d^2*polylog(2,-ex p(2*I*(b*x+a)))*x+2/b^3*d^2*a^2*ln(exp(I*(b*x+a)))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 270 vs. \(2 (81) = 162\).
Time = 0.08 (sec) , antiderivative size = 270, normalized size of antiderivative = 2.81 \[ \int (c+d x)^2 \tan (a+b x) \, dx=-\frac {d^{2} {\rm polylog}\left (3, \frac {\tan \left (b x + a\right )^{2} + 2 i \, \tan \left (b x + a\right ) - 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + d^{2} {\rm polylog}\left (3, \frac {\tan \left (b x + a\right )^{2} - 2 i \, \tan \left (b x + a\right ) - 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, {\left (i \, b d^{2} x + i \, b c d\right )} {\rm Li}_2\left (\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) + 2 \, {\left (-i \, b d^{2} x - i \, b c d\right )} {\rm Li}_2\left (\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) + 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (-\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (-\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right )}{4 \, b^{3}} \] Input:
integrate((d*x+c)^2*tan(b*x+a),x, algorithm="fricas")
Output:
-1/4*(d^2*polylog(3, (tan(b*x + a)^2 + 2*I*tan(b*x + a) - 1)/(tan(b*x + a) ^2 + 1)) + d^2*polylog(3, (tan(b*x + a)^2 - 2*I*tan(b*x + a) - 1)/(tan(b*x + a)^2 + 1)) + 2*(I*b*d^2*x + I*b*c*d)*dilog(2*(I*tan(b*x + a) - 1)/(tan( b*x + a)^2 + 1) + 1) + 2*(-I*b*d^2*x - I*b*c*d)*dilog(2*(-I*tan(b*x + a) - 1)/(tan(b*x + a)^2 + 1) + 1) + 2*(b^2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2)*lo g(-2*(I*tan(b*x + a) - 1)/(tan(b*x + a)^2 + 1)) + 2*(b^2*d^2*x^2 + 2*b^2*c *d*x + b^2*c^2)*log(-2*(-I*tan(b*x + a) - 1)/(tan(b*x + a)^2 + 1)))/b^3
\[ \int (c+d x)^2 \tan (a+b x) \, dx=\int \left (c + d x\right )^{2} \tan {\left (a + b x \right )}\, dx \] Input:
integrate((d*x+c)**2*tan(b*x+a),x)
Output:
Integral((c + d*x)**2*tan(a + b*x), x)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 267 vs. \(2 (81) = 162\).
Time = 0.18 (sec) , antiderivative size = 267, normalized size of antiderivative = 2.78 \[ \int (c+d x)^2 \tan (a+b x) \, dx=\frac {6 \, c^{2} \log \left (\sec \left (b x + a\right )\right ) - \frac {12 \, a c d \log \left (\sec \left (b x + a\right )\right )}{b} + \frac {6 \, a^{2} d^{2} \log \left (\sec \left (b x + a\right )\right )}{b^{2}} - \frac {-2 i \, {\left (b x + a\right )}^{3} d^{2} - 6 \, {\left (i \, b c d - i \, a d^{2}\right )} {\left (b x + a\right )}^{2} + 3 \, d^{2} {\rm Li}_{3}(-e^{\left (2 i \, b x + 2 i \, a\right )}) - 6 \, {\left (-i \, {\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (-i \, b c d + i \, a d^{2}\right )} {\left (b x + a\right )}\right )} \arctan \left (\sin \left (2 \, b x + 2 \, a\right ), \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) - 6 \, {\left (i \, b c d + i \, {\left (b x + a\right )} d^{2} - i \, a d^{2}\right )} {\rm Li}_2\left (-e^{\left (2 i \, b x + 2 i \, a\right )}\right ) + 3 \, {\left ({\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (b c d - a d^{2}\right )} {\left (b x + a\right )}\right )} \log \left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right )}{b^{2}}}{6 \, b} \] Input:
integrate((d*x+c)^2*tan(b*x+a),x, algorithm="maxima")
Output:
1/6*(6*c^2*log(sec(b*x + a)) - 12*a*c*d*log(sec(b*x + a))/b + 6*a^2*d^2*lo g(sec(b*x + a))/b^2 - (-2*I*(b*x + a)^3*d^2 - 6*(I*b*c*d - I*a*d^2)*(b*x + a)^2 + 3*d^2*polylog(3, -e^(2*I*b*x + 2*I*a)) - 6*(-I*(b*x + a)^2*d^2 + 2 *(-I*b*c*d + I*a*d^2)*(b*x + a))*arctan2(sin(2*b*x + 2*a), cos(2*b*x + 2*a ) + 1) - 6*(I*b*c*d + I*(b*x + a)*d^2 - I*a*d^2)*dilog(-e^(2*I*b*x + 2*I*a )) + 3*((b*x + a)^2*d^2 + 2*(b*c*d - a*d^2)*(b*x + a))*log(cos(2*b*x + 2*a )^2 + sin(2*b*x + 2*a)^2 + 2*cos(2*b*x + 2*a) + 1))/b^2)/b
\[ \int (c+d x)^2 \tan (a+b x) \, dx=\int { {\left (d x + c\right )}^{2} \tan \left (b x + a\right ) \,d x } \] Input:
integrate((d*x+c)^2*tan(b*x+a),x, algorithm="giac")
Output:
integrate((d*x + c)^2*tan(b*x + a), x)
Timed out. \[ \int (c+d x)^2 \tan (a+b x) \, dx=\int \mathrm {tan}\left (a+b\,x\right )\,{\left (c+d\,x\right )}^2 \,d x \] Input:
int(tan(a + b*x)*(c + d*x)^2,x)
Output:
int(tan(a + b*x)*(c + d*x)^2, x)
\[ \int (c+d x)^2 \tan (a+b x) \, dx=\frac {2 \left (\int \tan \left (b x +a \right ) x^{2}d x \right ) b \,d^{2}+4 \left (\int \tan \left (b x +a \right ) x d x \right ) b c d +\mathrm {log}\left (\tan \left (b x +a \right )^{2}+1\right ) c^{2}}{2 b} \] Input:
int((d*x+c)^2*tan(b*x+a),x)
Output:
(2*int(tan(a + b*x)*x**2,x)*b*d**2 + 4*int(tan(a + b*x)*x,x)*b*c*d + log(t an(a + b*x)**2 + 1)*c**2)/(2*b)