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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2861, 12, 2638} \[ \frac {\sec (c+d x) (a+b \sin (c+d x))^2}{d}-2 a b x+\frac {2 b^2 \cos (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-2*a*b*x + (2*b^2*Cos[c + d*x])/d + (Sec[c + d*x]*(a + b*Sin[c + d*x])^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 2638

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

Rule 2861

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*(d + c*Sin[e + f*x]))/(f*
g*(p + 1)), x] + Dist[1/(g^2*(p + 1)), Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x])^(m - 1)*Simp[a*c*(p +
 2) + b*d*m + b*c*(m + p + 2)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[a^2 - b^2, 0]
 && GtQ[m, 0] && LtQ[p, -1] && IntegerQ[2*m] &&  !(EqQ[m, 1] && NeQ[c^2 - d^2, 0] && SimplerQ[c + d*x, a + b*x
])

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.31, size = 66, normalized size = 1.57 \[ \frac {\sec (c+d x) \left (2 a^2+b^2 \cos (2 (c+d x))+3 b^2\right )-2 \left (a^2+2 a b (c+d x)-2 a b \tan (c+d x)+b^2\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 59, normalized size = 1.40 \[ -\frac {2 \, a b d x \cos \left (d x + c\right ) - b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}{d \cos \left (d x + c\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))^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.17, size = 82, normalized size = 1.95 \[ -\frac {2 \, {\left ({\left (d x + c\right )} a b + \frac {2 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{2} + 2 \, b^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1}\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))^2,x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.31, size = 75, normalized size = 1.79 \[ \frac {\frac {a^{2}}{\cos \left (d x +c \right )}+2 a b \left (\tan \left (d x +c \right )-d x -c \right )+b^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )}{d} \]

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))^2,x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.46, size = 56, normalized size = 1.33 \[ -\frac {2 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a b - b^{2} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} - \frac {a^{2}}{\cos \left (d x + c\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))^2,x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 12.25, size = 81, normalized size = 1.93 \[ -\frac {2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,a^2+4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+4\,b^2}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-1\right )}-2\,a\,b\,x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \sin {\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(sec(d*x+c)**2*sin(d*x+c)*(a+b*sin(d*x+c))**2,x)

[Out]

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

________________________________________________________________________________________