Integrand size = 32, antiderivative size = 89 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{(c-c \sec (e+f x))^2} \, dx=\frac {a^2 \text {arctanh}(\sin (e+f x))}{c^2 f}-\frac {2 \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{3 f (c-c \sec (e+f x))^2}+\frac {2 a^2 \tan (e+f x)}{f \left (c^2-c^2 \sec (e+f x)\right )} \] Output:
a^2*arctanh(sin(f*x+e))/c^2/f-2/3*(a^2+a^2*sec(f*x+e))*tan(f*x+e)/f/(c-c*s ec(f*x+e))^2+2*a^2*tan(f*x+e)/f/(c^2-c^2*sec(f*x+e))
Time = 0.17 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.22 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{(c-c \sec (e+f x))^2} \, dx=\frac {a^2 \left (-\frac {4 \cot \left (\frac {1}{2} (e+f x)\right )}{3 f}-\frac {2 \cot \left (\frac {1}{2} (e+f x)\right ) \csc ^2\left (\frac {1}{2} (e+f x)\right )}{3 f}-\frac {\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f}+\frac {\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f}\right )}{c^2} \] Input:
Integrate[(Sec[e + f*x]*(a + a*Sec[e + f*x])^2)/(c - c*Sec[e + f*x])^2,x]
Output:
(a^2*((-4*Cot[(e + f*x)/2])/(3*f) - (2*Cot[(e + f*x)/2]*Csc[(e + f*x)/2]^2 )/(3*f) - Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]]/f + Log[Cos[(e + f*x)/2 ] + Sin[(e + f*x)/2]]/f))/c^2
Time = 0.47 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {3042, 4445, 3042, 4445, 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 \frac {\sec (e+f x) (a \sec (e+f x)+a)^2}{(c-c \sec (e+f x))^2} \, 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}{\left (c-c \csc \left (e+f x+\frac {\pi }{2}\right )\right )^2}dx\) |
\(\Big \downarrow \) 4445 |
\(\displaystyle -\frac {a \int \frac {\sec (e+f x) (\sec (e+f x) a+a)}{c-c \sec (e+f x)}dx}{c}-\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{3 f (c-c \sec (e+f x))^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {a \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right ) \left (\csc \left (e+f x+\frac {\pi }{2}\right ) a+a\right )}{c-c \csc \left (e+f x+\frac {\pi }{2}\right )}dx}{c}-\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{3 f (c-c \sec (e+f x))^2}\) |
\(\Big \downarrow \) 4445 |
\(\displaystyle -\frac {a \left (-\frac {a \int \sec (e+f x)dx}{c}-\frac {2 a \tan (e+f x)}{f (c-c \sec (e+f x))}\right )}{c}-\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{3 f (c-c \sec (e+f x))^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {a \left (-\frac {a \int \csc \left (e+f x+\frac {\pi }{2}\right )dx}{c}-\frac {2 a \tan (e+f x)}{f (c-c \sec (e+f x))}\right )}{c}-\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{3 f (c-c \sec (e+f x))^2}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle -\frac {2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{3 f (c-c \sec (e+f x))^2}-\frac {a \left (-\frac {a \text {arctanh}(\sin (e+f x))}{c f}-\frac {2 a \tan (e+f x)}{f (c-c \sec (e+f x))}\right )}{c}\) |
Input:
Int[(Sec[e + f*x]*(a + a*Sec[e + f*x])^2)/(c - c*Sec[e + f*x])^2,x]
Output:
(-2*(a^2 + a^2*Sec[e + f*x])*Tan[e + f*x])/(3*f*(c - c*Sec[e + f*x])^2) - (a*(-((a*ArcTanh[Sin[e + f*x]])/(c*f)) - (2*a*Tan[e + f*x])/(f*(c - c*Sec[ e + f*x]))))/c
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, 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 = 65, normalized size of antiderivative = 0.73
method | result | size |
parallelrisch | \(\frac {a^{2} \left (-2 \cot \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}+3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )-3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )-6 \cot \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 c^{2} f}\) | \(65\) |
derivativedivides | \(\frac {2 a^{2} \left (\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{2}-\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{2}-\frac {1}{3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}-\frac {1}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}\right )}{f \,c^{2}}\) | \(67\) |
default | \(\frac {2 a^{2} \left (\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{2}-\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{2}-\frac {1}{3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}-\frac {1}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}\right )}{f \,c^{2}}\) | \(67\) |
risch | \(\frac {8 i a^{2} \left (3 \,{\mathrm e}^{i \left (f x +e \right )}-1\right )}{3 f \,c^{2} \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )^{3}}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{c^{2} f}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{c^{2} f}\) | \(87\) |
norman | \(\frac {-\frac {2 a^{2}}{3 c f}-\frac {2 a^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{3 c f}+\frac {10 a^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{3 c f}-\frac {2 a^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{c f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{2} c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}+\frac {a^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{c^{2} f}-\frac {a^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{c^{2} f}\) | \(155\) |
Input:
int(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c-c*sec(f*x+e))^2,x,method=_RETURNVERBO SE)
Output:
1/3*a^2*(-2*cot(1/2*f*x+1/2*e)^3+3*ln(tan(1/2*f*x+1/2*e)+1)-3*ln(tan(1/2*f *x+1/2*e)-1)-6*cot(1/2*f*x+1/2*e))/c^2/f
Time = 0.12 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.44 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{(c-c \sec (e+f x))^2} \, dx=-\frac {8 \, a^{2} \cos \left (f x + e\right )^{2} - 8 \, a^{2} \cos \left (f x + e\right ) - 3 \, {\left (a^{2} \cos \left (f x + e\right ) - a^{2}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) + 3 \, {\left (a^{2} \cos \left (f x + e\right ) - a^{2}\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) - 16 \, a^{2}}{6 \, {\left (c^{2} f \cos \left (f x + e\right ) - c^{2} f\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))^2,x, algorithm="f ricas")
Output:
-1/6*(8*a^2*cos(f*x + e)^2 - 8*a^2*cos(f*x + e) - 3*(a^2*cos(f*x + e) - a^ 2)*log(sin(f*x + e) + 1)*sin(f*x + e) + 3*(a^2*cos(f*x + e) - a^2)*log(-si n(f*x + e) + 1)*sin(f*x + e) - 16*a^2)/((c^2*f*cos(f*x + e) - c^2*f)*sin(f *x + e))
\[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{(c-c \sec (e+f x))^2} \, dx=\frac {a^{2} \left (\int \frac {\sec {\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} - 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {2 \sec ^{2}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} - 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {\sec ^{3}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} - 2 \sec {\left (e + f x \right )} + 1}\, dx\right )}{c^{2}} \] Input:
integrate(sec(f*x+e)*(a+a*sec(f*x+e))**2/(c-c*sec(f*x+e))**2,x)
Output:
a**2*(Integral(sec(e + f*x)/(sec(e + f*x)**2 - 2*sec(e + f*x) + 1), x) + I ntegral(2*sec(e + f*x)**2/(sec(e + f*x)**2 - 2*sec(e + f*x) + 1), x) + Int egral(sec(e + f*x)**3/(sec(e + f*x)**2 - 2*sec(e + f*x) + 1), x))/c**2
Leaf count of result is larger than twice the leaf count of optimal. 201 vs. \(2 (89) = 178\).
Time = 0.04 (sec) , antiderivative size = 201, normalized size of antiderivative = 2.26 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{(c-c \sec (e+f x))^2} \, dx=\frac {a^{2} {\left (\frac {6 \, \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{c^{2}} - \frac {6 \, \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{c^{2}} - \frac {{\left (\frac {9 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{3}}{c^{2} \sin \left (f x + e\right )^{3}}\right )} - \frac {2 \, a^{2} {\left (\frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{3}}{c^{2} \sin \left (f x + e\right )^{3}} + \frac {a^{2} {\left (\frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{3}}{c^{2} \sin \left (f x + e\right )^{3}}}{6 \, f} \] Input:
integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c-c*sec(f*x+e))^2,x, algorithm="m axima")
Output:
1/6*(a^2*(6*log(sin(f*x + e)/(cos(f*x + e) + 1) + 1)/c^2 - 6*log(sin(f*x + e)/(cos(f*x + e) + 1) - 1)/c^2 - (9*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 1)*(cos(f*x + e) + 1)^3/(c^2*sin(f*x + e)^3)) - 2*a^2*(3*sin(f*x + e)^2/( cos(f*x + e) + 1)^2 + 1)*(cos(f*x + e) + 1)^3/(c^2*sin(f*x + e)^3) + a^2*( 3*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 - 1)*(cos(f*x + e) + 1)^3/(c^2*sin(f *x + e)^3))/f
Time = 0.16 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.94 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{(c-c \sec (e+f x))^2} \, 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^{2}} - \frac {3 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{c^{2}} - \frac {2 \, {\left (3 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a^{2}\right )}}{c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3}}}{3 \, f} \] Input:
integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c-c*sec(f*x+e))^2,x, algorithm="g iac")
Output:
1/3*(3*a^2*log(abs(tan(1/2*f*x + 1/2*e) + 1))/c^2 - 3*a^2*log(abs(tan(1/2* f*x + 1/2*e) - 1))/c^2 - 2*(3*a^2*tan(1/2*f*x + 1/2*e)^2 + a^2)/(c^2*tan(1 /2*f*x + 1/2*e)^3))/f
Time = 11.09 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.71 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{(c-c \sec (e+f x))^2} \, dx=\frac {2\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{c^2\,f}-\frac {2\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+\frac {2\,a^2}{3}}{c^2\,f\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3} \] Input:
int((a + a/cos(e + f*x))^2/(cos(e + f*x)*(c - c/cos(e + f*x))^2),x)
Output:
(2*a^2*atanh(tan(e/2 + (f*x)/2)))/(c^2*f) - (2*a^2*tan(e/2 + (f*x)/2)^2 + (2*a^2)/3)/(c^2*f*tan(e/2 + (f*x)/2)^3)
Time = 0.16 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.98 \[ \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{(c-c \sec (e+f x))^2} \, 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}-6 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-2\right )}{3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} c^{2} f} \] Input:
int(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c-c*sec(f*x+e))^2,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 - 6*tan((e + f*x)/2)**2 - 2))/(3*tan((e + f*x)/2)**3*c**2*f)