\(\int (c+d x) (a+b \sec (e+f x)) \, dx\) [26]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 16, antiderivative size = 93 \[ \int (c+d x) (a+b \sec (e+f x)) \, dx=\frac {a (c+d x)^2}{2 d}-\frac {2 i b (c+d x) \arctan \left (e^{i (e+f x)}\right )}{f}+\frac {i b d \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{f^2}-\frac {i b d \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )}{f^2} \] Output:

1/2*a*(d*x+c)^2/d-2*I*b*(d*x+c)*arctan(exp(I*(f*x+e)))/f+I*b*d*polylog(2,- 
I*exp(I*(f*x+e)))/f^2-I*b*d*polylog(2,I*exp(I*(f*x+e)))/f^2
 

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.12 \[ \int (c+d x) (a+b \sec (e+f x)) \, dx=a c x+\frac {1}{2} a d x^2+\frac {b c \coth ^{-1}(\sin (e+f x))}{f}-\frac {2 i b d x \arctan \left (e^{i e+i f x}\right )}{f}+\frac {i b d \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{f^2}-\frac {i b d \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )}{f^2} \] Input:

Integrate[(c + d*x)*(a + b*Sec[e + f*x]),x]
 

Output:

a*c*x + (a*d*x^2)/2 + (b*c*ArcCoth[Sin[e + f*x]])/f - ((2*I)*b*d*x*ArcTan[ 
E^(I*e + I*f*x)])/f + (I*b*d*PolyLog[2, (-I)*E^(I*(e + f*x))])/f^2 - (I*b* 
d*PolyLog[2, I*E^(I*(e + f*x))])/f^2
 

Rubi [A] (verified)

Time = 0.28 (sec) , antiderivative size = 93, 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.188, Rules used = {3042, 4678, 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 (c+d x) (a+b \sec (e+f x)) \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4678

\(\displaystyle \int (a (c+d x)+b (c+d x) \sec (e+f x))dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a (c+d x)^2}{2 d}-\frac {2 i b (c+d x) \arctan \left (e^{i (e+f x)}\right )}{f}+\frac {i b d \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{f^2}-\frac {i b d \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )}{f^2}\)

Input:

Int[(c + d*x)*(a + b*Sec[e + f*x]),x]
 

Output:

(a*(c + d*x)^2)/(2*d) - ((2*I)*b*(c + d*x)*ArcTan[E^(I*(e + f*x))])/f + (I 
*b*d*PolyLog[2, (-I)*E^(I*(e + f*x))])/f^2 - (I*b*d*PolyLog[2, I*E^(I*(e + 
 f*x))])/f^2
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 4678
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) 
, x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Csc[e + f*x])^n, x], 
 x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
 
Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.53

method result size
parts \(a \left (\frac {1}{2} d \,x^{2}+c x \right )+\frac {b \left (\frac {d \left (-\left (f x +e \right ) \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )+\left (f x +e \right ) \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )+i \operatorname {dilog}\left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )-i \operatorname {dilog}\left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )\right )}{f}+c \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )-\frac {e d \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}\right )}{f}\) \(142\)
derivativedivides \(\frac {a c \left (f x +e \right )-\frac {a d e \left (f x +e \right )}{f}+\frac {a d \left (f x +e \right )^{2}}{2 f}+b c \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )-\frac {b d e \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {b d \left (-\left (f x +e \right ) \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )+\left (f x +e \right ) \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )+i \operatorname {dilog}\left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )-i \operatorname {dilog}\left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )\right )}{f}}{f}\) \(166\)
default \(\frac {a c \left (f x +e \right )-\frac {a d e \left (f x +e \right )}{f}+\frac {a d \left (f x +e \right )^{2}}{2 f}+b c \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )-\frac {b d e \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {b d \left (-\left (f x +e \right ) \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )+\left (f x +e \right ) \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )+i \operatorname {dilog}\left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )-i \operatorname {dilog}\left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )\right )}{f}}{f}\) \(166\)
risch \(\frac {a d \,x^{2}}{2}+a c x -\frac {2 i b c \arctan \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{f}-\frac {b d \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right ) x}{f}-\frac {b d \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right ) e}{f^{2}}+\frac {b d \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right ) x}{f}+\frac {b d \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right ) e}{f^{2}}+\frac {i b d \operatorname {dilog}\left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )}{f^{2}}-\frac {i b d \operatorname {dilog}\left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )}{f^{2}}+\frac {2 i b d e \arctan \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{f^{2}}\) \(186\)

Input:

int((d*x+c)*(a+b*sec(f*x+e)),x,method=_RETURNVERBOSE)
 

Output:

a*(1/2*d*x^2+c*x)+b/f*(1/f*d*(-(f*x+e)*ln(1+I*exp(I*(f*x+e)))+(f*x+e)*ln(1 
-I*exp(I*(f*x+e)))+I*dilog(1+I*exp(I*(f*x+e)))-I*dilog(1-I*exp(I*(f*x+e))) 
)+c*ln(sec(f*x+e)+tan(f*x+e))-e/f*d*ln(sec(f*x+e)+tan(f*x+e)))
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 343 vs. \(2 (73) = 146\).

Time = 0.11 (sec) , antiderivative size = 343, normalized size of antiderivative = 3.69 \[ \int (c+d x) (a+b \sec (e+f x)) \, dx=\frac {a d f^{2} x^{2} + 2 \, a c f^{2} x - i \, b d {\rm Li}_2\left (i \, \cos \left (f x + e\right ) + \sin \left (f x + e\right )\right ) - i \, b d {\rm Li}_2\left (i \, \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right ) + i \, b d {\rm Li}_2\left (-i \, \cos \left (f x + e\right ) + \sin \left (f x + e\right )\right ) + i \, b d {\rm Li}_2\left (-i \, \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right ) - {\left (b d e - b c f\right )} \log \left (\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right ) + i\right ) + {\left (b d e - b c f\right )} \log \left (\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right ) + i\right ) + {\left (b d f x + b d e\right )} \log \left (i \, \cos \left (f x + e\right ) + \sin \left (f x + e\right ) + 1\right ) - {\left (b d f x + b d e\right )} \log \left (i \, \cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right ) + {\left (b d f x + b d e\right )} \log \left (-i \, \cos \left (f x + e\right ) + \sin \left (f x + e\right ) + 1\right ) - {\left (b d f x + b d e\right )} \log \left (-i \, \cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right ) - {\left (b d e - b c f\right )} \log \left (-\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right ) + i\right ) + {\left (b d e - b c f\right )} \log \left (-\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right ) + i\right )}{2 \, f^{2}} \] Input:

integrate((d*x+c)*(a+b*sec(f*x+e)),x, algorithm="fricas")
 

Output:

1/2*(a*d*f^2*x^2 + 2*a*c*f^2*x - I*b*d*dilog(I*cos(f*x + e) + sin(f*x + e) 
) - I*b*d*dilog(I*cos(f*x + e) - sin(f*x + e)) + I*b*d*dilog(-I*cos(f*x + 
e) + sin(f*x + e)) + I*b*d*dilog(-I*cos(f*x + e) - sin(f*x + e)) - (b*d*e 
- b*c*f)*log(cos(f*x + e) + I*sin(f*x + e) + I) + (b*d*e - b*c*f)*log(cos( 
f*x + e) - I*sin(f*x + e) + I) + (b*d*f*x + b*d*e)*log(I*cos(f*x + e) + si 
n(f*x + e) + 1) - (b*d*f*x + b*d*e)*log(I*cos(f*x + e) - sin(f*x + e) + 1) 
 + (b*d*f*x + b*d*e)*log(-I*cos(f*x + e) + sin(f*x + e) + 1) - (b*d*f*x + 
b*d*e)*log(-I*cos(f*x + e) - sin(f*x + e) + 1) - (b*d*e - b*c*f)*log(-cos( 
f*x + e) + I*sin(f*x + e) + I) + (b*d*e - b*c*f)*log(-cos(f*x + e) - I*sin 
(f*x + e) + I))/f^2
                                                                                    
                                                                                    
 

Sympy [F]

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

integrate((d*x+c)*(a+b*sec(f*x+e)),x)
 

Output:

Integral((a + b*sec(e + f*x))*(c + d*x), x)
 

Maxima [F]

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

integrate((d*x+c)*(a+b*sec(f*x+e)),x, algorithm="maxima")
 

Output:

1/2*(a*d*f*x^2 + 2*a*c*f*x + 4*b*d*f*integrate((x*cos(2*f*x + 2*e)*cos(f*x 
 + e) + x*sin(2*f*x + 2*e)*sin(f*x + e) + x*cos(f*x + e))/(cos(2*f*x + 2*e 
)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1), x) + b*c*log(cos(f*x + 
 e)^2 + sin(f*x + e)^2 + 2*sin(f*x + e) + 1) - b*c*log(cos(f*x + e)^2 + si 
n(f*x + e)^2 - 2*sin(f*x + e) + 1))/f
 

Giac [F]

\[ \int (c+d x) (a+b \sec (e+f x)) \, dx=\int { {\left (d x + c\right )} {\left (b \sec \left (f x + e\right ) + a\right )} \,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)
 

Mupad [F(-1)]

Timed out. \[ \int (c+d x) (a+b \sec (e+f x)) \, dx=\int \left (a+\frac {b}{\cos \left (e+f\,x\right )}\right )\,\left (c+d\,x\right ) \,d x \] Input:

int((a + b/cos(e + f*x))*(c + d*x),x)
 

Output:

int((a + b/cos(e + f*x))*(c + d*x), x)
 

Reduce [F]

\[ \int (c+d x) (a+b \sec (e+f x)) \, dx=\frac {-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}-1}d x \right ) b d f -2 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) b c +2 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) b c +2 a c f x +a d f \,x^{2}+b d f \,x^{2}}{2 f} \] Input:

int((d*x+c)*(a+b*sec(f*x+e)),x)
 

Output:

( - 4*int((tan((e + f*x)/2)**2*x)/(tan((e + f*x)/2)**2 - 1),x)*b*d*f - 2*l 
og(tan((e + f*x)/2) - 1)*b*c + 2*log(tan((e + f*x)/2) + 1)*b*c + 2*a*c*f*x 
 + a*d*f*x**2 + b*d*f*x**2)/(2*f)