3.1342 \(\int \frac {\sec (c+d x) \tan (c+d x)}{a+b \sin (c+d x)} \, dx\)

Optimal. Leaf size=82 \[ \frac {2 a b \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{d \left (a^2-b^2\right )^{3/2}}+\frac {\sec (c+d x) (a-b \sin (c+d x))}{d \left (a^2-b^2\right )} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2866, 12, 2660, 618, 204} \[ \frac {2 a b \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{d \left (a^2-b^2\right )^{3/2}}+\frac {\sec (c+d x) (a-b \sin (c+d x))}{d \left (a^2-b^2\right )} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 204

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

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 2660

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[(2*e)/d, Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 2866

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.)
 + (f_.)*(x_)]), x_Symbol] :> Simp[((g*Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^(m + 1)*(b*c - a*d - (a*c -
b*d)*Sin[e + f*x]))/(f*g*(a^2 - b^2)*(p + 1)), x] + Dist[1/(g^2*(a^2 - b^2)*(p + 1)), Int[(g*Cos[e + f*x])^(p
+ 2)*(a + b*Sin[e + f*x])^m*Simp[c*(a^2*(p + 2) - b^2*(m + p + 2)) + a*b*d*m + b*(a*c - b*d)*(m + p + 3)*Sin[e
 + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && NeQ[a^2 - b^2, 0] && LtQ[p, -1] && IntegerQ[2*m]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.18, size = 151, normalized size = 1.84 \[ \frac {\sqrt {a^2-b^2} (a (-\cos (c+d x))+a-b \sin (c+d x))+2 a b \cos (c+d x) \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{d (a-b) (a+b) \sqrt {a^2-b^2} \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(2*a*b*ArcTan[(b + a*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]]*Cos[c + d*x] + Sqrt[a^2 - b^2]*(a - a*Cos[c + d*x] - b
*Sin[c + d*x]))/((a - b)*(a + b)*Sqrt[a^2 - b^2]*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])*(Cos[(c + d*x)/2] + S
in[(c + d*x)/2]))

________________________________________________________________________________________

fricas [A]  time = 0.66, size = 308, normalized size = 3.76 \[ \left [\frac {\sqrt {-a^{2} + b^{2}} a b \cos \left (d x + c\right ) \log \left (-\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} - 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right ) + 2 \, a^{3} - 2 \, a b^{2} - 2 \, {\left (a^{2} b - b^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} d \cos \left (d x + c\right )}, -\frac {\sqrt {a^{2} - b^{2}} a b \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right ) \cos \left (d x + c\right ) - a^{3} + a b^{2} + {\left (a^{2} b - b^{3}\right )} \sin \left (d x + c\right )}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} d \cos \left (d x + c\right )}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

[1/2*(sqrt(-a^2 + b^2)*a*b*cos(d*x + c)*log(-((2*a^2 - b^2)*cos(d*x + c)^2 - 2*a*b*sin(d*x + c) - a^2 - b^2 -
2*(a*cos(d*x + c)*sin(d*x + c) + b*cos(d*x + c))*sqrt(-a^2 + b^2))/(b^2*cos(d*x + c)^2 - 2*a*b*sin(d*x + c) -
a^2 - b^2)) + 2*a^3 - 2*a*b^2 - 2*(a^2*b - b^3)*sin(d*x + c))/((a^4 - 2*a^2*b^2 + b^4)*d*cos(d*x + c)), -(sqrt
(a^2 - b^2)*a*b*arctan(-(a*sin(d*x + c) + b)/(sqrt(a^2 - b^2)*cos(d*x + c)))*cos(d*x + c) - a^3 + a*b^2 + (a^2
*b - b^3)*sin(d*x + c))/((a^4 - 2*a^2*b^2 + b^4)*d*cos(d*x + c))]

________________________________________________________________________________________

giac [A]  time = 0.22, size = 106, normalized size = 1.29 \[ \frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (a) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )} a b}{{\left (a^{2} - b^{2}\right )}^{\frac {3}{2}}} + \frac {b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a}{{\left (a^{2} - b^{2}\right )} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}}\right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*((pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(a) + arctan((a*tan(1/2*d*x + 1/2*c) + b)/sqrt(a^2 - b^2)))*a*b/(a^2 -
 b^2)^(3/2) + (b*tan(1/2*d*x + 1/2*c) - a)/((a^2 - b^2)*(tan(1/2*d*x + 1/2*c)^2 - 1)))/d

________________________________________________________________________________________

maple [A]  time = 0.30, size = 116, normalized size = 1.41 \[ -\frac {4}{d \left (4 a +4 b \right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {4}{d \left (4 a -4 b \right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {2 a b \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{d \left (a -b \right ) \left (a +b \right ) \sqrt {a^{2}-b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?`
 for more details)Is 4*b^2-4*a^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 12.02, size = 151, normalized size = 1.84 \[ \frac {2\,a\,b\,\mathrm {atan}\left (\frac {\frac {a\,b\,\left (2\,a^2\,b-2\,b^3\right )}{{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}+\frac {2\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )}{{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}}{2\,a\,b}\right )}{d\,{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}-\frac {\frac {2\,a}{a^2-b^2}-\frac {2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^2-b^2}}{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(sin(c + d*x)/(cos(c + d*x)^2*(a + b*sin(c + d*x))),x)

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________