3.1447 \(\int \csc (c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx\)

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

[Out]

-a*arctanh(cos(d*x+c))/d+a*sec(d*x+c)/d+b*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {2838, 2622, 321, 207, 3767, 8} \[ \frac {a \sec (c+d x)}{d}-\frac {a \tanh ^{-1}(\cos (c+d x))}{d}+\frac {b \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2622

Int[csc[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Dist[1/(f*a^n), Subst[Int
[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/2), x], x, a*Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n
 + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])

Rule 2838

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)
*(x_)]), x_Symbol] :> Dist[a, Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Dist[b/d, Int[(g*Cos[e + f*x
])^p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 56, normalized size = 1.56 \[ \frac {a \sec (c+d x)}{d}+\frac {a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}-\frac {a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {b \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 65, normalized size = 1.81 \[ -\frac {a \cos \left (d x + c\right ) \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - a \cos \left (d x + c\right ) \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 2 \, b \sin \left (d x + c\right ) - 2 \, a}{2 \, d \cos \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.20, size = 48, normalized size = 1.33 \[ \frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - \frac {2 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.42, size = 47, normalized size = 1.31 \[ \frac {a}{d \cos \left (d x +c \right )}+\frac {a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}+\frac {b \tan \left (d x +c \right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/d*a/cos(d*x+c)+1/d*a*ln(csc(d*x+c)-cot(d*x+c))+b*tan(d*x+c)/d

________________________________________________________________________________________

maxima [A]  time = 0.35, size = 48, normalized size = 1.33 \[ \frac {a {\left (\frac {2}{\cos \left (d x + c\right )} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + 2 \, b \tan \left (d x + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________