Integrand size = 16, antiderivative size = 82 \[ \int (c+d x)^2 \sec ^2(a+b x) \, dx=-\frac {i (c+d x)^2}{b}+\frac {2 d (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b^2}-\frac {i d^2 \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^3}+\frac {(c+d x)^2 \tan (a+b x)}{b} \] Output:
-I*(d*x+c)^2/b+2*d*(d*x+c)*ln(1+exp(2*I*(b*x+a)))/b^2-I*d^2*polylog(2,-exp (2*I*(b*x+a)))/b^3+(d*x+c)^2*tan(b*x+a)/b
Time = 0.28 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.91 \[ \int (c+d x)^2 \sec ^2(a+b x) \, dx=\frac {-i d^2 \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )+b (c+d x) \left (-i b (c+d x)+2 d \log \left (1+e^{2 i (a+b x)}\right )+b (c+d x) \tan (a+b x)\right )}{b^3} \] Input:
Integrate[(c + d*x)^2*Sec[a + b*x]^2,x]
Output:
((-I)*d^2*PolyLog[2, -E^((2*I)*(a + b*x))] + b*(c + d*x)*((-I)*b*(c + d*x) + 2*d*Log[1 + E^((2*I)*(a + b*x))] + b*(c + d*x)*Tan[a + b*x]))/b^3
Time = 0.48 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.18, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3042, 4672, 25, 3042, 4202, 2620, 2715, 2838}
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 \sec ^2(a+b x) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x)^2 \csc \left (a+b x+\frac {\pi }{2}\right )^2dx\) |
\(\Big \downarrow \) 4672 |
\(\displaystyle \frac {2 d \int -((c+d x) \tan (a+b x))dx}{b}+\frac {(c+d x)^2 \tan (a+b x)}{b}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {2 d \int (c+d x) \tan (a+b x)dx}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {2 d \int (c+d x) \tan (a+b x)dx}{b}\) |
\(\Big \downarrow \) 4202 |
\(\displaystyle \frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {2 d \left (\frac {i (c+d x)^2}{2 d}-2 i \int \frac {e^{2 i (a+b x)} (c+d x)}{1+e^{2 i (a+b x)}}dx\right )}{b}\) |
\(\Big \downarrow \) 2620 |
\(\displaystyle \frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {2 d \left (\frac {i (c+d x)^2}{2 d}-2 i \left (\frac {i d \int \log \left (1+e^{2 i (a+b x)}\right )dx}{2 b}-\frac {i (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{2 b}\right )\right )}{b}\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle \frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {2 d \left (\frac {i (c+d x)^2}{2 d}-2 i \left (\frac {d \int e^{-2 i (a+b x)} \log \left (1+e^{2 i (a+b x)}\right )de^{2 i (a+b x)}}{4 b^2}-\frac {i (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{2 b}\right )\right )}{b}\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle \frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {2 d \left (\frac {i (c+d x)^2}{2 d}-2 i \left (-\frac {d \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{4 b^2}-\frac {i (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{2 b}\right )\right )}{b}\) |
Input:
Int[(c + d*x)^2*Sec[a + b*x]^2,x]
Output:
(-2*d*(((I/2)*(c + d*x)^2)/d - (2*I)*(((-1/2*I)*(c + d*x)*Log[1 + E^((2*I) *(a + b*x))])/b - (d*PolyLog[2, -E^((2*I)*(a + b*x))])/(4*b^2))))/b + ((c + d*x)^2*Tan[a + b*x])/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[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Simp[1/(d*e*n*Log[F]) Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) ))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 , (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
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[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp [(-(c + d*x)^m)*(Cot[e + f*x]/f), x] + Simp[d*(m/f) Int[(c + d*x)^(m - 1) *Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 169 vs. \(2 (76 ) = 152\).
Time = 1.70 (sec) , antiderivative size = 170, normalized size of antiderivative = 2.07
method | result | size |
risch | \(\frac {2 i \left (x^{2} d^{2}+2 c d x +c^{2}\right )}{b \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}-\frac {4 d c \ln \left ({\mathrm e}^{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 )}{b^{2}}-\frac {2 i d^{2} x^{2}}{b}-\frac {4 i d^{2} a x}{b^{2}}-\frac {2 i d^{2} a^{2}}{b^{3}}+\frac {2 d^{2} \ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right ) x}{b^{2}}-\frac {i d^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{2 i \left (b x +a \right )}\right )}{b^{3}}+\frac {4 d^{2} a \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}\) | \(170\) |
Input:
int((d*x+c)^2*sec(b*x+a)^2,x,method=_RETURNVERBOSE)
Output:
2*I*(d^2*x^2+2*c*d*x+c^2)/b/(exp(2*I*(b*x+a))+1)-4/b^2*d*c*ln(exp(I*(b*x+a )))+2/b^2*d*c*ln(exp(2*I*(b*x+a))+1)-2*I/b*d^2*x^2-4*I/b^2*d^2*a*x-2*I/b^3 *d^2*a^2+2/b^2*d^2*ln(exp(2*I*(b*x+a))+1)*x-I*d^2*polylog(2,-exp(2*I*(b*x+ a)))/b^3+4/b^3*d^2*a*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. 450 vs. \(2 (73) = 146\).
Time = 0.10 (sec) , antiderivative size = 450, normalized size of antiderivative = 5.49 \[ \int (c+d x)^2 \sec ^2(a+b x) \, dx=\frac {i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) - i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) + i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \sin \left (b x + a\right )}{b^{3} \cos \left (b x + a\right )} \] Input:
integrate((d*x+c)^2*sec(b*x+a)^2,x, algorithm="fricas")
Output:
(I*d^2*cos(b*x + a)*dilog(I*cos(b*x + a) + sin(b*x + a)) - I*d^2*cos(b*x + a)*dilog(I*cos(b*x + a) - sin(b*x + a)) - I*d^2*cos(b*x + a)*dilog(-I*cos (b*x + a) + sin(b*x + a)) + I*d^2*cos(b*x + a)*dilog(-I*cos(b*x + a) - sin (b*x + a)) + (b*c*d - a*d^2)*cos(b*x + a)*log(cos(b*x + a) + I*sin(b*x + a ) + I) + (b*c*d - a*d^2)*cos(b*x + a)*log(cos(b*x + a) - I*sin(b*x + a) + I) + (b*d^2*x + a*d^2)*cos(b*x + a)*log(I*cos(b*x + a) + sin(b*x + a) + 1) + (b*d^2*x + a*d^2)*cos(b*x + a)*log(I*cos(b*x + a) - sin(b*x + a) + 1) + (b*d^2*x + a*d^2)*cos(b*x + a)*log(-I*cos(b*x + a) + sin(b*x + a) + 1) + (b*d^2*x + a*d^2)*cos(b*x + a)*log(-I*cos(b*x + a) - sin(b*x + a) + 1) + ( b*c*d - a*d^2)*cos(b*x + a)*log(-cos(b*x + a) + I*sin(b*x + a) + I) + (b*c *d - a*d^2)*cos(b*x + a)*log(-cos(b*x + a) - I*sin(b*x + a) + I) + (b^2*d^ 2*x^2 + 2*b^2*c*d*x + b^2*c^2)*sin(b*x + a))/(b^3*cos(b*x + a))
\[ \int (c+d x)^2 \sec ^2(a+b x) \, dx=\int \left (c + d x\right )^{2} \sec ^{2}{\left (a + b x \right )}\, dx \] Input:
integrate((d*x+c)**2*sec(b*x+a)**2,x)
Output:
Integral((c + d*x)**2*sec(a + b*x)**2, x)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 324 vs. \(2 (73) = 146\).
Time = 0.17 (sec) , antiderivative size = 324, normalized size of antiderivative = 3.95 \[ \int (c+d x)^2 \sec ^2(a+b x) \, dx=\frac {2 \, b^{2} c^{2} + 2 \, {\left (b d^{2} x + b c d + {\left (b d^{2} x + b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (-i \, b d^{2} x - i \, b c d\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \arctan \left (\sin \left (2 \, b x + 2 \, a\right ), \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) - 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (d^{2} \cos \left (2 \, b x + 2 \, a\right ) + i \, d^{2} \sin \left (2 \, b x + 2 \, a\right ) + d^{2}\right )} {\rm Li}_2\left (-e^{\left (2 i \, b x + 2 i \, a\right )}\right ) + {\left (-i \, b d^{2} x - i \, b c d + {\left (-i \, b d^{2} x - i \, b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (b d^{2} x + b c d\right )} \sin \left (2 \, b x + 2 \, 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 ) - 2 \, {\left (i \, b^{2} d^{2} x^{2} + 2 i \, b^{2} c d x\right )} \sin \left (2 \, b x + 2 \, a\right )}{-i \, b^{3} \cos \left (2 \, b x + 2 \, a\right ) + b^{3} \sin \left (2 \, b x + 2 \, a\right ) - i \, b^{3}} \] Input:
integrate((d*x+c)^2*sec(b*x+a)^2,x, algorithm="maxima")
Output:
(2*b^2*c^2 + 2*(b*d^2*x + b*c*d + (b*d^2*x + b*c*d)*cos(2*b*x + 2*a) - (-I *b*d^2*x - I*b*c*d)*sin(2*b*x + 2*a))*arctan2(sin(2*b*x + 2*a), cos(2*b*x + 2*a) + 1) - 2*(b^2*d^2*x^2 + 2*b^2*c*d*x)*cos(2*b*x + 2*a) - (d^2*cos(2* b*x + 2*a) + I*d^2*sin(2*b*x + 2*a) + d^2)*dilog(-e^(2*I*b*x + 2*I*a)) + ( -I*b*d^2*x - I*b*c*d + (-I*b*d^2*x - I*b*c*d)*cos(2*b*x + 2*a) + (b*d^2*x + b*c*d)*sin(2*b*x + 2*a))*log(cos(2*b*x + 2*a)^2 + sin(2*b*x + 2*a)^2 + 2 *cos(2*b*x + 2*a) + 1) - 2*(I*b^2*d^2*x^2 + 2*I*b^2*c*d*x)*sin(2*b*x + 2*a ))/(-I*b^3*cos(2*b*x + 2*a) + b^3*sin(2*b*x + 2*a) - I*b^3)
\[ \int (c+d x)^2 \sec ^2(a+b x) \, dx=\int { {\left (d x + c\right )}^{2} \sec \left (b x + a\right )^{2} \,d x } \] Input:
integrate((d*x+c)^2*sec(b*x+a)^2,x, algorithm="giac")
Output:
integrate((d*x + c)^2*sec(b*x + a)^2, x)
Timed out. \[ \int (c+d x)^2 \sec ^2(a+b x) \, dx=\int \frac {{\left (c+d\,x\right )}^2}{{\cos \left (a+b\,x\right )}^2} \,d x \] Input:
int((c + d*x)^2/cos(a + b*x)^2,x)
Output:
int((c + d*x)^2/cos(a + b*x)^2, x)
\[ \int (c+d x)^2 \sec ^2(a+b x) \, dx=\frac {-8 \cos \left (b x +a \right ) \left (\int \frac {\tan \left (\frac {b x}{2}+\frac {a}{2}\right ) x}{\tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{4}-2 \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2}+1}d x \right ) b^{2} d^{2}-2 \cos \left (b x +a \right ) \mathrm {log}\left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2}+1\right ) b c d +2 \cos \left (b x +a \right ) \mathrm {log}\left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )-1\right ) b c d +2 \cos \left (b x +a \right ) \mathrm {log}\left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )-1\right ) d^{2}+2 \cos \left (b x +a \right ) \mathrm {log}\left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )+1\right ) b c d -2 \cos \left (b x +a \right ) \mathrm {log}\left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )+1\right ) d^{2}+\sin \left (b x +a \right ) b^{2} c^{2}+2 \sin \left (b x +a \right ) b^{2} c d x +\sin \left (b x +a \right ) b^{2} d^{2} x^{2}+2 b \,d^{2} x}{\cos \left (b x +a \right ) b^{3}} \] Input:
int((d*x+c)^2*sec(b*x+a)^2,x)
Output:
( - 8*cos(a + b*x)*int((tan((a + b*x)/2)*x)/(tan((a + b*x)/2)**4 - 2*tan(( a + b*x)/2)**2 + 1),x)*b**2*d**2 - 2*cos(a + b*x)*log(tan((a + b*x)/2)**2 + 1)*b*c*d + 2*cos(a + b*x)*log(tan((a + b*x)/2) - 1)*b*c*d + 2*cos(a + b* x)*log(tan((a + b*x)/2) - 1)*d**2 + 2*cos(a + b*x)*log(tan((a + b*x)/2) + 1)*b*c*d - 2*cos(a + b*x)*log(tan((a + b*x)/2) + 1)*d**2 + sin(a + b*x)*b* *2*c**2 + 2*sin(a + b*x)*b**2*c*d*x + sin(a + b*x)*b**2*d**2*x**2 + 2*b*d* *2*x)/(cos(a + b*x)*b**3)