3.67 \(\int \frac {\tan ^2(c+d x)}{a+a \sec (c+d x)} \, dx\)

Optimal. Leaf size=21 \[ \frac {\tanh ^{-1}(\sin (c+d x))}{a d}-\frac {x}{a} \]

[Out]

-x/a+arctanh(sin(d*x+c))/a/d

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3888, 3770} \[ \frac {\tanh ^{-1}(\sin (c+d x))}{a d}-\frac {x}{a} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^2/(a + a*Sec[c + d*x]),x]

[Out]

-(x/a) + ArcTanh[Sin[c + d*x]]/(a*d)

Rule 3770

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

Rule 3888

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[a^(2*n
)/e^(2*n), Int[(e*Cot[c + d*x])^(m + 2*n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && E
qQ[a^2 - b^2, 0] && ILtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {\tan ^2(c+d x)}{a+a \sec (c+d x)} \, dx &=\frac {\int (-a+a \sec (c+d x)) \, dx}{a^2}\\ &=-\frac {x}{a}+\frac {\int \sec (c+d x) \, dx}{a}\\ &=-\frac {x}{a}+\frac {\tanh ^{-1}(\sin (c+d x))}{a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.09, size = 60, normalized size = 2.86 \[ -\frac {\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+d x}{a d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^2/(a + a*Sec[c + d*x]),x]

[Out]

-((d*x + Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]])/(a*d))

________________________________________________________________________________________

fricas [A]  time = 0.83, size = 35, normalized size = 1.67 \[ -\frac {2 \, d x - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, a d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.57, size = 50, normalized size = 2.38 \[ -\frac {\frac {d x + c}{a} - \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a} + \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-((d*x + c)/a - log(abs(tan(1/2*d*x + 1/2*c) + 1))/a + log(abs(tan(1/2*d*x + 1/2*c) - 1))/a)/d

________________________________________________________________________________________

maple [B]  time = 0.32, size = 59, normalized size = 2.81 \[ -\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a d}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a d}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/a/d*ln(tan(1/2*d*x+1/2*c)-1)+1/a/d*ln(tan(1/2*d*x+1/2*c)+1)-2/a/d*arctan(tan(1/2*d*x+1/2*c))

________________________________________________________________________________________

maxima [B]  time = 0.64, size = 78, normalized size = 3.71 \[ -\frac {\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} + \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(2*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a - log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a + log(sin(d*x + c)/
(cos(d*x + c) + 1) - 1)/a)/d

________________________________________________________________________________________

mupad [B]  time = 1.11, size = 25, normalized size = 1.19 \[ \frac {2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}-\frac {x}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*atanh(tan(c/2 + (d*x)/2)))/(a*d) - x/a

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\tan ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral(tan(c + d*x)**2/(sec(c + d*x) + 1), x)/a

________________________________________________________________________________________