3.6.49 \(\int e^{m x} \tan ^2(x) \, dx\) [549]

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

[Out]

-exp(m*x)/m+4*exp((2*I+m)*x)*hypergeom([2, 1-1/2*I*m],[2-1/2*I*m],-exp(2*I*x))/(2*I+m)

________________________________________________________________________________________

Rubi [A]
time = 0.05, 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.300, Rules used = {4527, 2225, 2283} \begin {gather*} \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} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2225

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 2283

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

Rule 4527

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]

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.18, size = 97, normalized size = 1.67 \begin {gather*} \frac {e^{m x} \left (-1+\frac {i e^{2 i x} m^2 \, _2F_1\left (1,1-\frac {i m}{2};2-\frac {i m}{2};-e^{2 i x}\right )}{2 i+m}-i m \, _2F_1\left (1,-\frac {i m}{2};1-\frac {i m}{2};-e^{2 i x}\right )+m \tan (x)\right )}{m} \end {gather*}

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, (-1/2*I)*m, 1 - (I/2)*m, -E^((2*I)*x)] + m*Tan[x]))/m

________________________________________________________________________________________

Maple [F]
time = 0.01, size = 0, normalized size = 0.00 \[\int {\mathrm e}^{m x} \left (\tan ^{2}\left (x \right )\right )\, dx\]

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]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-((m^4 + 20*m^2 + 64)*cos(4*x)^2*e^(m*x) - 4*(m^4 + 12*m^2 - 64)*cos(2*x)^2*e^(m*x) + (m^4 + 20*m^2 + 64)*e^(m
*x)*sin(4*x)^2 - 4*(m^4 + 12*m^2 - 64)*e^(m*x)*sin(2*x)^2 - 16*(11*m^2 - 16)*cos(2*x)*e^(m*x) + 8*(5*m^3 - 16*
m)*e^(m*x)*sin(2*x) + 2*(8*(m^2 + 16)*cos(2*x)*e^(m*x) + 4*(m^3 + 16*m)*e^(m*x)*sin(2*x) + (m^4 - 28*m^2 + 64)
*e^(m*x))*cos(4*x) + (m^4 - 76*m^2 + 64)*e^(m*x) - 16*(m^6 + 20*m^4 + (m^6 + 20*m^4 + 64*m^2)*cos(4*x)^2 + 4*(
m^6 + 20*m^4 + 64*m^2)*cos(2*x)^2 + (m^6 + 20*m^4 + 64*m^2)*sin(4*x)^2 + 4*(m^6 + 20*m^4 + 64*m^2)*sin(4*x)*si
n(2*x) + 4*(m^6 + 20*m^4 + 64*m^2)*sin(2*x)^2 + 64*m^2 + 2*(m^6 + 20*m^4 + 64*m^2 + 2*(m^6 + 20*m^4 + 64*m^2)*
cos(2*x))*cos(4*x) + 4*(m^6 + 20*m^4 + 64*m^2)*cos(2*x))*integrate(-(6*m*cos(6*x)*e^(m*x) + 18*m*cos(4*x)*e^(m
*x) + 18*m*cos(2*x)*e^(m*x) - (m^2 - 8)*e^(m*x)*sin(6*x) - 3*(m^2 - 8)*e^(m*x)*sin(4*x) - 3*(m^2 - 8)*e^(m*x)*
sin(2*x) + 6*m*e^(m*x))/(m^4 + (m^4 + 20*m^2 + 64)*cos(6*x)^2 + 9*(m^4 + 20*m^2 + 64)*cos(4*x)^2 + 9*(m^4 + 20
*m^2 + 64)*cos(2*x)^2 + (m^4 + 20*m^2 + 64)*sin(6*x)^2 + 9*(m^4 + 20*m^2 + 64)*sin(4*x)^2 + 18*(m^4 + 20*m^2 +
 64)*sin(4*x)*sin(2*x) + 9*(m^4 + 20*m^2 + 64)*sin(2*x)^2 + 20*m^2 + 2*(m^4 + 20*m^2 + 3*(m^4 + 20*m^2 + 64)*c
os(4*x) + 3*(m^4 + 20*m^2 + 64)*cos(2*x) + 64)*cos(6*x) + 6*(m^4 + 20*m^2 + 3*(m^4 + 20*m^2 + 64)*cos(2*x) + 6
4)*cos(4*x) + 6*(m^4 + 20*m^2 + 64)*cos(2*x) + 6*((m^4 + 20*m^2 + 64)*sin(4*x) + (m^4 + 20*m^2 + 64)*sin(2*x))
*sin(6*x) + 64), x) - 8*((m^3 + 16*m)*cos(2*x)*e^(m*x) - 2*(m^2 + 16)*e^(m*x)*sin(2*x) - 2*(m^3 - 8*m)*e^(m*x)
)*sin(4*x))/(m^5 + 20*m^3 + (m^5 + 20*m^3 + 64*m)*cos(4*x)^2 + 4*(m^5 + 20*m^3 + 64*m)*cos(2*x)^2 + (m^5 + 20*
m^3 + 64*m)*sin(4*x)^2 + 4*(m^5 + 20*m^3 + 64*m)*sin(4*x)*sin(2*x) + 4*(m^5 + 20*m^3 + 64*m)*sin(2*x)^2 + 2*(m
^5 + 20*m^3 + 2*(m^5 + 20*m^3 + 64*m)*cos(2*x) + 64*m)*cos(4*x) + 4*(m^5 + 20*m^3 + 64*m)*cos(2*x) + 64*m)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

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.00, size = 0, normalized size = 0.00 \begin {gather*} \int e^{m x} \tan ^{2}{\left (x \right )}\, dx \end {gather*}

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.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

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)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int {\mathrm {e}}^{m\,x}\,{\mathrm {tan}\left (x\right )}^2 \,d x \end {gather*}

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)

________________________________________________________________________________________