\(\int \sin (x) \sqrt {1+\tan ^2(x)} \, dx\) [81]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 13, antiderivative size = 15 \[ \int \sin (x) \sqrt {1+\tan ^2(x)} \, dx=-\cos (x) \log (\cos (x)) \sqrt {\sec ^2(x)} \]

[Out]

-cos(x)*ln(cos(x))*(sec(x)^2)^(1/2)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 15, 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.231, Rules used = {3738, 4210, 3556} \[ \int \sin (x) \sqrt {1+\tan ^2(x)} \, dx=-\cos (x) \sqrt {\sec ^2(x)} \log (\cos (x)) \]

[In]

Int[Sin[x]*Sqrt[1 + Tan[x]^2],x]

[Out]

-(Cos[x]*Log[Cos[x]]*Sqrt[Sec[x]^2])

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3738

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 4210

Int[(u_.)*((b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sec[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Sec[e + f*x]^n)^FracPart[p]/(Sec[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Sec[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rubi steps \begin{align*} \text {integral}& = \int \sqrt {\sec ^2(x)} \sin (x) \, dx \\ & = \left (\cos (x) \sqrt {\sec ^2(x)}\right ) \int \tan (x) \, dx \\ & = -\cos (x) \log (\cos (x)) \sqrt {\sec ^2(x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \sin (x) \sqrt {1+\tan ^2(x)} \, dx=-\cos (x) \log (\cos (x)) \sqrt {\sec ^2(x)} \]

[In]

Integrate[Sin[x]*Sqrt[1 + Tan[x]^2],x]

[Out]

-(Cos[x]*Log[Cos[x]]*Sqrt[Sec[x]^2])

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 0.37 (sec) , antiderivative size = 36, normalized size of antiderivative = 2.40

method result size
default \(-\operatorname {csgn}\left (\sec \left (x \right )\right ) \left (\ln \left (1+\csc \left (x \right )-\cot \left (x \right )\right )+\ln \left (\csc \left (x \right )-\cot \left (x \right )-1\right )-\ln \left (\frac {2}{1+\cos \left (x \right )}\right )\right )\) \(36\)
risch \(2 i \sqrt {\frac {{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, x \cos \left (x \right )-2 \sqrt {\frac {{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{2 i x}+1\right ) \cos \left (x \right )\) \(54\)

[In]

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

[Out]

-csgn(sec(x))*(ln(1+csc(x)-cot(x))+ln(csc(x)-cot(x)-1)-ln(2/(1+cos(x))))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.33 \[ \int \sin (x) \sqrt {1+\tan ^2(x)} \, dx=\log \left (-\cos \left (x\right )\right ) \]

[In]

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

[Out]

log(-cos(x))

Sympy [F]

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

[In]

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

[Out]

Integral(sqrt(tan(x)**2 + 1)*sin(x), x)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.87 \[ \int \sin (x) \sqrt {1+\tan ^2(x)} \, dx=-\sqrt {\frac {1}{\cos \left (x\right )^{2}}} \cos \left (x\right ) \log \left (\cos \left (x\right )\right ) \]

[In]

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

[Out]

-sqrt(cos(x)^(-2))*cos(x)*log(cos(x))

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.40 \[ \int \sin (x) \sqrt {1+\tan ^2(x)} \, dx=-\log \left ({\left | \cos \left (x\right ) \right |}\right ) \]

[In]

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

[Out]

-log(abs(cos(x)))

Mupad [F(-1)]

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

[In]

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

[Out]

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