\(\int \sec ^5(c+d x) (a+b \sin (c+d x))^2 \, dx\) [389]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 115 \[ \int \sec ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\left (3 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{8 d}+\frac {(a+b) (3 a+b)}{16 d (1-\sin (c+d x))}-\frac {(a-b) (3 a-b)}{16 d (1+\sin (c+d x))}+\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^2 \tan (c+d x)}{4 d} \] Output:

1/8*(3*a^2-b^2)*arctanh(sin(d*x+c))/d+1/16*(a+b)*(3*a+b)/d/(1-sin(d*x+c))- 
1/16*(a-b)*(3*a-b)/d/(1+sin(d*x+c))+1/4*sec(d*x+c)^3*(a+b*sin(d*x+c))^2*ta 
n(d*x+c)/d
 

Mathematica [A] (verified)

Time = 0.83 (sec) , antiderivative size = 166, normalized size of antiderivative = 1.44 \[ \int \sec ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {4 \left (-a^2+b^2\right ) \sec ^4(c+d x) (b-a \sin (c+d x)) (a+b \sin (c+d x))^3+\left (-3 a^2+b^2\right ) \left (\left (a^2-b^2\right )^2 (\log (1-\sin (c+d x))-\log (1+\sin (c+d x)))+2 a^3 b \sec ^2(c+d x)-2 \left (a^4-b^4\right ) \sec (c+d x) \tan (c+d x)+\left (-6 a^3 b+4 a b^3\right ) \tan ^2(c+d x)\right )}{16 \left (a^2-b^2\right )^2 d} \] Input:

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

Output:

(4*(-a^2 + b^2)*Sec[c + d*x]^4*(b - a*Sin[c + d*x])*(a + b*Sin[c + d*x])^3 
 + (-3*a^2 + b^2)*((a^2 - b^2)^2*(Log[1 - Sin[c + d*x]] - Log[1 + Sin[c + 
d*x]]) + 2*a^3*b*Sec[c + d*x]^2 - 2*(a^4 - b^4)*Sec[c + d*x]*Tan[c + d*x] 
+ (-6*a^3*b + 4*a*b^3)*Tan[c + d*x]^2))/(16*(a^2 - b^2)^2*d)
 

Rubi [A] (verified)

Time = 0.38 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.23, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 3147, 477, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

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

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a+b \sin (c+d x))^2}{\cos (c+d x)^5}dx\)

\(\Big \downarrow \) 3147

\(\displaystyle \frac {b^5 \int \frac {(a+b \sin (c+d x))^2}{\left (b^2-b^2 \sin ^2(c+d x)\right )^3}d(b \sin (c+d x))}{d}\)

\(\Big \downarrow \) 477

\(\displaystyle \frac {\int \left (\frac {(a+b)^2 b^3}{8 (b-b \sin (c+d x))^3}+\frac {(a-b)^2 b^3}{8 (\sin (c+d x) b+b)^3}+\frac {\left (3 a^2-b^2\right ) b^2}{8 \left (b^2-b^2 \sin ^2(c+d x)\right )}+\frac {(3 a-b) (a+b) b^2}{16 (b-b \sin (c+d x))^2}+\frac {(a-b) (3 a+b) b^2}{16 (\sin (c+d x) b+b)^2}\right )d(b \sin (c+d x))}{b d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {1}{8} b \left (3 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))+\frac {b^3 (a+b)^2}{16 (b-b \sin (c+d x))^2}-\frac {b^3 (a-b)^2}{16 (b \sin (c+d x)+b)^2}+\frac {b^2 (3 a-b) (a+b)}{16 (b-b \sin (c+d x))}-\frac {b^2 (a-b) (3 a+b)}{16 (b \sin (c+d x)+b)}}{b d}\)

Input:

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

Output:

((b*(3*a^2 - b^2)*ArcTanh[Sin[c + d*x]])/8 + (b^3*(a + b)^2)/(16*(b - b*Si 
n[c + d*x])^2) + ((3*a - b)*b^2*(a + b))/(16*(b - b*Sin[c + d*x])) - ((a - 
 b)^2*b^3)/(16*(b + b*Sin[c + d*x])^2) - ((a - b)*b^2*(3*a + b))/(16*(b + 
b*Sin[c + d*x])))/(b*d)
 

Defintions of rubi rules used

rule 477
Int[((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[ 
a^p   Int[ExpandIntegrand[(c + d*x)^n*(1 - Rt[-b/a, 2]*x)^p*(1 + Rt[-b/a, 2 
]*x)^p, x], x], x] /; FreeQ[{a, b, c, d}, x] && ILtQ[p, 0] && IntegerQ[n] & 
& NiceSqrtQ[-b/a] &&  !FractionalPowerFactorQ[Rt[-b/a, 2]]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3147
Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m 
_.), x_Symbol] :> Simp[1/(b^p*f)   Subst[Int[(a + x)^m*(b^2 - x^2)^((p - 1) 
/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && IntegerQ[(p 
 - 1)/2] && NeQ[a^2 - b^2, 0]
 
Maple [A] (verified)

Time = 0.60 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.14

method result size
derivativedivides \(\frac {a^{2} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {a b}{2 \cos \left (d x +c \right )^{4}}+b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(131\)
default \(\frac {a^{2} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {a b}{2 \cos \left (d x +c \right )^{4}}+b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(131\)
parallelrisch \(\frac {-6 \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \left (a^{2}-\frac {b^{2}}{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+6 \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \left (a^{2}-\frac {b^{2}}{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-8 a b \cos \left (2 d x +2 c \right )-2 a b \cos \left (4 d x +4 c \right )+\left (3 a^{2}-b^{2}\right ) \sin \left (3 d x +3 c \right )+\left (11 a^{2}+7 b^{2}\right ) \sin \left (d x +c \right )+10 a b}{4 d \left (3+4 \cos \left (2 d x +2 c \right )+\cos \left (4 d x +4 c \right )\right )}\) \(190\)
risch \(\frac {i {\mathrm e}^{i \left (d x +c \right )} \left (-3 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-11 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-7 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+11 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+7 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-32 i a b \,{\mathrm e}^{3 i \left (d x +c \right )}+3 a^{2}-b^{2}\right )}{4 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{8 d}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{8 d}\) \(238\)
norman \(\frac {\frac {8 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}+\frac {8 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{d}+\frac {\left (5 a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (5 a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{4 d}+\frac {\left (7 a^{2}+11 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{2 d}+\frac {\left (7 a^{2}+11 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{2 d}+\frac {\left (13 a^{2}+9 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{4 d}+\frac {\left (13 a^{2}+9 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{4 d}+\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}+\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}}{d}+\frac {8 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{4} \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-\frac {\left (3 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {\left (3 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) \(336\)

Input:

int(sec(d*x+c)^5*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)
 

Output:

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

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.03 \[ \int \sec ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {{\left (3 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (3 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 8 \, a b + 2 \, {\left ({\left (3 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, a^{2} + 2 \, b^{2}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )^{4}} \] Input:

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

Output:

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

Sympy [F]

\[ \int \sec ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \sec ^{5}{\left (c + d x \right )}\, dx \] Input:

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.00 \[ \int \sec ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {{\left (3 \, a^{2} - b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (3 \, a^{2} - b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left ({\left (3 \, a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{3} - 4 \, a b - {\left (5 \, a^{2} + b^{2}\right )} \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1}}{16 \, d} \] Input:

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.07 \[ \int \sec ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {{\left (3 \, a^{2} - b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{16 \, d} - \frac {{\left (3 \, a^{2} - b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{16 \, d} - \frac {3 \, a^{2} \sin \left (d x + c\right )^{3} - b^{2} \sin \left (d x + c\right )^{3} - 5 \, a^{2} \sin \left (d x + c\right ) - b^{2} \sin \left (d x + c\right ) - 4 \, a b}{8 \, {\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2} d} \] Input:

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

Output:

1/16*(3*a^2 - b^2)*log(abs(sin(d*x + c) + 1))/d - 1/16*(3*a^2 - b^2)*log(a 
bs(sin(d*x + c) - 1))/d - 1/8*(3*a^2*sin(d*x + c)^3 - b^2*sin(d*x + c)^3 - 
 5*a^2*sin(d*x + c) - b^2*sin(d*x + c) - 4*a*b)/((sin(d*x + c)^2 - 1)^2*d)
 

Mupad [B] (verification not implemented)

Time = 15.74 (sec) , antiderivative size = 93, normalized size of antiderivative = 0.81 \[ \int \sec ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\mathrm {atanh}\left (\sin \left (c+d\,x\right )\right )\,\left (\frac {3\,a^2}{8}-\frac {b^2}{8}\right )}{d}+\frac {\left (\frac {b^2}{8}-\frac {3\,a^2}{8}\right )\,{\sin \left (c+d\,x\right )}^3+\left (\frac {5\,a^2}{8}+\frac {b^2}{8}\right )\,\sin \left (c+d\,x\right )+\frac {a\,b}{2}}{d\,\left ({\sin \left (c+d\,x\right )}^4-2\,{\sin \left (c+d\,x\right )}^2+1\right )} \] Input:

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

Output:

(atanh(sin(c + d*x))*((3*a^2)/8 - b^2/8))/d + ((a*b)/2 + sin(c + d*x)*((5* 
a^2)/8 + b^2/8) - sin(c + d*x)^3*((3*a^2)/8 - b^2/8))/(d*(sin(c + d*x)^4 - 
 2*sin(c + d*x)^2 + 1))
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 364, normalized size of antiderivative = 3.17 \[ \int \sec ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {-3 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{4} a^{2}+\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{4} b^{2}+6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} a^{2}-2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} b^{2}-3 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a^{2}+\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b^{2}+3 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{4} a^{2}-\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{4} b^{2}-6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} a^{2}+2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} b^{2}+3 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a^{2}-\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b^{2}-4 \sin \left (d x +c \right )^{4} a b -3 \sin \left (d x +c \right )^{3} a^{2}+\sin \left (d x +c \right )^{3} b^{2}+8 \sin \left (d x +c \right )^{2} a b +5 \sin \left (d x +c \right ) a^{2}+\sin \left (d x +c \right ) b^{2}}{8 d \left (\sin \left (d x +c \right )^{4}-2 \sin \left (d x +c \right )^{2}+1\right )} \] Input:

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

Output:

( - 3*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a**2 + log(tan((c + d*x)/2 
) - 1)*sin(c + d*x)**4*b**2 + 6*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2* 
a**2 - 2*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*b**2 - 3*log(tan((c + d 
*x)/2) - 1)*a**2 + log(tan((c + d*x)/2) - 1)*b**2 + 3*log(tan((c + d*x)/2) 
 + 1)*sin(c + d*x)**4*a**2 - log(tan((c + d*x)/2) + 1)*sin(c + d*x)**4*b** 
2 - 6*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a**2 + 2*log(tan((c + d*x) 
/2) + 1)*sin(c + d*x)**2*b**2 + 3*log(tan((c + d*x)/2) + 1)*a**2 - log(tan 
((c + d*x)/2) + 1)*b**2 - 4*sin(c + d*x)**4*a*b - 3*sin(c + d*x)**3*a**2 + 
 sin(c + d*x)**3*b**2 + 8*sin(c + d*x)**2*a*b + 5*sin(c + d*x)*a**2 + sin( 
c + d*x)*b**2)/(8*d*(sin(c + d*x)**4 - 2*sin(c + d*x)**2 + 1))