Integrand size = 21, antiderivative size = 103 \[ \int (d \tan (e+f x))^n (a+b \tan (e+f x)) \, dx=\frac {a \operatorname {Hypergeometric2F1}\left (1,\frac {1+n}{2},\frac {3+n}{2},-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac {b \operatorname {Hypergeometric2F1}\left (1,\frac {2+n}{2},\frac {4+n}{2},-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{2+n}}{d^2 f (2+n)} \] Output:
a*hypergeom([1, 1/2+1/2*n],[3/2+1/2*n],-tan(f*x+e)^2)*(d*tan(f*x+e))^(1+n) /d/f/(1+n)+b*hypergeom([1, 1+1/2*n],[2+1/2*n],-tan(f*x+e)^2)*(d*tan(f*x+e) )^(2+n)/d^2/f/(2+n)
Time = 0.20 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.96 \[ \int (d \tan (e+f x))^n (a+b \tan (e+f x)) \, dx=\frac {\tan (e+f x) (d \tan (e+f x))^n \left (a (2+n) \operatorname {Hypergeometric2F1}\left (1,\frac {1+n}{2},\frac {3+n}{2},-\tan ^2(e+f x)\right )+b (1+n) \operatorname {Hypergeometric2F1}\left (1,\frac {2+n}{2},\frac {4+n}{2},-\tan ^2(e+f x)\right ) \tan (e+f x)\right )}{f (1+n) (2+n)} \] Input:
Integrate[(d*Tan[e + f*x])^n*(a + b*Tan[e + f*x]),x]
Output:
(Tan[e + f*x]*(d*Tan[e + f*x])^n*(a*(2 + n)*Hypergeometric2F1[1, (1 + n)/2 , (3 + n)/2, -Tan[e + f*x]^2] + b*(1 + n)*Hypergeometric2F1[1, (2 + n)/2, (4 + n)/2, -Tan[e + f*x]^2]*Tan[e + f*x]))/(f*(1 + n)*(2 + n))
Time = 0.33 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4021, 3042, 3957, 278}
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)) (d \tan (e+f x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+b \tan (e+f x)) (d \tan (e+f x))^ndx\) |
\(\Big \downarrow \) 4021 |
\(\displaystyle a \int (d \tan (e+f x))^ndx+\frac {b \int (d \tan (e+f x))^{n+1}dx}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a \int (d \tan (e+f x))^ndx+\frac {b \int (d \tan (e+f x))^{n+1}dx}{d}\) |
\(\Big \downarrow \) 3957 |
\(\displaystyle \frac {a d \int \frac {(d \tan (e+f x))^n}{\tan ^2(e+f x) d^2+d^2}d(d \tan (e+f x))}{f}+\frac {b \int \frac {(d \tan (e+f x))^{n+1}}{\tan ^2(e+f x) d^2+d^2}d(d \tan (e+f x))}{f}\) |
\(\Big \downarrow \) 278 |
\(\displaystyle \frac {a (d \tan (e+f x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,\frac {n+1}{2},\frac {n+3}{2},-\tan ^2(e+f x)\right )}{d f (n+1)}+\frac {b (d \tan (e+f x))^{n+2} \operatorname {Hypergeometric2F1}\left (1,\frac {n+2}{2},\frac {n+4}{2},-\tan ^2(e+f x)\right )}{d^2 f (n+2)}\) |
Input:
Int[(d*Tan[e + f*x])^n*(a + b*Tan[e + f*x]),x]
Output:
(a*Hypergeometric2F1[1, (1 + n)/2, (3 + n)/2, -Tan[e + f*x]^2]*(d*Tan[e + f*x])^(1 + n))/(d*f*(1 + n)) + (b*Hypergeometric2F1[1, (2 + n)/2, (4 + n)/ 2, -Tan[e + f*x]^2]*(d*Tan[e + f*x])^(2 + n))/(d^2*f*(2 + n))
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[a^p*(( c*x)^(m + 1)/(c*(m + 1)))*Hypergeometric2F1[-p, (m + 1)/2, (m + 1)/2 + 1, ( -b)*(x^2/a)], x] /; FreeQ[{a, b, c, m, p}, x] && !IGtQ[p, 0] && (ILtQ[p, 0 ] || GtQ[a, 0])
Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b/d Subst[Int [x^n/(b^2 + x^2), x], x, b*Tan[c + d*x]], x] /; FreeQ[{b, c, d, n}, x] && !IntegerQ[n]
Int[((b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Tan[e + f*x])^m, x], x] + Simp[d/b Int [(b*Tan[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x] && NeQ[c^ 2 + d^2, 0] && !IntegerQ[2*m]
\[\int \left (d \tan \left (f x +e \right )\right )^{n} \left (a +b \tan \left (f x +e \right )\right )d x\]
Input:
int((d*tan(f*x+e))^n*(a+b*tan(f*x+e)),x)
Output:
int((d*tan(f*x+e))^n*(a+b*tan(f*x+e)),x)
\[ \int (d \tan (e+f x))^n (a+b \tan (e+f x)) \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )} \left (d \tan \left (f x + e\right )\right )^{n} \,d x } \] Input:
integrate((d*tan(f*x+e))^n*(a+b*tan(f*x+e)),x, algorithm="fricas")
Output:
integral((b*tan(f*x + e) + a)*(d*tan(f*x + e))^n, x)
\[ \int (d \tan (e+f x))^n (a+b \tan (e+f x)) \, dx=\int \left (d \tan {\left (e + f x \right )}\right )^{n} \left (a + b \tan {\left (e + f x \right )}\right )\, dx \] Input:
integrate((d*tan(f*x+e))**n*(a+b*tan(f*x+e)),x)
Output:
Integral((d*tan(e + f*x))**n*(a + b*tan(e + f*x)), x)
\[ \int (d \tan (e+f x))^n (a+b \tan (e+f x)) \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )} \left (d \tan \left (f x + e\right )\right )^{n} \,d x } \] Input:
integrate((d*tan(f*x+e))^n*(a+b*tan(f*x+e)),x, algorithm="maxima")
Output:
integrate((b*tan(f*x + e) + a)*(d*tan(f*x + e))^n, x)
\[ \int (d \tan (e+f x))^n (a+b \tan (e+f x)) \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )} \left (d \tan \left (f x + e\right )\right )^{n} \,d x } \] Input:
integrate((d*tan(f*x+e))^n*(a+b*tan(f*x+e)),x, algorithm="giac")
Output:
integrate((b*tan(f*x + e) + a)*(d*tan(f*x + e))^n, x)
Timed out. \[ \int (d \tan (e+f x))^n (a+b \tan (e+f x)) \, dx=\int {\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^n\,\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right ) \,d x \] Input:
int((d*tan(e + f*x))^n*(a + b*tan(e + f*x)),x)
Output:
int((d*tan(e + f*x))^n*(a + b*tan(e + f*x)), x)
\[ \int (d \tan (e+f x))^n (a+b \tan (e+f x)) \, dx=\frac {d^{n} \left (\tan \left (f x +e \right )^{n} b +\left (\int \tan \left (f x +e \right )^{n}d x \right ) a f n -\left (\int \frac {\tan \left (f x +e \right )^{n}}{\tan \left (f x +e \right )}d x \right ) b f n \right )}{f n} \] Input:
int((d*tan(f*x+e))^n*(a+b*tan(f*x+e)),x)
Output:
(d**n*(tan(e + f*x)**n*b + int(tan(e + f*x)**n,x)*a*f*n - int(tan(e + f*x) **n/tan(e + f*x),x)*b*f*n))/(f*n)