Integrand size = 45, antiderivative size = 376 \[ \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=-\frac {(B+i (A-C)) \operatorname {AppellF1}\left (1+m,-n,1,2+m,-\frac {d (a+b \tan (e+f x))}{b c-a d},\frac {a+b \tan (e+f x)}{a-i b}\right ) (a+b \tan (e+f x))^{1+m} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}}{2 (a-i b) f (1+m)}-\frac {(A+i B-C) \operatorname {AppellF1}\left (1+m,-n,1,2+m,-\frac {d (a+b \tan (e+f x))}{b c-a d},\frac {a+b \tan (e+f x)}{a+i b}\right ) (a+b \tan (e+f x))^{1+m} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}}{2 (i a-b) f (1+m)}+\frac {C \operatorname {Hypergeometric2F1}\left (1+m,-n,2+m,-\frac {d (a+b \tan (e+f x))}{b c-a d}\right ) (a+b \tan (e+f x))^{1+m} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}}{b f (1+m)} \] Output:
-1/2*(B+I*(A-C))*AppellF1(1+m,1,-n,2+m,(a+b*tan(f*x+e))/(a-I*b),-d*(a+b*ta n(f*x+e))/(-a*d+b*c))*(a+b*tan(f*x+e))^(1+m)*(c+d*tan(f*x+e))^n/(a-I*b)/f/ (1+m)/((b*(c+d*tan(f*x+e))/(-a*d+b*c))^n)-1/2*(A+I*B-C)*AppellF1(1+m,1,-n, 2+m,(a+b*tan(f*x+e))/(a+I*b),-d*(a+b*tan(f*x+e))/(-a*d+b*c))*(a+b*tan(f*x+ e))^(1+m)*(c+d*tan(f*x+e))^n/(I*a-b)/f/(1+m)/((b*(c+d*tan(f*x+e))/(-a*d+b* c))^n)+C*hypergeom([-n, 1+m],[2+m],-d*(a+b*tan(f*x+e))/(-a*d+b*c))*(a+b*ta n(f*x+e))^(1+m)*(c+d*tan(f*x+e))^n/b/f/(1+m)/((b*(c+d*tan(f*x+e))/(-a*d+b* c))^n)
\[ \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx \] Input:
Integrate[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^n*(A + B*Tan[e + f*x ] + C*Tan[e + f*x]^2),x]
Output:
Integrate[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^n*(A + B*Tan[e + f*x ] + C*Tan[e + f*x]^2), x]
Time = 1.22 (sec) , antiderivative size = 371, normalized size of antiderivative = 0.99, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.089, Rules used = {3042, 4138, 2348, 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 (a+b \tan (e+f x))^m \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) (c+d \tan (e+f x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+b \tan (e+f x))^m \left (A+B \tan (e+f x)+C \tan (e+f x)^2\right ) (c+d \tan (e+f x))^ndx\) |
\(\Big \downarrow \) 4138 |
\(\displaystyle \frac {\int \frac {(a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (C \tan ^2(e+f x)+B \tan (e+f x)+A\right )}{\tan ^2(e+f x)+1}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 2348 |
\(\displaystyle \frac {\int \left (C (c+d \tan (e+f x))^n (a+b \tan (e+f x))^m+\frac {(i (A-C)-B) (c+d \tan (e+f x))^n (a+b \tan (e+f x))^m}{2 (i-\tan (e+f x))}+\frac {(B+i (A-C)) (c+d \tan (e+f x))^n (a+b \tan (e+f x))^m}{2 (\tan (e+f x)+i)}\right )d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-\frac {(B+i (A-C)) (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} \operatorname {AppellF1}\left (m+1,-n,1,m+2,-\frac {d (a+b \tan (e+f x))}{b c-a d},\frac {a+b \tan (e+f x)}{a-i b}\right )}{2 (m+1) (a-i b)}-\frac {(A+i B-C) (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} \operatorname {AppellF1}\left (m+1,-n,1,m+2,-\frac {d (a+b \tan (e+f x))}{b c-a d},\frac {a+b \tan (e+f x)}{a+i b}\right )}{2 (m+1) (-b+i a)}+\frac {C (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} \operatorname {Hypergeometric2F1}\left (m+1,-n,m+2,-\frac {d (a+b \tan (e+f x))}{b c-a d}\right )}{b (m+1)}}{f}\) |
Input:
Int[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^n*(A + B*Tan[e + f*x] + C* Tan[e + f*x]^2),x]
Output:
(-1/2*((B + I*(A - C))*AppellF1[1 + m, -n, 1, 2 + m, -((d*(a + b*Tan[e + f *x]))/(b*c - a*d)), (a + b*Tan[e + f*x])/(a - I*b)]*(a + b*Tan[e + f*x])^( 1 + m)*(c + d*Tan[e + f*x])^n)/((a - I*b)*(1 + m)*((b*(c + d*Tan[e + f*x]) )/(b*c - a*d))^n) - ((A + I*B - C)*AppellF1[1 + m, -n, 1, 2 + m, -((d*(a + b*Tan[e + f*x]))/(b*c - a*d)), (a + b*Tan[e + f*x])/(a + I*b)]*(a + b*Tan [e + f*x])^(1 + m)*(c + d*Tan[e + f*x])^n)/(2*(I*a - b)*(1 + m)*((b*(c + d *Tan[e + f*x]))/(b*c - a*d))^n) + (C*Hypergeometric2F1[1 + m, -n, 2 + m, - ((d*(a + b*Tan[e + f*x]))/(b*c - a*d))]*(a + b*Tan[e + f*x])^(1 + m)*(c + d*Tan[e + f*x])^n)/(b*(1 + m)*((b*(c + d*Tan[e + f*x]))/(b*c - a*d))^n))/f
Int[(Px_)*((c_) + (d_.)*(x_))^(m_.)*((e_) + (f_.)*(x_))^(n_.)*((a_.) + (b_. )*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Px*(c + d*x)^m*(e + f*x)^ n*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && PolyQ[P x, x] && (IntegerQ[p] || (IntegerQ[2*p] && IntegerQ[m] && ILtQ[n, 0])) && !(IGtQ[m, 0] && IGtQ[n, 0])
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, S imp[ff/f Subst[Int[(a + b*ff*x)^m*(c + d*ff*x)^n*((A + B*ff*x + C*ff^2*x^ 2)/(1 + ff^2*x^2)), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, c, d, e, f , A, B, C, m, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
\[\int \left (a +b \tan \left (f x +e \right )\right )^{m} \left (c +d \tan \left (f x +e \right )\right )^{n} \left (A +B \tan \left (f x +e \right )+C \tan \left (f x +e \right )^{2}\right )d x\]
Input:
int((a+b*tan(f*x+e))^m*(c+d*tan(f*x+e))^n*(A+B*tan(f*x+e)+C*tan(f*x+e)^2), x)
Output:
int((a+b*tan(f*x+e))^m*(c+d*tan(f*x+e))^n*(A+B*tan(f*x+e)+C*tan(f*x+e)^2), x)
\[ \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\int { {\left (C \tan \left (f x + e\right )^{2} + B \tan \left (f x + e\right ) + A\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{m} {\left (d \tan \left (f x + e\right ) + c\right )}^{n} \,d x } \] Input:
integrate((a+b*tan(f*x+e))^m*(c+d*tan(f*x+e))^n*(A+B*tan(f*x+e)+C*tan(f*x+ e)^2),x, algorithm="fricas")
Output:
integral((C*tan(f*x + e)^2 + B*tan(f*x + e) + A)*(b*tan(f*x + e) + a)^m*(d *tan(f*x + e) + c)^n, x)
Exception generated. \[ \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\text {Exception raised: HeuristicGCDFailed} \] Input:
integrate((a+b*tan(f*x+e))**m*(c+d*tan(f*x+e))**n*(A+B*tan(f*x+e)+C*tan(f* x+e)**2),x)
Output:
Exception raised: HeuristicGCDFailed >> no luck
\[ \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\int { {\left (C \tan \left (f x + e\right )^{2} + B \tan \left (f x + e\right ) + A\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{m} {\left (d \tan \left (f x + e\right ) + c\right )}^{n} \,d x } \] Input:
integrate((a+b*tan(f*x+e))^m*(c+d*tan(f*x+e))^n*(A+B*tan(f*x+e)+C*tan(f*x+ e)^2),x, algorithm="maxima")
Output:
integrate((C*tan(f*x + e)^2 + B*tan(f*x + e) + A)*(b*tan(f*x + e) + a)^m*( d*tan(f*x + e) + c)^n, x)
\[ \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\int { {\left (C \tan \left (f x + e\right )^{2} + B \tan \left (f x + e\right ) + A\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{m} {\left (d \tan \left (f x + e\right ) + c\right )}^{n} \,d x } \] Input:
integrate((a+b*tan(f*x+e))^m*(c+d*tan(f*x+e))^n*(A+B*tan(f*x+e)+C*tan(f*x+ e)^2),x, algorithm="giac")
Output:
integrate((C*tan(f*x + e)^2 + B*tan(f*x + e) + A)*(b*tan(f*x + e) + a)^m*( d*tan(f*x + e) + c)^n, x)
Timed out. \[ \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\int {\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^m\,{\left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )}^n\,\left (C\,{\mathrm {tan}\left (e+f\,x\right )}^2+B\,\mathrm {tan}\left (e+f\,x\right )+A\right ) \,d x \] Input:
int((a + b*tan(e + f*x))^m*(c + d*tan(e + f*x))^n*(A + B*tan(e + f*x) + C* tan(e + f*x)^2),x)
Output:
int((a + b*tan(e + f*x))^m*(c + d*tan(e + f*x))^n*(A + B*tan(e + f*x) + C* tan(e + f*x)^2), x)
\[ \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx=\left (\int \left (d \tan \left (f x +e \right )+c \right )^{n} \left (\tan \left (f x +e \right ) b +a \right )^{m} \tan \left (f x +e \right )^{2}d x \right ) c +\left (\int \left (d \tan \left (f x +e \right )+c \right )^{n} \left (\tan \left (f x +e \right ) b +a \right )^{m} \tan \left (f x +e \right )d x \right ) b +\left (\int \left (d \tan \left (f x +e \right )+c \right )^{n} \left (\tan \left (f x +e \right ) b +a \right )^{m}d x \right ) a \] Input:
int((a+b*tan(f*x+e))^m*(c+d*tan(f*x+e))^n*(A+B*tan(f*x+e)+C*tan(f*x+e)^2), x)
Output:
int((tan(e + f*x)*d + c)**n*(tan(e + f*x)*b + a)**m*tan(e + f*x)**2,x)*c + int((tan(e + f*x)*d + c)**n*(tan(e + f*x)*b + a)**m*tan(e + f*x),x)*b + i nt((tan(e + f*x)*d + c)**n*(tan(e + f*x)*b + a)**m,x)*a