Integrand size = 32, antiderivative size = 74 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{c-c \sec (e+f x)} \, dx=-\frac {3 a^2 \text {arctanh}(\sin (e+f x))}{c f}-\frac {3 a^2 \tan (e+f x)}{c f}-\frac {2 \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{f (c-c \sec (e+f x))} \] Output:
-3*a^2*arctanh(sin(f*x+e))/c/f-3*a^2*tan(f*x+e)/c/f-2*(a^2+a^2*sec(f*x+e)) *tan(f*x+e)/f/(c-c*sec(f*x+e))
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.48 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.88 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{c-c \sec (e+f x)} \, dx=-\frac {a^2 \operatorname {Hypergeometric2F1}\left (\frac {3}{2},\frac {5}{2},\frac {7}{2},\frac {1}{2} (1+\sec (e+f x))\right ) (1+\sec (e+f x))^2 \tan (e+f x)}{5 c f \sqrt {2-2 \sec (e+f x)}} \] Input:
Integrate[(Sec[e + f*x]*(a + a*Sec[e + f*x])^2)/(c - c*Sec[e + f*x]),x]
Output:
-1/5*(a^2*Hypergeometric2F1[3/2, 5/2, 7/2, (1 + Sec[e + f*x])/2]*(1 + Sec[ e + f*x])^2*Tan[e + f*x])/(c*f*Sqrt[2 - 2*Sec[e + f*x]])
Time = 0.49 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.93, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3042, 4445, 3042, 4274, 3042, 4254, 24, 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 \frac {\sec (e+f x) (a \sec (e+f x)+a)^2}{c-c \sec (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right ) \left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )^2}{c-c \csc \left (e+f x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4445 |
\(\displaystyle -\frac {3 a \int \sec (e+f x) (\sec (e+f x) a+a)dx}{c}-\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{f (c-c \sec (e+f x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {3 a \int \csc \left (e+f x+\frac {\pi }{2}\right ) \left (\csc \left (e+f x+\frac {\pi }{2}\right ) a+a\right )dx}{c}-\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{f (c-c \sec (e+f x))}\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle -\frac {3 a \left (a \int \sec ^2(e+f x)dx+a \int \sec (e+f x)dx\right )}{c}-\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{f (c-c \sec (e+f x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {3 a \left (a \int \csc \left (e+f x+\frac {\pi }{2}\right )dx+a \int \csc \left (e+f x+\frac {\pi }{2}\right )^2dx\right )}{c}-\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{f (c-c \sec (e+f x))}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle -\frac {3 a \left (a \int \csc \left (e+f x+\frac {\pi }{2}\right )dx-\frac {a \int 1d(-\tan (e+f x))}{f}\right )}{c}-\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{f (c-c \sec (e+f x))}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle -\frac {3 a \left (a \int \csc \left (e+f x+\frac {\pi }{2}\right )dx+\frac {a \tan (e+f x)}{f}\right )}{c}-\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{f (c-c \sec (e+f x))}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle -\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{f (c-c \sec (e+f x))}-\frac {3 a \left (\frac {a \text {arctanh}(\sin (e+f x))}{f}+\frac {a \tan (e+f x)}{f}\right )}{c}\) |
Input:
Int[(Sec[e + f*x]*(a + a*Sec[e + f*x])^2)/(c - c*Sec[e + f*x]),x]
Output:
(-2*(a^2 + a^2*Sec[e + f*x])*Tan[e + f*x])/(f*(c - c*Sec[e + f*x])) - (3*a *((a*ArcTanh[Sin[e + f*x]])/f + (a*Tan[e + f*x])/f))/c
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[a Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d In t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(cs c[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.), x_Symbol] :> Simp[2*a*c*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((c + d*Csc[e + f*x])^(n - 1)/(b*f*(2*m + 1))), x] - Simp[d*((2*n - 1)/(b*(2*m + 1))) Int[Csc[e + f*x]*(a + b*Csc[e + f* x])^(m + 1)*(c + d*Csc[e + f*x])^(n - 1), x], x] /; FreeQ[{a, b, c, d, e, f }, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IGtQ[n, 0] && LtQ[m, -2^ (-1)] && IntegerQ[2*m]
Time = 0.18 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.11
method | result | size |
derivativedivides | \(\frac {4 a^{2} \left (\frac {1}{4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+4}-\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}+\frac {1}{4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-4}+\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}+\frac {1}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}\right )}{f c}\) | \(82\) |
default | \(\frac {4 a^{2} \left (\frac {1}{4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+4}-\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}+\frac {1}{4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-4}+\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}+\frac {1}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}\right )}{f c}\) | \(82\) |
parallelrisch | \(-\frac {a^{2} \left (-5 \cot \left (\frac {f x}{2}+\frac {e}{2}\right ) \cos \left (f x +e \right )-3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \cos \left (f x +e \right )+3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \cos \left (f x +e \right )+\cot \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c f \cos \left (f x +e \right )}\) | \(87\) |
risch | \(\frac {2 i a^{2} \left (4 \,{\mathrm e}^{2 i \left (f x +e \right )}-{\mathrm e}^{i \left (f x +e \right )}+5\right )}{f c \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{c f}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{c f}\) | \(112\) |
norman | \(\frac {\frac {4 a^{2}}{c f}-\frac {10 a^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{c f}+\frac {6 a^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{c f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}+\frac {3 a^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{c f}-\frac {3 a^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{c f}\) | \(131\) |
Input:
int(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c-c*sec(f*x+e)),x,method=_RETURNVERBOSE )
Output:
4/f*a^2/c*(1/4/(tan(1/2*f*x+1/2*e)+1)-3/4*ln(tan(1/2*f*x+1/2*e)+1)+1/4/(ta n(1/2*f*x+1/2*e)-1)+3/4*ln(tan(1/2*f*x+1/2*e)-1)+1/tan(1/2*f*x+1/2*e))
Time = 0.12 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.46 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{c-c \sec (e+f x)} \, dx=-\frac {3 \, a^{2} \cos \left (f x + e\right ) \log \left (\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) - 3 \, a^{2} \cos \left (f x + e\right ) \log \left (-\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) - 10 \, a^{2} \cos \left (f x + e\right )^{2} - 8 \, a^{2} \cos \left (f x + e\right ) + 2 \, a^{2}}{2 \, c f \cos \left (f x + e\right ) \sin \left (f x + e\right )} \] Input:
integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c-c*sec(f*x+e)),x, algorithm="fri cas")
Output:
-1/2*(3*a^2*cos(f*x + e)*log(sin(f*x + e) + 1)*sin(f*x + e) - 3*a^2*cos(f* x + e)*log(-sin(f*x + e) + 1)*sin(f*x + e) - 10*a^2*cos(f*x + e)^2 - 8*a^2 *cos(f*x + e) + 2*a^2)/(c*f*cos(f*x + e)*sin(f*x + e))
\[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{c-c \sec (e+f x)} \, dx=- \frac {a^{2} \left (\int \frac {\sec {\left (e + f x \right )}}{\sec {\left (e + f x \right )} - 1}\, dx + \int \frac {2 \sec ^{2}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} - 1}\, dx + \int \frac {\sec ^{3}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} - 1}\, dx\right )}{c} \] Input:
integrate(sec(f*x+e)*(a+a*sec(f*x+e))**2/(c-c*sec(f*x+e)),x)
Output:
-a**2*(Integral(sec(e + f*x)/(sec(e + f*x) - 1), x) + Integral(2*sec(e + f *x)**2/(sec(e + f*x) - 1), x) + Integral(sec(e + f*x)**3/(sec(e + f*x) - 1 ), x))/c
Leaf count of result is larger than twice the leaf count of optimal. 225 vs. \(2 (75) = 150\).
Time = 0.04 (sec) , antiderivative size = 225, normalized size of antiderivative = 3.04 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{c-c \sec (e+f x)} \, dx=-\frac {a^{2} {\left (\frac {\frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 1}{\frac {c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {c \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{c} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{c}\right )} + 2 \, a^{2} {\left (\frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{c} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{c} - \frac {\cos \left (f x + e\right ) + 1}{c \sin \left (f x + e\right )}\right )} - \frac {a^{2} {\left (\cos \left (f x + e\right ) + 1\right )}}{c \sin \left (f x + e\right )}}{f} \] Input:
integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c-c*sec(f*x+e)),x, algorithm="max ima")
Output:
-(a^2*((3*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 - 1)/(c*sin(f*x + e)/(cos(f* x + e) + 1) - c*sin(f*x + e)^3/(cos(f*x + e) + 1)^3) + log(sin(f*x + e)/(c os(f*x + e) + 1) + 1)/c - log(sin(f*x + e)/(cos(f*x + e) + 1) - 1)/c) + 2* a^2*(log(sin(f*x + e)/(cos(f*x + e) + 1) + 1)/c - log(sin(f*x + e)/(cos(f* x + e) + 1) - 1)/c - (cos(f*x + e) + 1)/(c*sin(f*x + e))) - a^2*(cos(f*x + e) + 1)/(c*sin(f*x + e)))/f
Time = 0.19 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.35 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{c-c \sec (e+f x)} \, dx=-\frac {\frac {3 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{c} - \frac {3 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{c} - \frac {2 \, {\left (3 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 \, a^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} c}}{f} \] Input:
integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c-c*sec(f*x+e)),x, algorithm="gia c")
Output:
-(3*a^2*log(abs(tan(1/2*f*x + 1/2*e) + 1))/c - 3*a^2*log(abs(tan(1/2*f*x + 1/2*e) - 1))/c - 2*(3*a^2*tan(1/2*f*x + 1/2*e)^2 - 2*a^2)/((tan(1/2*f*x + 1/2*e)^3 - tan(1/2*f*x + 1/2*e))*c))/f
Time = 11.14 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.04 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{c-c \sec (e+f x)} \, dx=\frac {6\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-4\,a^2}{c\,f\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )}-\frac {6\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{c\,f} \] Input:
int((a + a/cos(e + f*x))^2/(cos(e + f*x)*(c - c/cos(e + f*x))),x)
Output:
(6*a^2*tan(e/2 + (f*x)/2)^2 - 4*a^2)/(c*f*tan(e/2 + (f*x)/2)*(tan(e/2 + (f *x)/2)^2 - 1)) - (6*a^2*atanh(tan(e/2 + (f*x)/2)))/(c*f)
Time = 0.17 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.99 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{c-c \sec (e+f x)} \, dx=\frac {a^{2} \left (3 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}-3 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-3 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}+3 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+6 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-4\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )} \] Input:
int(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c-c*sec(f*x+e)),x)
Output:
(a**2*(3*log(tan((e + f*x)/2) - 1)*tan((e + f*x)/2)**3 - 3*log(tan((e + f* x)/2) - 1)*tan((e + f*x)/2) - 3*log(tan((e + f*x)/2) + 1)*tan((e + f*x)/2) **3 + 3*log(tan((e + f*x)/2) + 1)*tan((e + f*x)/2) + 6*tan((e + f*x)/2)**2 - 4))/(tan((e + f*x)/2)*c*f*(tan((e + f*x)/2)**2 - 1))