3.266 \(\int (a+b \sec (c+d x)) \tan ^2(c+d x) \, dx\)

Optimal. Leaf size=45 \[ \frac {\tan (c+d x) (2 a+b \sec (c+d x))}{2 d}-a x-\frac {b \tanh ^{-1}(\sin (c+d x))}{2 d} \]

[Out]

-a*x-1/2*b*arctanh(sin(d*x+c))/d+1/2*(2*a+b*sec(d*x+c))*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3881, 3770} \[ \frac {\tan (c+d x) (2 a+b \sec (c+d x))}{2 d}-a x-\frac {b \tanh ^{-1}(\sin (c+d x))}{2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-(a*x) - (b*ArcTanh[Sin[c + d*x]])/(2*d) + ((2*a + b*Sec[c + d*x])*Tan[c + d*x])/(2*d)

Rule 3770

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

Rule 3881

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 60, normalized size = 1.33 \[ -\frac {a \tan ^{-1}(\tan (c+d x))}{d}+\frac {a \tan (c+d x)}{d}-\frac {b \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b \tan (c+d x) \sec (c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-((a*ArcTan[Tan[c + d*x]])/d) - (b*ArcTanh[Sin[c + d*x]])/(2*d) + (a*Tan[c + d*x])/d + (b*Sec[c + d*x]*Tan[c +
 d*x])/(2*d)

________________________________________________________________________________________

fricas [B]  time = 0.57, size = 87, normalized size = 1.93 \[ -\frac {4 \, a d x \cos \left (d x + c\right )^{2} + b \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - b \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (2 \, a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*(4*a*d*x*cos(d*x + c)^2 + b*cos(d*x + c)^2*log(sin(d*x + c) + 1) - b*cos(d*x + c)^2*log(-sin(d*x + c) + 1
) - 2*(2*a*cos(d*x + c) + b)*sin(d*x + c))/(d*cos(d*x + c)^2)

________________________________________________________________________________________

giac [B]  time = 1.52, size = 115, normalized size = 2.56 \[ -\frac {2 \, {\left (d x + c\right )} a + b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.41, size = 78, normalized size = 1.73 \[ -a x +\frac {a \tan \left (d x +c \right )}{d}-\frac {c a}{d}+\frac {b \left (\sin ^{3}\left (d x +c \right )\right )}{2 d \cos \left (d x +c \right )^{2}}+\frac {b \sin \left (d x +c \right )}{2 d}-\frac {b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-a*x+a*tan(d*x+c)/d-1/d*c*a+1/2/d*b*sin(d*x+c)^3/cos(d*x+c)^2+1/2*b*sin(d*x+c)/d-1/2/d*b*ln(sec(d*x+c)+tan(d*x
+c))

________________________________________________________________________________________

maxima [A]  time = 0.74, size = 65, normalized size = 1.44 \[ -\frac {4 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a + b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*(4*(d*x + c - tan(d*x + c))*a + b*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) + log(sin(d*x + c) + 1) - log(sin(
d*x + c) - 1)))/d

________________________________________________________________________________________

mupad [B]  time = 1.39, size = 96, normalized size = 2.13 \[ \frac {a\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}-\frac {b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {2\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {b\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(a*sin(c + d*x))/(d*cos(c + d*x)) - (b*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d - (2*a*atan(sin(c/2 + (
d*x)/2)/cos(c/2 + (d*x)/2)))/d + (b*sin(c + d*x))/(2*d*cos(c + d*x)^2)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________