\(\int \tan (a+b x) \, dx\) [109]

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

Optimal result

Integrand size = 6, antiderivative size = 12 \[ \int \tan (a+b x) \, dx=-\frac {\log (\cos (a+b x))}{b} \]

[Out]

-ln(cos(b*x+a))/b

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3556} \[ \int \tan (a+b x) \, dx=-\frac {\log (\cos (a+b x))}{b} \]

[In]

Int[Tan[a + b*x],x]

[Out]

-(Log[Cos[a + b*x]]/b)

Rule 3556

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

Rubi steps \begin{align*} \text {integral}& = -\frac {\log (\cos (a+b x))}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int \tan (a+b x) \, dx=-\frac {\log (\cos (a+b x))}{b} \]

[In]

Integrate[Tan[a + b*x],x]

[Out]

-(Log[Cos[a + b*x]]/b)

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.42

method result size
derivativedivides \(\frac {\ln \left (1+\tan ^{2}\left (b x +a \right )\right )}{2 b}\) \(17\)
default \(\frac {\ln \left (1+\tan ^{2}\left (b x +a \right )\right )}{2 b}\) \(17\)
norman \(\frac {\ln \left (1+\tan ^{2}\left (b x +a \right )\right )}{2 b}\) \(17\)
parallelrisch \(\frac {\ln \left (1+\tan ^{2}\left (b x +a \right )\right )}{2 b}\) \(17\)
risch \(i x +\frac {2 i a}{b}-\frac {\ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}{b}\) \(30\)

[In]

int(tan(b*x+a),x,method=_RETURNVERBOSE)

[Out]

1/2/b*ln(1+tan(b*x+a)^2)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.50 \[ \int \tan (a+b x) \, dx=-\frac {\log \left (\frac {1}{\tan \left (b x + a\right )^{2} + 1}\right )}{2 \, b} \]

[In]

integrate(tan(b*x+a),x, algorithm="fricas")

[Out]

-1/2*log(1/(tan(b*x + a)^2 + 1))/b

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.58 \[ \int \tan (a+b x) \, dx=\begin {cases} \frac {\log {\left (\tan ^{2}{\left (a + b x \right )} + 1 \right )}}{2 b} & \text {for}\: b \neq 0 \\x \tan {\left (a \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(tan(b*x+a),x)

[Out]

Piecewise((log(tan(a + b*x)**2 + 1)/(2*b), Ne(b, 0)), (x*tan(a), True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.92 \[ \int \tan (a+b x) \, dx=\frac {\log \left (\sec \left (b x + a\right )\right )}{b} \]

[In]

integrate(tan(b*x+a),x, algorithm="maxima")

[Out]

log(sec(b*x + a))/b

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.08 \[ \int \tan (a+b x) \, dx=-\frac {\log \left ({\left | \cos \left (b x + a\right ) \right |}\right )}{b} \]

[In]

integrate(tan(b*x+a),x, algorithm="giac")

[Out]

-log(abs(cos(b*x + a)))/b

Mupad [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.33 \[ \int \tan (a+b x) \, dx=\frac {\ln \left ({\mathrm {tan}\left (a+b\,x\right )}^2+1\right )}{2\,b} \]

[In]

int(tan(a + b*x),x)

[Out]

log(tan(a + b*x)^2 + 1)/(2*b)