\(\int \frac {\tan (c+d x)}{\sqrt {a \sin ^2(c+d x)}} \, dx\) [850]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 21, antiderivative size = 30 \[ \int \frac {\tan (c+d x)}{\sqrt {a \sin ^2(c+d x)}} \, dx=\frac {\text {arctanh}\left (\frac {\sqrt {a \sin ^2(c+d x)}}{\sqrt {a}}\right )}{\sqrt {a} d} \]

[Out]

arctanh((a*sin(d*x+c)^2)^(1/2)/a^(1/2))/d/a^(1/2)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3284, 65, 212} \[ \int \frac {\tan (c+d x)}{\sqrt {a \sin ^2(c+d x)}} \, dx=\frac {\text {arctanh}\left (\frac {\sqrt {a \sin ^2(c+d x)}}{\sqrt {a}}\right )}{\sqrt {a} d} \]

[In]

Int[Tan[c + d*x]/Sqrt[a*Sin[c + d*x]^2],x]

[Out]

ArcTanh[Sqrt[a*Sin[c + d*x]^2]/Sqrt[a]]/(Sqrt[a]*d)

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3284

Int[((b_.)*sin[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = FreeFact
ors[Sin[e + f*x]^2, x]}, Dist[ff^((m + 1)/2)/(2*f), Subst[Int[x^((m - 1)/2)*((b*ff^(n/2)*x^(n/2))^p/(1 - ff*x)
^((m + 1)/2)), x], x, Sin[e + f*x]^2/ff], x]] /; FreeQ[{b, e, f, p}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2
]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1}{(1-x) \sqrt {a x}} \, dx,x,\sin ^2(c+d x)\right )}{2 d} \\ & = \frac {\text {Subst}\left (\int \frac {1}{1-\frac {x^2}{a}} \, dx,x,\sqrt {a \sin ^2(c+d x)}\right )}{a d} \\ & = \frac {\text {arctanh}\left (\frac {\sqrt {a \sin ^2(c+d x)}}{\sqrt {a}}\right )}{\sqrt {a} d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.03 \[ \int \frac {\tan (c+d x)}{\sqrt {a \sin ^2(c+d x)}} \, dx=\frac {\text {arctanh}(\sin (c+d x)) \sin (c+d x)}{d \sqrt {a \sin ^2(c+d x)}} \]

[In]

Integrate[Tan[c + d*x]/Sqrt[a*Sin[c + d*x]^2],x]

[Out]

(ArcTanh[Sin[c + d*x]]*Sin[c + d*x])/(d*Sqrt[a*Sin[c + d*x]^2])

Maple [A] (verified)

Time = 0.66 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00

method result size
default \(\frac {\sin \left (d x +c \right ) \operatorname {arctanh}\left (\sin \left (d x +c \right )\right )}{\sqrt {a \sin \left (d x +c \right )^{2}}\, d}\) \(30\)
risch \(-\frac {2 \ln \left ({\mathrm e}^{i d x}-i {\mathrm e}^{-i c}\right ) \sin \left (d x +c \right )}{d \sqrt {-\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2} a \,{\mathrm e}^{-2 i \left (d x +c \right )}}}+\frac {2 \ln \left ({\mathrm e}^{i d x}+i {\mathrm e}^{-i c}\right ) \sin \left (d x +c \right )}{d \sqrt {-\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2} a \,{\mathrm e}^{-2 i \left (d x +c \right )}}}\) \(110\)

[In]

int(tan(d*x+c)/(a*sin(d*x+c)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/(a*sin(d*x+c)^2)^(1/2)*sin(d*x+c)*arctanh(sin(d*x+c))/d

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 91, normalized size of antiderivative = 3.03 \[ \int \frac {\tan (c+d x)}{\sqrt {a \sin ^2(c+d x)}} \, dx=\left [\frac {\sqrt {-a \cos \left (d x + c\right )^{2} + a} \log \left (-\frac {\sin \left (d x + c\right ) + 1}{\sin \left (d x + c\right ) - 1}\right )}{2 \, a d \sin \left (d x + c\right )}, -\frac {\sqrt {-a} \arctan \left (\frac {\sqrt {-a \cos \left (d x + c\right )^{2} + a} \sqrt {-a}}{a}\right )}{a d}\right ] \]

[In]

integrate(tan(d*x+c)/(a*sin(d*x+c)^2)^(1/2),x, algorithm="fricas")

[Out]

[1/2*sqrt(-a*cos(d*x + c)^2 + a)*log(-(sin(d*x + c) + 1)/(sin(d*x + c) - 1))/(a*d*sin(d*x + c)), -sqrt(-a)*arc
tan(sqrt(-a*cos(d*x + c)^2 + a)*sqrt(-a)/a)/(a*d)]

Sympy [F]

\[ \int \frac {\tan (c+d x)}{\sqrt {a \sin ^2(c+d x)}} \, dx=\int \frac {\tan {\left (c + d x \right )}}{\sqrt {a \sin ^{2}{\left (c + d x \right )}}}\, dx \]

[In]

integrate(tan(d*x+c)/(a*sin(d*x+c)**2)**(1/2),x)

[Out]

Integral(tan(c + d*x)/sqrt(a*sin(c + d*x)**2), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (24) = 48\).

Time = 0.34 (sec) , antiderivative size = 76, normalized size of antiderivative = 2.53 \[ \int \frac {\tan (c+d x)}{\sqrt {a \sin ^2(c+d x)}} \, dx=\frac {\frac {\left (-1\right )^{2 \, a \sin \left (d x + c\right )} \log \left (-\frac {a \sin \left (d x + c\right )}{\sin \left (d x + c\right ) + 1}\right )}{\sqrt {a}} + \frac {\left (-1\right )^{2 \, a \sin \left (d x + c\right )} \log \left (-\frac {a \sin \left (d x + c\right )}{\sin \left (d x + c\right ) - 1}\right )}{\sqrt {a}}}{2 \, d} \]

[In]

integrate(tan(d*x+c)/(a*sin(d*x+c)^2)^(1/2),x, algorithm="maxima")

[Out]

1/2*((-1)^(2*a*sin(d*x + c))*log(-a*sin(d*x + c)/(sin(d*x + c) + 1))/sqrt(a) + (-1)^(2*a*sin(d*x + c))*log(-a*
sin(d*x + c)/(sin(d*x + c) - 1))/sqrt(a))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (24) = 48\).

Time = 0.41 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.87 \[ \int \frac {\tan (c+d x)}{\sqrt {a \sin ^2(c+d x)}} \, dx=\frac {\log \left ({\left | \frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right ) + 2 \right |}\right ) - \log \left ({\left | \frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right ) - 2 \right |}\right )}{4 \, \sqrt {a} d \mathrm {sgn}\left (\sin \left (d x + c\right )\right )} \]

[In]

integrate(tan(d*x+c)/(a*sin(d*x+c)^2)^(1/2),x, algorithm="giac")

[Out]

1/4*(log(abs(1/sin(d*x + c) + sin(d*x + c) + 2)) - log(abs(1/sin(d*x + c) + sin(d*x + c) - 2)))/(sqrt(a)*d*sgn
(sin(d*x + c)))

Mupad [F(-1)]

Timed out. \[ \int \frac {\tan (c+d x)}{\sqrt {a \sin ^2(c+d x)}} \, dx=\int \frac {\mathrm {tan}\left (c+d\,x\right )}{\sqrt {a\,{\sin \left (c+d\,x\right )}^2}} \,d x \]

[In]

int(tan(c + d*x)/(a*sin(c + d*x)^2)^(1/2),x)

[Out]

int(tan(c + d*x)/(a*sin(c + d*x)^2)^(1/2), x)