Integrand size = 18, antiderivative size = 257 \[ \int \frac {c+d x}{a+b \sec (e+f x)} \, dx=\frac {(c+d x)^2}{2 a d}+\frac {i b (c+d x) \log \left (1+\frac {a e^{i (e+f x)}}{b-\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} f}-\frac {i b (c+d x) \log \left (1+\frac {a e^{i (e+f x)}}{b+\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} f}+\frac {b d \operatorname {PolyLog}\left (2,-\frac {a e^{i (e+f x)}}{b-\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} f^2}-\frac {b d \operatorname {PolyLog}\left (2,-\frac {a e^{i (e+f x)}}{b+\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} f^2} \] Output:
1/2*(d*x+c)^2/a/d+I*b*(d*x+c)*ln(1+a*exp(I*(f*x+e))/(b-(-a^2+b^2)^(1/2)))/ a/(-a^2+b^2)^(1/2)/f-I*b*(d*x+c)*ln(1+a*exp(I*(f*x+e))/(b+(-a^2+b^2)^(1/2) ))/a/(-a^2+b^2)^(1/2)/f+b*d*polylog(2,-a*exp(I*(f*x+e))/(b-(-a^2+b^2)^(1/2 )))/a/(-a^2+b^2)^(1/2)/f^2-b*d*polylog(2,-a*exp(I*(f*x+e))/(b+(-a^2+b^2)^( 1/2)))/a/(-a^2+b^2)^(1/2)/f^2
Time = 0.50 (sec) , antiderivative size = 214, normalized size of antiderivative = 0.83 \[ \int \frac {c+d x}{a+b \sec (e+f x)} \, dx=\frac {f \left (\sqrt {-a^2+b^2} f x (2 c+d x)+2 i b (c+d x) \log \left (1-\frac {a e^{i (e+f x)}}{-b+\sqrt {-a^2+b^2}}\right )-2 i b (c+d x) \log \left (1+\frac {a e^{i (e+f x)}}{b+\sqrt {-a^2+b^2}}\right )\right )+2 b d \operatorname {PolyLog}\left (2,\frac {a e^{i (e+f x)}}{-b+\sqrt {-a^2+b^2}}\right )-2 b d \operatorname {PolyLog}\left (2,-\frac {a e^{i (e+f x)}}{b+\sqrt {-a^2+b^2}}\right )}{2 a \sqrt {-a^2+b^2} f^2} \] Input:
Integrate[(c + d*x)/(a + b*Sec[e + f*x]),x]
Output:
(f*(Sqrt[-a^2 + b^2]*f*x*(2*c + d*x) + (2*I)*b*(c + d*x)*Log[1 - (a*E^(I*( e + f*x)))/(-b + Sqrt[-a^2 + b^2])] - (2*I)*b*(c + d*x)*Log[1 + (a*E^(I*(e + f*x)))/(b + Sqrt[-a^2 + b^2])]) + 2*b*d*PolyLog[2, (a*E^(I*(e + f*x)))/ (-b + Sqrt[-a^2 + b^2])] - 2*b*d*PolyLog[2, -((a*E^(I*(e + f*x)))/(b + Sqr t[-a^2 + b^2]))])/(2*a*Sqrt[-a^2 + b^2]*f^2)
Time = 0.75 (sec) , antiderivative size = 257, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3042, 4679, 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 \frac {c+d x}{a+b \sec (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {c+d x}{a+b \csc \left (e+f x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4679 |
\(\displaystyle \int \left (\frac {c+d x}{a}-\frac {b (c+d x)}{a (a \cos (e+f x)+b)}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {i b (c+d x) \log \left (1+\frac {a e^{i (e+f x)}}{b-\sqrt {b^2-a^2}}\right )}{a f \sqrt {b^2-a^2}}-\frac {i b (c+d x) \log \left (1+\frac {a e^{i (e+f x)}}{\sqrt {b^2-a^2}+b}\right )}{a f \sqrt {b^2-a^2}}+\frac {b d \operatorname {PolyLog}\left (2,-\frac {a e^{i (e+f x)}}{b-\sqrt {b^2-a^2}}\right )}{a f^2 \sqrt {b^2-a^2}}-\frac {b d \operatorname {PolyLog}\left (2,-\frac {a e^{i (e+f x)}}{b+\sqrt {b^2-a^2}}\right )}{a f^2 \sqrt {b^2-a^2}}+\frac {(c+d x)^2}{2 a d}\) |
Input:
Int[(c + d*x)/(a + b*Sec[e + f*x]),x]
Output:
(c + d*x)^2/(2*a*d) + (I*b*(c + d*x)*Log[1 + (a*E^(I*(e + f*x)))/(b - Sqrt [-a^2 + b^2])])/(a*Sqrt[-a^2 + b^2]*f) - (I*b*(c + d*x)*Log[1 + (a*E^(I*(e + f*x)))/(b + Sqrt[-a^2 + b^2])])/(a*Sqrt[-a^2 + b^2]*f) + (b*d*PolyLog[2 , -((a*E^(I*(e + f*x)))/(b - Sqrt[-a^2 + b^2]))])/(a*Sqrt[-a^2 + b^2]*f^2) - (b*d*PolyLog[2, -((a*E^(I*(e + f*x)))/(b + Sqrt[-a^2 + b^2]))])/(a*Sqrt [-a^2 + b^2]*f^2)
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) , x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, 1/(Sin[e + f*x]^n/(b + a*Si n[e + f*x])^n), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && ILtQ[n, 0] && IGt Q[m, 0]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 515 vs. \(2 (229 ) = 458\).
Time = 0.15 (sec) , antiderivative size = 516, normalized size of antiderivative = 2.01
method | result | size |
risch | \(\frac {d \,x^{2}}{2 a}+\frac {c x}{a}+\frac {2 i b c \arctan \left (\frac {2 \,{\mathrm e}^{i \left (f x +e \right )} a +2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{f a \sqrt {a^{2}-b^{2}}}+\frac {i b d \ln \left (\frac {-{\mathrm e}^{i \left (f x +e \right )} a +\sqrt {-a^{2}+b^{2}}-b}{-b +\sqrt {-a^{2}+b^{2}}}\right ) x}{f a \sqrt {-a^{2}+b^{2}}}-\frac {i b d \ln \left (\frac {{\mathrm e}^{i \left (f x +e \right )} a +\sqrt {-a^{2}+b^{2}}+b}{b +\sqrt {-a^{2}+b^{2}}}\right ) x}{f a \sqrt {-a^{2}+b^{2}}}+\frac {i b d \ln \left (\frac {-{\mathrm e}^{i \left (f x +e \right )} a +\sqrt {-a^{2}+b^{2}}-b}{-b +\sqrt {-a^{2}+b^{2}}}\right ) e}{f^{2} a \sqrt {-a^{2}+b^{2}}}-\frac {i b d \ln \left (\frac {{\mathrm e}^{i \left (f x +e \right )} a +\sqrt {-a^{2}+b^{2}}+b}{b +\sqrt {-a^{2}+b^{2}}}\right ) e}{f^{2} a \sqrt {-a^{2}+b^{2}}}+\frac {b d \operatorname {dilog}\left (\frac {-{\mathrm e}^{i \left (f x +e \right )} a +\sqrt {-a^{2}+b^{2}}-b}{-b +\sqrt {-a^{2}+b^{2}}}\right )}{f^{2} a \sqrt {-a^{2}+b^{2}}}-\frac {b d \operatorname {dilog}\left (\frac {{\mathrm e}^{i \left (f x +e \right )} a +\sqrt {-a^{2}+b^{2}}+b}{b +\sqrt {-a^{2}+b^{2}}}\right )}{f^{2} a \sqrt {-a^{2}+b^{2}}}-\frac {2 i b d e \arctan \left (\frac {2 \,{\mathrm e}^{i \left (f x +e \right )} a +2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{f^{2} a \sqrt {a^{2}-b^{2}}}\) | \(516\) |
Input:
int((d*x+c)/(a+b*sec(f*x+e)),x,method=_RETURNVERBOSE)
Output:
1/2*d/a*x^2+c/a*x+2*I/f/a*b*c/(a^2-b^2)^(1/2)*arctan(1/2*(2*exp(I*(f*x+e)) *a+2*b)/(a^2-b^2)^(1/2))+I/f/a*b*d/(-a^2+b^2)^(1/2)*ln((-exp(I*(f*x+e))*a+ (-a^2+b^2)^(1/2)-b)/(-b+(-a^2+b^2)^(1/2)))*x-I/f/a*b*d/(-a^2+b^2)^(1/2)*ln ((exp(I*(f*x+e))*a+(-a^2+b^2)^(1/2)+b)/(b+(-a^2+b^2)^(1/2)))*x+I/f^2/a*b*d /(-a^2+b^2)^(1/2)*ln((-exp(I*(f*x+e))*a+(-a^2+b^2)^(1/2)-b)/(-b+(-a^2+b^2) ^(1/2)))*e-I/f^2/a*b*d/(-a^2+b^2)^(1/2)*ln((exp(I*(f*x+e))*a+(-a^2+b^2)^(1 /2)+b)/(b+(-a^2+b^2)^(1/2)))*e+1/f^2/a*b*d/(-a^2+b^2)^(1/2)*dilog((-exp(I* (f*x+e))*a+(-a^2+b^2)^(1/2)-b)/(-b+(-a^2+b^2)^(1/2)))-1/f^2/a*b*d/(-a^2+b^ 2)^(1/2)*dilog((exp(I*(f*x+e))*a+(-a^2+b^2)^(1/2)+b)/(b+(-a^2+b^2)^(1/2))) -2*I/f^2/a*b*d*e/(a^2-b^2)^(1/2)*arctan(1/2*(2*exp(I*(f*x+e))*a+2*b)/(a^2- b^2)^(1/2))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1041 vs. \(2 (225) = 450\).
Time = 0.23 (sec) , antiderivative size = 1041, normalized size of antiderivative = 4.05 \[ \int \frac {c+d x}{a+b \sec (e+f x)} \, dx=\text {Too large to display} \] Input:
integrate((d*x+c)/(a+b*sec(f*x+e)),x, algorithm="fricas")
Output:
1/2*((a^2 - b^2)*d*f^2*x^2 + 2*(a^2 - b^2)*c*f^2*x - a*b*d*sqrt(-(a^2 - b^ 2)/a^2)*dilog(-(b*cos(f*x + e) + I*b*sin(f*x + e) + (a*cos(f*x + e) + I*a* sin(f*x + e))*sqrt(-(a^2 - b^2)/a^2) + a)/a + 1) + a*b*d*sqrt(-(a^2 - b^2) /a^2)*dilog(-(b*cos(f*x + e) + I*b*sin(f*x + e) - (a*cos(f*x + e) + I*a*si n(f*x + e))*sqrt(-(a^2 - b^2)/a^2) + a)/a + 1) - a*b*d*sqrt(-(a^2 - b^2)/a ^2)*dilog(-(b*cos(f*x + e) - I*b*sin(f*x + e) + (a*cos(f*x + e) - I*a*sin( f*x + e))*sqrt(-(a^2 - b^2)/a^2) + a)/a + 1) + a*b*d*sqrt(-(a^2 - b^2)/a^2 )*dilog(-(b*cos(f*x + e) - I*b*sin(f*x + e) - (a*cos(f*x + e) - I*a*sin(f* x + e))*sqrt(-(a^2 - b^2)/a^2) + a)/a + 1) - (I*a*b*d*e - I*a*b*c*f)*sqrt( -(a^2 - b^2)/a^2)*log(2*a*cos(f*x + e) + 2*I*a*sin(f*x + e) + 2*a*sqrt(-(a ^2 - b^2)/a^2) + 2*b) - (-I*a*b*d*e + I*a*b*c*f)*sqrt(-(a^2 - b^2)/a^2)*lo g(2*a*cos(f*x + e) - 2*I*a*sin(f*x + e) + 2*a*sqrt(-(a^2 - b^2)/a^2) + 2*b ) - (I*a*b*d*e - I*a*b*c*f)*sqrt(-(a^2 - b^2)/a^2)*log(-2*a*cos(f*x + e) + 2*I*a*sin(f*x + e) + 2*a*sqrt(-(a^2 - b^2)/a^2) - 2*b) - (-I*a*b*d*e + I* a*b*c*f)*sqrt(-(a^2 - b^2)/a^2)*log(-2*a*cos(f*x + e) - 2*I*a*sin(f*x + e) + 2*a*sqrt(-(a^2 - b^2)/a^2) - 2*b) - (I*a*b*d*f*x + I*a*b*d*e)*sqrt(-(a^ 2 - b^2)/a^2)*log((b*cos(f*x + e) + I*b*sin(f*x + e) + (a*cos(f*x + e) + I *a*sin(f*x + e))*sqrt(-(a^2 - b^2)/a^2) + a)/a) - (-I*a*b*d*f*x - I*a*b*d* e)*sqrt(-(a^2 - b^2)/a^2)*log((b*cos(f*x + e) + I*b*sin(f*x + e) - (a*cos( f*x + e) + I*a*sin(f*x + e))*sqrt(-(a^2 - b^2)/a^2) + a)/a) - (-I*a*b*d...
\[ \int \frac {c+d x}{a+b \sec (e+f x)} \, dx=\int \frac {c + d x}{a + b \sec {\left (e + f x \right )}}\, dx \] Input:
integrate((d*x+c)/(a+b*sec(f*x+e)),x)
Output:
Integral((c + d*x)/(a + b*sec(e + f*x)), x)
Exception generated. \[ \int \frac {c+d x}{a+b \sec (e+f x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate((d*x+c)/(a+b*sec(f*x+e)),x, algorithm="maxima")
Output:
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?` f or more de
\[ \int \frac {c+d x}{a+b \sec (e+f x)} \, dx=\int { \frac {d x + c}{b \sec \left (f x + e\right ) + a} \,d x } \] Input:
integrate((d*x+c)/(a+b*sec(f*x+e)),x, algorithm="giac")
Output:
integrate((d*x + c)/(b*sec(f*x + e) + a), x)
Timed out. \[ \int \frac {c+d x}{a+b \sec (e+f x)} \, dx=\int \frac {c+d\,x}{a+\frac {b}{\cos \left (e+f\,x\right )}} \,d x \] Input:
int((c + d*x)/(a + b/cos(e + f*x)),x)
Output:
int((c + d*x)/(a + b/cos(e + f*x)), x)
\[ \int \frac {c+d x}{a+b \sec (e+f x)} \, dx=\frac {-4 \sqrt {-a^{2}+b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) a -\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) b}{\sqrt {-a^{2}+b^{2}}}\right ) b c +4 \left (\int \frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} x}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} a^{2}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} b^{2}-a^{2}-2 a b -b^{2}}d x \right ) a^{3} b d f -4 \left (\int \frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} x}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} a^{2}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} b^{2}-a^{2}-2 a b -b^{2}}d x \right ) a \,b^{3} d f +2 a^{2} c f x +a^{2} d f \,x^{2}-a b d f \,x^{2}-2 b^{2} c f x}{2 a f \left (a^{2}-b^{2}\right )} \] Input:
int((d*x+c)/(a+b*sec(f*x+e)),x)
Output:
( - 4*sqrt( - a**2 + b**2)*atan((tan((e + f*x)/2)*a - tan((e + f*x)/2)*b)/ sqrt( - a**2 + b**2))*b*c + 4*int((tan((e + f*x)/2)**2*x)/(tan((e + f*x)/2 )**2*a**2 - tan((e + f*x)/2)**2*b**2 - a**2 - 2*a*b - b**2),x)*a**3*b*d*f - 4*int((tan((e + f*x)/2)**2*x)/(tan((e + f*x)/2)**2*a**2 - tan((e + f*x)/ 2)**2*b**2 - a**2 - 2*a*b - b**2),x)*a*b**3*d*f + 2*a**2*c*f*x + a**2*d*f* x**2 - a*b*d*f*x**2 - 2*b**2*c*f*x)/(2*a*f*(a**2 - b**2))