\(\int \sec ^3(e+f x) (a+b \sec ^2(e+f x)) \, dx\) [153]

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 = 70 \[ \int \sec ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {(4 a+3 b) \text {arctanh}(\sin (e+f x))}{8 f}+\frac {(4 a+3 b) \sec (e+f x) \tan (e+f x)}{8 f}+\frac {b \sec ^3(e+f x) \tan (e+f x)}{4 f} \] Output:

1/8*(4*a+3*b)*arctanh(sin(f*x+e))/f+1/8*(4*a+3*b)*sec(f*x+e)*tan(f*x+e)/f+ 
1/4*b*sec(f*x+e)^3*tan(f*x+e)/f
 

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.33 \[ \int \sec ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {a \text {arctanh}(\sin (e+f x))}{2 f}+\frac {3 b \text {arctanh}(\sin (e+f x))}{8 f}+\frac {a \sec (e+f x) \tan (e+f x)}{2 f}+\frac {3 b \sec (e+f x) \tan (e+f x)}{8 f}+\frac {b \sec ^3(e+f x) \tan (e+f x)}{4 f} \] Input:

Integrate[Sec[e + f*x]^3*(a + b*Sec[e + f*x]^2),x]
 

Output:

(a*ArcTanh[Sin[e + f*x]])/(2*f) + (3*b*ArcTanh[Sin[e + f*x]])/(8*f) + (a*S 
ec[e + f*x]*Tan[e + f*x])/(2*f) + (3*b*Sec[e + f*x]*Tan[e + f*x])/(8*f) + 
(b*Sec[e + f*x]^3*Tan[e + f*x])/(4*f)
 

Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.97, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4534, 3042, 4255, 3042, 4257}

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 ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \csc \left (e+f x+\frac {\pi }{2}\right )^3 \left (a+b \csc \left (e+f x+\frac {\pi }{2}\right )^2\right )dx\)

\(\Big \downarrow \) 4534

\(\displaystyle \frac {1}{4} (4 a+3 b) \int \sec ^3(e+f x)dx+\frac {b \tan (e+f x) \sec ^3(e+f x)}{4 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{4} (4 a+3 b) \int \csc \left (e+f x+\frac {\pi }{2}\right )^3dx+\frac {b \tan (e+f x) \sec ^3(e+f x)}{4 f}\)

\(\Big \downarrow \) 4255

\(\displaystyle \frac {1}{4} (4 a+3 b) \left (\frac {1}{2} \int \sec (e+f x)dx+\frac {\tan (e+f x) \sec (e+f x)}{2 f}\right )+\frac {b \tan (e+f x) \sec ^3(e+f x)}{4 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{4} (4 a+3 b) \left (\frac {1}{2} \int \csc \left (e+f x+\frac {\pi }{2}\right )dx+\frac {\tan (e+f x) \sec (e+f x)}{2 f}\right )+\frac {b \tan (e+f x) \sec ^3(e+f x)}{4 f}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {1}{4} (4 a+3 b) \left (\frac {\text {arctanh}(\sin (e+f x))}{2 f}+\frac {\tan (e+f x) \sec (e+f x)}{2 f}\right )+\frac {b \tan (e+f x) \sec ^3(e+f x)}{4 f}\)

Input:

Int[Sec[e + f*x]^3*(a + b*Sec[e + f*x]^2),x]
 

Output:

(b*Sec[e + f*x]^3*Tan[e + f*x])/(4*f) + ((4*a + 3*b)*(ArcTanh[Sin[e + f*x] 
]/(2*f) + (Sec[e + f*x]*Tan[e + f*x])/(2*f)))/4
 

Defintions of rubi rules used

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

rule 4255
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) 
  Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] 
&& IntegerQ[2*n]
 

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

rule 4534
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) 
+ (A_)), x_Symbol] :> Simp[(-C)*Cot[e + f*x]*((b*Csc[e + f*x])^m/(f*(m + 1) 
)), x] + Simp[(C*m + A*(m + 1))/(m + 1)   Int[(b*Csc[e + f*x])^m, x], x] /; 
 FreeQ[{b, e, f, A, C, m}, x] && NeQ[C*m + A*(m + 1), 0] &&  !LeQ[m, -1]
 
Maple [A] (verified)

Time = 1.48 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.21

method result size
derivativedivides \(\frac {a \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )+b \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )}{f}\) \(85\)
default \(\frac {a \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )+b \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )}{f}\) \(85\)
parts \(\frac {a \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )}{f}+\frac {b \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )}{f}\) \(87\)
parallelrisch \(\frac {-8 \left (a +\frac {3 b}{4}\right ) \left (\frac {3}{4}+\frac {\cos \left (4 f x +4 e \right )}{4}+\cos \left (2 f x +2 e \right )\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )+8 \left (a +\frac {3 b}{4}\right ) \left (\frac {3}{4}+\frac {\cos \left (4 f x +4 e \right )}{4}+\cos \left (2 f x +2 e \right )\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )+\left (4 a +3 b \right ) \sin \left (3 f x +3 e \right )+4 \sin \left (f x +e \right ) \left (\frac {11 b}{4}+a \right )}{4 f \left (\cos \left (4 f x +4 e \right )+4 \cos \left (2 f x +2 e \right )+3\right )}\) \(143\)
norman \(\frac {-\frac {\left (4 a -3 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{4 f}-\frac {\left (4 a -3 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{4 f}+\frac {\left (4 a +5 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}+\frac {\left (4 a +5 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{4 f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{4}}-\frac {\left (4 a +3 b \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{8 f}+\frac {\left (4 a +3 b \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{8 f}\) \(157\)
risch \(-\frac {i {\mathrm e}^{i \left (f x +e \right )} \left (4 a \,{\mathrm e}^{6 i \left (f x +e \right )}+3 b \,{\mathrm e}^{6 i \left (f x +e \right )}+4 a \,{\mathrm e}^{4 i \left (f x +e \right )}+11 b \,{\mathrm e}^{4 i \left (f x +e \right )}-4 a \,{\mathrm e}^{2 i \left (f x +e \right )}-11 b \,{\mathrm e}^{2 i \left (f x +e \right )}-4 a -3 b \right )}{4 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{4}}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) a}{2 f}+\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) b}{8 f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) a}{2 f}-\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) b}{8 f}\) \(199\)

Input:

int(sec(f*x+e)^3*(a+b*sec(f*x+e)^2),x,method=_RETURNVERBOSE)
 

Output:

1/f*(a*(1/2*sec(f*x+e)*tan(f*x+e)+1/2*ln(sec(f*x+e)+tan(f*x+e)))+b*(-(-1/4 
*sec(f*x+e)^3-3/8*sec(f*x+e))*tan(f*x+e)+3/8*ln(sec(f*x+e)+tan(f*x+e))))
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.36 \[ \int \sec ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {{\left (4 \, a + 3 \, b\right )} \cos \left (f x + e\right )^{4} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (4 \, a + 3 \, b\right )} \cos \left (f x + e\right )^{4} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left ({\left (4 \, a + 3 \, b\right )} \cos \left (f x + e\right )^{2} + 2 \, b\right )} \sin \left (f x + e\right )}{16 \, f \cos \left (f x + e\right )^{4}} \] Input:

integrate(sec(f*x+e)^3*(a+b*sec(f*x+e)^2),x, algorithm="fricas")
 

Output:

1/16*((4*a + 3*b)*cos(f*x + e)^4*log(sin(f*x + e) + 1) - (4*a + 3*b)*cos(f 
*x + e)^4*log(-sin(f*x + e) + 1) + 2*((4*a + 3*b)*cos(f*x + e)^2 + 2*b)*si 
n(f*x + e))/(f*cos(f*x + e)^4)
 

Sympy [F]

\[ \int \sec ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\int \left (a + b \sec ^{2}{\left (e + f x \right )}\right ) \sec ^{3}{\left (e + f x \right )}\, dx \] Input:

integrate(sec(f*x+e)**3*(a+b*sec(f*x+e)**2),x)
 

Output:

Integral((a + b*sec(e + f*x)**2)*sec(e + f*x)**3, x)
 

Maxima [A] (verification not implemented)

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

integrate(sec(f*x+e)^3*(a+b*sec(f*x+e)^2),x, algorithm="maxima")
 

Output:

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

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.40 \[ \int \sec ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {{\left (4 \, a + 3 \, b\right )} \log \left ({\left | \sin \left (f x + e\right ) + 1 \right |}\right ) - {\left (4 \, a + 3 \, b\right )} \log \left ({\left | \sin \left (f x + e\right ) - 1 \right |}\right ) - \frac {2 \, {\left (4 \, a \sin \left (f x + e\right )^{3} + 3 \, b \sin \left (f x + e\right )^{3} - 4 \, a \sin \left (f x + e\right ) - 5 \, b \sin \left (f x + e\right )\right )}}{{\left (\sin \left (f x + e\right )^{2} - 1\right )}^{2}}}{16 \, f} \] Input:

integrate(sec(f*x+e)^3*(a+b*sec(f*x+e)^2),x, algorithm="giac")
 

Output:

1/16*((4*a + 3*b)*log(abs(sin(f*x + e) + 1)) - (4*a + 3*b)*log(abs(sin(f*x 
 + e) - 1)) - 2*(4*a*sin(f*x + e)^3 + 3*b*sin(f*x + e)^3 - 4*a*sin(f*x + e 
) - 5*b*sin(f*x + e))/(sin(f*x + e)^2 - 1)^2)/f
 

Mupad [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.11 \[ \int \sec ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {\mathrm {atanh}\left (\sin \left (e+f\,x\right )\right )\,\left (\frac {a}{2}+\frac {3\,b}{8}\right )}{f}-\frac {{\sin \left (e+f\,x\right )}^3\,\left (\frac {a}{2}+\frac {3\,b}{8}\right )-\sin \left (e+f\,x\right )\,\left (\frac {a}{2}+\frac {5\,b}{8}\right )}{f\,\left ({\sin \left (e+f\,x\right )}^4-2\,{\sin \left (e+f\,x\right )}^2+1\right )} \] Input:

int((a + b/cos(e + f*x)^2)/cos(e + f*x)^3,x)
 

Output:

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

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 312, normalized size of antiderivative = 4.46 \[ \int \sec ^3(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {-4 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \sin \left (f x +e \right )^{4} a -3 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \sin \left (f x +e \right )^{4} b +8 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \sin \left (f x +e \right )^{2} a +6 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \sin \left (f x +e \right )^{2} b -4 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) a -3 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) b +4 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \sin \left (f x +e \right )^{4} a +3 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \sin \left (f x +e \right )^{4} b -8 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \sin \left (f x +e \right )^{2} a -6 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \sin \left (f x +e \right )^{2} b +4 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) a +3 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) b -4 \sin \left (f x +e \right )^{3} a -3 \sin \left (f x +e \right )^{3} b +4 \sin \left (f x +e \right ) a +5 \sin \left (f x +e \right ) b}{8 f \left (\sin \left (f x +e \right )^{4}-2 \sin \left (f x +e \right )^{2}+1\right )} \] Input:

int(sec(f*x+e)^3*(a+b*sec(f*x+e)^2),x)
 

Output:

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