3.291 \(\int \frac {\cot (c+d x)}{a+b \sec (c+d x)} \, dx\)

Optimal. Leaf size=94 \[ -\frac {b^2 \log (a+b \sec (c+d x))}{a d \left (a^2-b^2\right )}+\frac {\log (1-\sec (c+d x))}{2 d (a+b)}+\frac {\log (\sec (c+d x)+1)}{2 d (a-b)}+\frac {\log (\cos (c+d x))}{a d} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 94, 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 = {3885, 894} \[ -\frac {b^2 \log (a+b \sec (c+d x))}{a d \left (a^2-b^2\right )}+\frac {\log (1-\sec (c+d x))}{2 d (a+b)}+\frac {\log (\sec (c+d x)+1)}{2 d (a-b)}+\frac {\log (\cos (c+d x))}{a d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]/(a + b*Sec[c + d*x]),x]

[Out]

Log[Cos[c + d*x]]/(a*d) + Log[1 - Sec[c + d*x]]/(2*(a + b)*d) + Log[1 + Sec[c + d*x]]/(2*(a - b)*d) - (b^2*Log
[a + b*Sec[c + d*x]])/(a*(a^2 - b^2)*d)

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 3885

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

Rubi steps

\begin {align*} \int \frac {\cot (c+d x)}{a+b \sec (c+d x)} \, dx &=-\frac {b^2 \operatorname {Subst}\left (\int \frac {1}{x (a+x) \left (b^2-x^2\right )} \, dx,x,b \sec (c+d x)\right )}{d}\\ &=-\frac {b^2 \operatorname {Subst}\left (\int \left (\frac {1}{2 b^2 (a+b) (b-x)}+\frac {1}{a b^2 x}+\frac {1}{a (a-b) (a+b) (a+x)}-\frac {1}{2 (a-b) b^2 (b+x)}\right ) \, dx,x,b \sec (c+d x)\right )}{d}\\ &=\frac {\log (\cos (c+d x))}{a d}+\frac {\log (1-\sec (c+d x))}{2 (a+b) d}+\frac {\log (1+\sec (c+d x))}{2 (a-b) d}-\frac {b^2 \log (a+b \sec (c+d x))}{a \left (a^2-b^2\right ) d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.11, size = 70, normalized size = 0.74 \[ \frac {b^2 (-\log (a \cos (c+d x)+b))+a (a-b) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+a (a+b) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{a d (a-b) (a+b)} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]/(a + b*Sec[c + d*x]),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.52, size = 75, normalized size = 0.80 \[ -\frac {2 \, b^{2} \log \left (a \cos \left (d x + c\right ) + b\right ) - {\left (a^{2} + a b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (a^{2} - a b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{3} - a b^{2}\right )} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.31, size = 257, normalized size = 2.73 \[ -\frac {\frac {a \log \left ({\left | -a - b + \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} \right |}\right )}{a^{2} - b^{2}} - \frac {{\left (a^{2} - 2 \, b^{2}\right )} \log \left (\frac {{\left | -2 \, b - \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - 2 \, {\left | a \right |} \right |}}{{\left | -2 \, b - \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + 2 \, {\left | a \right |} \right |}}\right )}{{\left (a^{2} - b^{2}\right )} {\left | a \right |}} - \frac {\log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{a + b}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.71, size = 80, normalized size = 0.85 \[ -\frac {b^{2} \ln \left (b +a \cos \left (d x +c \right )\right )}{d \left (a +b \right ) \left (a -b \right ) a}+\frac {\ln \left (-1+\cos \left (d x +c \right )\right )}{d \left (2 a +2 b \right )}+\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{d \left (2 a -2 b \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)/(a+b*sec(d*x+c)),x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.50, size = 68, normalized size = 0.72 \[ -\frac {\frac {2 \, b^{2} \log \left (a \cos \left (d x + c\right ) + b\right )}{a^{3} - a b^{2}} - \frac {\log \left (\cos \left (d x + c\right ) + 1\right )}{a - b} - \frac {\log \left (\cos \left (d x + c\right ) - 1\right )}{a + b}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 1.75, size = 93, normalized size = 0.99 \[ \frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d\,\left (a+b\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{a\,d}+\frac {b^2\,\ln \left (a+b-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d\,\left (a\,b^2-a^3\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)/(a + b/cos(c + d*x)),x)

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)/(a+b*sec(d*x+c)),x)

[Out]

Integral(cot(c + d*x)/(a + b*sec(c + d*x)), x)

________________________________________________________________________________________