3.79 \(\int \sin (x) \tan (n x) \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 105, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {4557, 2194, 2251} \[ -i e^{-i x} \, _2F_1\left (1,-\frac {1}{2 n};1-\frac {1}{2 n};-e^{2 i n x}\right )-i e^{i x} \, _2F_1\left (1,\frac {1}{2 n};\frac {1}{2} \left (2+\frac {1}{n}\right );-e^{2 i n x}\right )+\frac {1}{2} i e^{-i x}+\frac {1}{2} i e^{i x} \]

Antiderivative was successfully verified.

[In]

Int[Sin[x]*Tan[n*x],x]

[Out]

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

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])

Rule 4557

Int[Sin[(a_.) + (b_.)*(x_)]*Tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Int[1/(E^(I*(a + b*x))*2) - E^(I*(a + b*x))/
2 - 1/(E^(I*(a + b*x))*(1 + E^(2*I*(c + d*x)))) + E^(I*(a + b*x))/(1 + E^(2*I*(c + d*x))), x] /; FreeQ[{a, b,
c, d}, x] && NeQ[b^2 - d^2, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.18, size = 200, normalized size = 1.90 \[ -\frac {i e^{-2 i x} \left ((2 n+1) e^{i (2 n x+x)} \, _2F_1\left (1,1-\frac {1}{2 n};2-\frac {1}{2 n};-e^{2 i n x}\right )+(2 n-1) \left ((2 n+1) e^{i x} \left (\, _2F_1\left (1,-\frac {1}{2 n};1-\frac {1}{2 n};-e^{2 i n x}\right )+e^{2 i x} \, _2F_1\left (1,\frac {1}{2 n};1+\frac {1}{2 n};-e^{2 i n x}\right )\right )-e^{i (2 n+3) x} \, _2F_1\left (1,1+\frac {1}{2 n};2+\frac {1}{2 n};-e^{2 i n x}\right )\right )\right )}{2 \left (4 n^2-1\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]*Tan[n*x],x]

[Out]

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

________________________________________________________________________________________

fricas [F]  time = 0.73, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\sin \relax (x) \tan \left (n x\right ), x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)*tan(n*x),x, algorithm="fricas")

[Out]

integral(sin(x)*tan(n*x), x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sin \relax (x) \tan \left (n x\right )\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)*tan(n*x),x, algorithm="giac")

[Out]

integrate(sin(x)*tan(n*x), x)

________________________________________________________________________________________

maple [F]  time = 0.44, size = 0, normalized size = 0.00 \[ \int \sin \relax (x ) \tan \left (n x \right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)*tan(n*x),x)

[Out]

int(sin(x)*tan(n*x),x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sin \relax (x) \tan \left (n x\right )\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)*tan(n*x),x, algorithm="maxima")

[Out]

integrate(sin(x)*tan(n*x), x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \mathrm {tan}\left (n\,x\right )\,\sin \relax (x) \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(n*x)*sin(x),x)

[Out]

int(tan(n*x)*sin(x), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sin {\relax (x )} \tan {\left (n x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)*tan(n*x),x)

[Out]

Integral(sin(x)*tan(n*x), x)

________________________________________________________________________________________