3.549 \(\int e^{m x} \tan ^2(x) \, dx\)

Optimal. Leaf size=58 \[ -\frac{e^{m x}}{m}+\frac{4 e^{(m+2 i) x} \, _2F_1\left (2,1-\frac{i m}{2};2-\frac{i m}{2};-e^{2 i x}\right )}{m+2 i} \]

[Out]

-(E^(m*x)/m) + (4*E^((2*I + m)*x)*Hypergeometric2F1[2, 1 - (I/2)*m, 2 - (I/2)*m, -E^((2*I)*x)])/(2*I + m)

________________________________________________________________________________________

Rubi [A]  time = 0.0774187, antiderivative size = 85, normalized size of antiderivative = 1.47, number of steps used = 5, number of rules used = 3, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.3, Rules used = {4442, 2194, 2251} \[ \frac{4 e^{m x} \text{Hypergeometric2F1}\left (1,-\frac{i m}{2},1-\frac{i m}{2},-e^{2 i x}\right )}{m}-\frac{4 e^{m x} \text{Hypergeometric2F1}\left (2,-\frac{i m}{2},1-\frac{i m}{2},-e^{2 i x}\right )}{m}-\frac{e^{m x}}{m} \]

Antiderivative was successfully verified.

[In]

Int[E^(m*x)*Tan[x]^2,x]

[Out]

-(E^(m*x)/m) + (4*E^(m*x)*Hypergeometric2F1[1, (-I/2)*m, 1 - (I/2)*m, -E^((2*I)*x)])/m - (4*E^(m*x)*Hypergeome
tric2F1[2, (-I/2)*m, 1 - (I/2)*m, -E^((2*I)*x)])/m

Rule 4442

Int[(F_)^((c_.)*((a_.) + (b_.)*(x_)))*Tan[(d_.) + (e_.)*(x_)]^(n_.), x_Symbol] :> Dist[I^n, Int[ExpandIntegran
d[(F^(c*(a + b*x))*(1 - E^(2*I*(d + e*x)))^n)/(1 + E^(2*I*(d + e*x)))^n, x], x], x] /; FreeQ[{F, a, b, c, d, e
}, x] && IntegerQ[n]

Rule 2194

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2251

Int[((a_) + (b_.)*(F_)^((e_.)*((c_.) + (d_.)*(x_))))^(p_)*(G_)^((h_.)*((f_.) + (g_.)*(x_))), x_Symbol] :> Simp
[(a^p*G^(h*(f + g*x))*Hypergeometric2F1[-p, (g*h*Log[G])/(d*e*Log[F]), (g*h*Log[G])/(d*e*Log[F]) + 1, Simplify
[-((b*F^(e*(c + d*x)))/a)]])/(g*h*Log[G]), x] /; FreeQ[{F, G, a, b, c, d, e, f, g, h, p}, x] && (ILtQ[p, 0] ||
 GtQ[a, 0])

Rubi steps

\begin{align*} \int e^{m x} \tan ^2(x) \, dx &=-\int \left (e^{m x}+\frac{4 e^{m x}}{\left (1+e^{2 i x}\right )^2}-\frac{4 e^{m x}}{1+e^{2 i x}}\right ) \, dx\\ &=-\left (4 \int \frac{e^{m x}}{\left (1+e^{2 i x}\right )^2} \, dx\right )+4 \int \frac{e^{m x}}{1+e^{2 i x}} \, dx-\int e^{m x} \, dx\\ &=-\frac{e^{m x}}{m}+\frac{4 e^{m x} \, _2F_1\left (1,-\frac{i m}{2};1-\frac{i m}{2};-e^{2 i x}\right )}{m}-\frac{4 e^{m x} \, _2F_1\left (2,-\frac{i m}{2};1-\frac{i m}{2};-e^{2 i x}\right )}{m}\\ \end{align*}

Mathematica [A]  time = 0.236516, size = 97, normalized size = 1.67 \[ \frac{e^{m x} \left (\frac{i m^2 e^{2 i x} \, _2F_1\left (1,1-\frac{i m}{2};2-\frac{i m}{2};-e^{2 i x}\right )}{m+2 i}-i m \, _2F_1\left (1,-\frac{i m}{2};1-\frac{i m}{2};-e^{2 i x}\right )+m \tan (x)-1\right )}{m} \]

Antiderivative was successfully verified.

[In]

Integrate[E^(m*x)*Tan[x]^2,x]

[Out]

(E^(m*x)*(-1 + (I*E^((2*I)*x)*m^2*Hypergeometric2F1[1, 1 - (I/2)*m, 2 - (I/2)*m, -E^((2*I)*x)])/(2*I + m) - I*
m*Hypergeometric2F1[1, (-I/2)*m, 1 - (I/2)*m, -E^((2*I)*x)] + m*Tan[x]))/m

________________________________________________________________________________________

Maple [F]  time = 0.058, size = 0, normalized size = 0. \begin{align*} \int{{\rm e}^{mx}} \left ( \tan \left ( x \right ) \right ) ^{2}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp(m*x)*tan(x)^2,x)

[Out]

int(exp(m*x)*tan(x)^2,x)

________________________________________________________________________________________

Maxima [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(m*x)*tan(x)^2,x, algorithm="maxima")

[Out]

Timed out

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (e^{\left (m x\right )} \tan \left (x\right )^{2}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(m*x)*tan(x)^2,x, algorithm="fricas")

[Out]

integral(e^(m*x)*tan(x)^2, x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int e^{m x} \tan ^{2}{\left (x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(m*x)*tan(x)**2,x)

[Out]

Integral(exp(m*x)*tan(x)**2, x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int e^{\left (m x\right )} \tan \left (x\right )^{2}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(m*x)*tan(x)^2,x, algorithm="giac")

[Out]

integrate(e^(m*x)*tan(x)^2, x)