Integrand size = 32, antiderivative size = 74 \[ \int \frac {\sec (e+f x) (c-c \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=-\frac {3 c^2 \text {arctanh}(\sin (e+f x))}{a f}+\frac {3 c^2 \tan (e+f x)}{a f}+\frac {2 \left (c^2-c^2 \sec (e+f x)\right ) \tan (e+f x)}{f (a+a \sec (e+f x))} \] Output:
-3*c^2*arctanh(sin(f*x+e))/a/f+3*c^2*tan(f*x+e)/a/f+2*(c^2-c^2*sec(f*x+e)) *tan(f*x+e)/f/(a+a*sec(f*x+e))
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.35 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.84 \[ \int \frac {\sec (e+f x) (c-c \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=\frac {4 \sqrt {2} c^2 \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},-\frac {1}{2},\frac {1}{2},\frac {1}{2} (1+\sec (e+f x))\right ) \tan \left (\frac {1}{2} (e+f x)\right )}{a f \sqrt {1-\sec (e+f x)}} \] Input:
Integrate[(Sec[e + f*x]*(c - c*Sec[e + f*x])^2)/(a + a*Sec[e + f*x]),x]
Output:
(4*Sqrt[2]*c^2*Hypergeometric2F1[-3/2, -1/2, 1/2, (1 + Sec[e + f*x])/2]*Ta n[(e + f*x)/2])/(a*f*Sqrt[1 - Sec[e + f*x]])
Time = 0.50 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.95, 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) (c-c \sec (e+f x))^2}{a \sec (e+f x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right ) \left (c-c \csc \left (e+f x+\frac {\pi }{2}\right )\right )^2}{a \csc \left (e+f x+\frac {\pi }{2}\right )+a}dx\) |
\(\Big \downarrow \) 4445 |
\(\displaystyle \frac {2 \tan (e+f x) \left (c^2-c^2 \sec (e+f x)\right )}{f (a \sec (e+f x)+a)}-\frac {3 c \int \sec (e+f x) (c-c \sec (e+f x))dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 \tan (e+f x) \left (c^2-c^2 \sec (e+f x)\right )}{f (a \sec (e+f x)+a)}-\frac {3 c \int \csc \left (e+f x+\frac {\pi }{2}\right ) \left (c-c \csc \left (e+f x+\frac {\pi }{2}\right )\right )dx}{a}\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle \frac {2 \tan (e+f x) \left (c^2-c^2 \sec (e+f x)\right )}{f (a \sec (e+f x)+a)}-\frac {3 c \left (c \int \sec (e+f x)dx-c \int \sec ^2(e+f x)dx\right )}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 \tan (e+f x) \left (c^2-c^2 \sec (e+f x)\right )}{f (a \sec (e+f x)+a)}-\frac {3 c \left (c \int \csc \left (e+f x+\frac {\pi }{2}\right )dx-c \int \csc \left (e+f x+\frac {\pi }{2}\right )^2dx\right )}{a}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle \frac {2 \tan (e+f x) \left (c^2-c^2 \sec (e+f x)\right )}{f (a \sec (e+f x)+a)}-\frac {3 c \left (\frac {c \int 1d(-\tan (e+f x))}{f}+c \int \csc \left (e+f x+\frac {\pi }{2}\right )dx\right )}{a}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {2 \tan (e+f x) \left (c^2-c^2 \sec (e+f x)\right )}{f (a \sec (e+f x)+a)}-\frac {3 c \left (c \int \csc \left (e+f x+\frac {\pi }{2}\right )dx-\frac {c \tan (e+f x)}{f}\right )}{a}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {2 \tan (e+f x) \left (c^2-c^2 \sec (e+f x)\right )}{f (a \sec (e+f x)+a)}-\frac {3 c \left (\frac {c \text {arctanh}(\sin (e+f x))}{f}-\frac {c \tan (e+f x)}{f}\right )}{a}\) |
Input:
Int[(Sec[e + f*x]*(c - c*Sec[e + f*x])^2)/(a + a*Sec[e + f*x]),x]
Output:
(2*(c^2 - c^2*Sec[e + f*x])*Tan[e + f*x])/(f*(a + a*Sec[e + f*x])) - (3*c* ((c*ArcTanh[Sin[e + f*x]])/f - (c*Tan[e + f*x])/f))/a
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.23 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.08
method | result | size |
derivativedivides | \(\frac {4 c^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-\frac {1}{4 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}-\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}-\frac {1}{4 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}+\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}\right )}{f a}\) | \(80\) |
default | \(\frac {4 c^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-\frac {1}{4 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}-\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}-\frac {1}{4 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}+\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}\right )}{f a}\) | \(80\) |
parallelrisch | \(\frac {c^{2} \left (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 )+5 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) \cos \left (f x +e \right )+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a f \cos \left (f x +e \right )}\) | \(86\) |
risch | \(\frac {2 i c^{2} \left (4 \,{\mathrm e}^{2 i \left (f x +e \right )}+{\mathrm e}^{i \left (f x +e \right )}+5\right )}{f a \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 c^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{a f}+\frac {3 c^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{a f}\) | \(110\) |
norman | \(\frac {\frac {6 c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}-\frac {10 c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{a f}+\frac {4 c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{a f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{2}}+\frac {3 c^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{a f}-\frac {3 c^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{a f}\) | \(129\) |
Input:
int(sec(f*x+e)*(c-c*sec(f*x+e))^2/(a+a*sec(f*x+e)),x,method=_RETURNVERBOSE )
Output:
4/f*c^2/a*(tan(1/2*f*x+1/2*e)-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/(tan(1/2*f*x+1/2*e)-1)+3/4*ln(tan(1/2*f*x+1/2*e)-1))
Time = 0.12 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.61 \[ \int \frac {\sec (e+f x) (c-c \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=-\frac {3 \, {\left (c^{2} \cos \left (f x + e\right )^{2} + c^{2} \cos \left (f x + e\right )\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) - 3 \, {\left (c^{2} \cos \left (f x + e\right )^{2} + c^{2} \cos \left (f x + e\right )\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) - 2 \, {\left (5 \, c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \sin \left (f x + e\right )}{2 \, {\left (a f \cos \left (f x + e\right )^{2} + a f \cos \left (f x + e\right )\right )}} \] Input:
integrate(sec(f*x+e)*(c-c*sec(f*x+e))^2/(a+a*sec(f*x+e)),x, algorithm="fri cas")
Output:
-1/2*(3*(c^2*cos(f*x + e)^2 + c^2*cos(f*x + e))*log(sin(f*x + e) + 1) - 3* (c^2*cos(f*x + e)^2 + c^2*cos(f*x + e))*log(-sin(f*x + e) + 1) - 2*(5*c^2* cos(f*x + e) + c^2)*sin(f*x + e))/(a*f*cos(f*x + e)^2 + a*f*cos(f*x + e))
\[ \int \frac {\sec (e+f x) (c-c \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=\frac {c^{2} \left (\int \frac {\sec {\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\, dx + \int \left (- \frac {2 \sec ^{2}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\right )\, dx + \int \frac {\sec ^{3}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\, dx\right )}{a} \] Input:
integrate(sec(f*x+e)*(c-c*sec(f*x+e))**2/(a+a*sec(f*x+e)),x)
Output:
c**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))/a
Leaf count of result is larger than twice the leaf count of optimal. 224 vs. \(2 (75) = 150\).
Time = 0.04 (sec) , antiderivative size = 224, normalized size of antiderivative = 3.03 \[ \int \frac {\sec (e+f x) (c-c \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=-\frac {c^{2} {\left (\frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{a} - \frac {2 \, \sin \left (f x + e\right )}{{\left (a - \frac {a \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (f x + e\right ) + 1\right )}} - \frac {\sin \left (f x + e\right )}{a {\left (\cos \left (f x + e\right ) + 1\right )}}\right )} + 2 \, c^{2} {\left (\frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{a} - \frac {\sin \left (f x + e\right )}{a {\left (\cos \left (f x + e\right ) + 1\right )}}\right )} - \frac {c^{2} \sin \left (f x + e\right )}{a {\left (\cos \left (f x + e\right ) + 1\right )}}}{f} \] Input:
integrate(sec(f*x+e)*(c-c*sec(f*x+e))^2/(a+a*sec(f*x+e)),x, algorithm="max ima")
Output:
-(c^2*(log(sin(f*x + e)/(cos(f*x + e) + 1) + 1)/a - log(sin(f*x + e)/(cos( f*x + e) + 1) - 1)/a - 2*sin(f*x + e)/((a - a*sin(f*x + e)^2/(cos(f*x + e) + 1)^2)*(cos(f*x + e) + 1)) - sin(f*x + e)/(a*(cos(f*x + e) + 1))) + 2*c^ 2*(log(sin(f*x + e)/(cos(f*x + e) + 1) + 1)/a - log(sin(f*x + e)/(cos(f*x + e) + 1) - 1)/a - sin(f*x + e)/(a*(cos(f*x + e) + 1))) - c^2*sin(f*x + e) /(a*(cos(f*x + e) + 1)))/f
Time = 0.16 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.31 \[ \int \frac {\sec (e+f x) (c-c \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=-\frac {\frac {3 \, c^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{a} - \frac {3 \, c^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{a} - \frac {4 \, c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{a} + \frac {2 \, c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )} a}}{f} \] Input:
integrate(sec(f*x+e)*(c-c*sec(f*x+e))^2/(a+a*sec(f*x+e)),x, algorithm="gia c")
Output:
-(3*c^2*log(abs(tan(1/2*f*x + 1/2*e) + 1))/a - 3*c^2*log(abs(tan(1/2*f*x + 1/2*e) - 1))/a - 4*c^2*tan(1/2*f*x + 1/2*e)/a + 2*c^2*tan(1/2*f*x + 1/2*e )/((tan(1/2*f*x + 1/2*e)^2 - 1)*a))/f
Time = 10.80 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.04 \[ \int \frac {\sec (e+f x) (c-c \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=\frac {4\,c^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{a\,f}+\frac {2\,c^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left (a-a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\right )}-\frac {6\,c^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{a\,f} \] Input:
int((c - c/cos(e + f*x))^2/(cos(e + f*x)*(a + a/cos(e + f*x))),x)
Output:
(4*c^2*tan(e/2 + (f*x)/2))/(a*f) + (2*c^2*tan(e/2 + (f*x)/2))/(f*(a - a*ta n(e/2 + (f*x)/2)^2)) - (6*c^2*atanh(tan(e/2 + (f*x)/2)))/(a*f)
Time = 0.15 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.32 \[ \int \frac {\sec (e+f x) (c-c \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=\frac {c^{2} \left (3 \cos \left (f x +e \right ) \mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \sin \left (f x +e \right )-3 \cos \left (f x +e \right ) \mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \sin \left (f x +e \right )+4 \cos \left (f x +e \right )+5 \sin \left (f x +e \right )^{2}-4\right )}{\cos \left (f x +e \right ) \sin \left (f x +e \right ) a f} \] Input:
int(sec(f*x+e)*(c-c*sec(f*x+e))^2/(a+a*sec(f*x+e)),x)
Output:
(c**2*(3*cos(e + f*x)*log(tan((e + f*x)/2) - 1)*sin(e + f*x) - 3*cos(e + f *x)*log(tan((e + f*x)/2) + 1)*sin(e + f*x) + 4*cos(e + f*x) + 5*sin(e + f* x)**2 - 4))/(cos(e + f*x)*sin(e + f*x)*a*f)