\(\int \frac {c+d x}{(a+a \sec (e+f x))^2} \, dx\) [18]

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

Optimal result

Integrand size = 18, antiderivative size = 140 \[ \int \frac {c+d x}{(a+a \sec (e+f x))^2} \, dx=\frac {(c+d x)^2}{2 a^2 d}-\frac {10 d \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{3 a^2 f^2}-\frac {d \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}-\frac {5 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x) \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f} \] Output:

1/2*(d*x+c)^2/a^2/d-10/3*d*ln(cos(1/2*f*x+1/2*e))/a^2/f^2-1/6*d*sec(1/2*f* 
x+1/2*e)^2/a^2/f^2-5/3*(d*x+c)*tan(1/2*f*x+1/2*e)/a^2/f+1/6*(d*x+c)*sec(1/ 
2*f*x+1/2*e)^2*tan(1/2*f*x+1/2*e)/a^2/f
 

Mathematica [A] (verified)

Time = 1.37 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.23 \[ \int \frac {c+d x}{(a+a \sec (e+f x))^2} \, dx=\frac {2 \cos \left (\frac {1}{2} (e+f x)\right ) \sec ^2(e+f x) \left (f (c+d x) \sec \left (\frac {e}{2}\right ) \sin \left (\frac {f x}{2}\right )-10 f (c+d x) \cos ^2\left (\frac {1}{2} (e+f x)\right ) \sec \left (\frac {e}{2}\right ) \sin \left (\frac {f x}{2}\right )+\cos ^3\left (\frac {1}{2} (e+f x)\right ) \left (3 f^2 x (2 c+d x)-20 d \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )-10 d f x \tan \left (\frac {e}{2}\right )\right )+\cos \left (\frac {1}{2} (e+f x)\right ) \left (-d+f (c+d x) \tan \left (\frac {e}{2}\right )\right )\right )}{3 a^2 f^2 (1+\sec (e+f x))^2} \] Input:

Integrate[(c + d*x)/(a + a*Sec[e + f*x])^2,x]
 

Output:

(2*Cos[(e + f*x)/2]*Sec[e + f*x]^2*(f*(c + d*x)*Sec[e/2]*Sin[(f*x)/2] - 10 
*f*(c + d*x)*Cos[(e + f*x)/2]^2*Sec[e/2]*Sin[(f*x)/2] + Cos[(e + f*x)/2]^3 
*(3*f^2*x*(2*c + d*x) - 20*d*Log[Cos[(e + f*x)/2]] - 10*d*f*x*Tan[e/2]) + 
Cos[(e + f*x)/2]*(-d + f*(c + d*x)*Tan[e/2])))/(3*a^2*f^2*(1 + Sec[e + f*x 
])^2)
 

Rubi [A] (verified)

Time = 0.41 (sec) , antiderivative size = 140, 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 \sec (e+f x)+a)^2} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4679

\(\displaystyle \int \left (-\frac {2 (c+d x)}{a^2 (\cos (e+f x)+1)}+\frac {c+d x}{a^2 (\cos (e+f x)+1)^2}+\frac {c+d x}{a^2}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {5 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}+\frac {(c+d x)^2}{2 a^2 d}-\frac {d \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}-\frac {10 d \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{3 a^2 f^2}\)

Input:

Int[(c + d*x)/(a + a*Sec[e + f*x])^2,x]
 

Output:

(c + d*x)^2/(2*a^2*d) - (10*d*Log[Cos[e/2 + (f*x)/2]])/(3*a^2*f^2) - (d*Se 
c[e/2 + (f*x)/2]^2)/(6*a^2*f^2) - (5*(c + d*x)*Tan[e/2 + (f*x)/2])/(3*a^2* 
f) + ((c + d*x)*Sec[e/2 + (f*x)/2]^2*Tan[e/2 + (f*x)/2])/(6*a^2*f)
 

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 4679
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]
 
Maple [A] (verified)

Time = 0.19 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.61

method result size
parallelrisch \(\frac {10 d \ln \left (\sec \left (\frac {e}{2}+\frac {f x}{2}\right )^{2}\right )+f \left (d x +c \right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )^{3}-d \tan \left (\frac {e}{2}+\frac {f x}{2}\right )^{2}-9 \tan \left (\frac {e}{2}+\frac {f x}{2}\right ) f \left (d x +c \right )+6 x \,f^{2} \left (\frac {d x}{2}+c \right )}{6 a^{2} f^{2}}\) \(86\)
norman \(\frac {\frac {c x}{a}+\frac {d \,x^{2}}{2 a}-\frac {3 c \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a f}+\frac {c \tan \left (\frac {e}{2}+\frac {f x}{2}\right )^{3}}{6 a f}-\frac {d \tan \left (\frac {e}{2}+\frac {f x}{2}\right )^{2}}{6 a \,f^{2}}-\frac {3 d x \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a f}+\frac {d x \tan \left (\frac {e}{2}+\frac {f x}{2}\right )^{3}}{6 a f}}{a}+\frac {5 d \ln \left (1+\tan \left (\frac {e}{2}+\frac {f x}{2}\right )^{2}\right )}{3 a^{2} f^{2}}\) \(143\)
risch \(\frac {d \,x^{2}}{2 a^{2}}+\frac {c x}{a^{2}}+\frac {10 i d x}{3 a^{2} f}+\frac {10 i d e}{3 a^{2} f^{2}}-\frac {2 i \left (6 \,{\mathrm e}^{2 i \left (f x +e \right )} d f x -i d \,{\mathrm e}^{2 i \left (f x +e \right )}+6 \,{\mathrm e}^{2 i \left (f x +e \right )} c f +9 \,{\mathrm e}^{i \left (f x +e \right )} d f x -i d \,{\mathrm e}^{i \left (f x +e \right )}+9 c f \,{\mathrm e}^{i \left (f x +e \right )}+5 d f x +5 c f \right )}{3 f^{2} a^{2} \left (1+{\mathrm e}^{i \left (f x +e \right )}\right )^{3}}-\frac {10 d \ln \left (1+{\mathrm e}^{i \left (f x +e \right )}\right )}{3 a^{2} f^{2}}\) \(172\)

Input:

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

Output:

1/6*(10*d*ln(sec(1/2*e+1/2*f*x)^2)+f*(d*x+c)*tan(1/2*e+1/2*f*x)^3-d*tan(1/ 
2*e+1/2*f*x)^2-9*tan(1/2*e+1/2*f*x)*f*(d*x+c)+6*x*f^2*(1/2*d*x+c))/a^2/f^2
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.31 \[ \int \frac {c+d x}{(a+a \sec (e+f x))^2} \, dx=\frac {3 \, d f^{2} x^{2} + 6 \, c f^{2} x + 3 \, {\left (d f^{2} x^{2} + 2 \, c f^{2} x\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (3 \, d f^{2} x^{2} + 6 \, c f^{2} x - d\right )} \cos \left (f x + e\right ) - 10 \, {\left (d \cos \left (f x + e\right )^{2} + 2 \, d \cos \left (f x + e\right ) + d\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - 2 \, {\left (4 \, d f x + 4 \, c f + 5 \, {\left (d f x + c f\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right ) - 2 \, d}{6 \, {\left (a^{2} f^{2} \cos \left (f x + e\right )^{2} + 2 \, a^{2} f^{2} \cos \left (f x + e\right ) + a^{2} f^{2}\right )}} \] Input:

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

Output:

1/6*(3*d*f^2*x^2 + 6*c*f^2*x + 3*(d*f^2*x^2 + 2*c*f^2*x)*cos(f*x + e)^2 + 
2*(3*d*f^2*x^2 + 6*c*f^2*x - d)*cos(f*x + e) - 10*(d*cos(f*x + e)^2 + 2*d* 
cos(f*x + e) + d)*log(1/2*cos(f*x + e) + 1/2) - 2*(4*d*f*x + 4*c*f + 5*(d* 
f*x + c*f)*cos(f*x + e))*sin(f*x + e) - 2*d)/(a^2*f^2*cos(f*x + e)^2 + 2*a 
^2*f^2*cos(f*x + e) + a^2*f^2)
 

Sympy [F]

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

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

Output:

(Integral(c/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x) + Integral(d*x/(sec 
(e + f*x)**2 + 2*sec(e + f*x) + 1), x))/a**2
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1058 vs. \(2 (110) = 220\).

Time = 0.15 (sec) , antiderivative size = 1058, normalized size of antiderivative = 7.56 \[ \int \frac {c+d x}{(a+a \sec (e+f x))^2} \, dx=\text {Too large to display} \] Input:

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

Output:

1/6*(d*e*((9*sin(f*x + e)/(cos(f*x + e) + 1) - sin(f*x + e)^3/(cos(f*x + e 
) + 1)^3)/(a^2*f) - 12*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/(a^2*f)) - 
c*((9*sin(f*x + e)/(cos(f*x + e) + 1) - sin(f*x + e)^3/(cos(f*x + e) + 1)^ 
3)/a^2 - 12*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a^2) + (3*(f*x + e)^2* 
cos(3*f*x + 3*e)^2 + 3*(f*x + e)^2*sin(3*f*x + 3*e)^2 + 3*(9*(f*x + e)^2 - 
 4)*cos(2*f*x + 2*e)^2 + 3*(9*(f*x + e)^2 - 4)*cos(f*x + e)^2 + 3*(9*(f*x 
+ e)^2 - 4)*sin(2*f*x + 2*e)^2 + 3*(9*(f*x + e)^2 - 4)*sin(f*x + e)^2 + 3* 
(f*x + e)^2 + 2*(3*(f*x + e)^2 + (9*(f*x + e)^2 - 2)*cos(2*f*x + 2*e) + (9 
*(f*x + e)^2 - 2)*cos(f*x + e) + 12*(f*x + e)*sin(2*f*x + 2*e) + 18*(f*x + 
 e)*sin(f*x + e))*cos(3*f*x + 3*e) + 2*(9*(f*x + e)^2 + 3*(9*(f*x + e)^2 - 
 4)*cos(f*x + e) + 18*(f*x + e)*sin(f*x + e) - 2)*cos(2*f*x + 2*e) + 2*(9* 
(f*x + e)^2 - 2)*cos(f*x + e) - 10*(2*(3*cos(2*f*x + 2*e) + 3*cos(f*x + e) 
 + 1)*cos(3*f*x + 3*e) + cos(3*f*x + 3*e)^2 + 6*(3*cos(f*x + e) + 1)*cos(2 
*f*x + 2*e) + 9*cos(2*f*x + 2*e)^2 + 9*cos(f*x + e)^2 + 6*(sin(2*f*x + 2*e 
) + sin(f*x + e))*sin(3*f*x + 3*e) + sin(3*f*x + 3*e)^2 + 9*sin(2*f*x + 2* 
e)^2 + 18*sin(2*f*x + 2*e)*sin(f*x + e) + 9*sin(f*x + e)^2 + 6*cos(f*x + e 
) + 1)*log(cos(f*x + e)^2 + sin(f*x + e)^2 + 2*cos(f*x + e) + 1) - 2*(10*f 
*x + 12*(f*x + e)*cos(2*f*x + 2*e) + 18*(f*x + e)*cos(f*x + e) - (9*(f*x + 
 e)^2 - 2)*sin(2*f*x + 2*e) - (9*(f*x + e)^2 - 2)*sin(f*x + e) + 10*e)*sin 
(3*f*x + 3*e) - 6*(6*f*x + 6*(f*x + e)*cos(f*x + e) - (9*(f*x + e)^2 - ...
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 798 vs. \(2 (110) = 220\).

Time = 0.41 (sec) , antiderivative size = 798, normalized size of antiderivative = 5.70 \[ \int \frac {c+d x}{(a+a \sec (e+f x))^2} \, dx=\text {Too large to display} \] Input:

integrate((d*x+c)/(a+a*sec(f*x+e))^2,x, algorithm="giac")
 

Output:

1/6*(3*d*f^2*x^2*tan(1/2*f*x)^3*tan(1/2*e)^3 + 6*c*f^2*x*tan(1/2*f*x)^3*ta 
n(1/2*e)^3 - 9*d*f^2*x^2*tan(1/2*f*x)^2*tan(1/2*e)^2 - 18*c*f^2*x*tan(1/2* 
f*x)^2*tan(1/2*e)^2 + 9*d*f*x*tan(1/2*f*x)^3*tan(1/2*e)^2 + 9*d*f*x*tan(1/ 
2*f*x)^2*tan(1/2*e)^3 - 10*d*log(4*(tan(1/2*f*x)^2*tan(1/2*e)^2 - 2*tan(1/ 
2*f*x)*tan(1/2*e) + 1)/(tan(1/2*f*x)^2*tan(1/2*e)^2 + tan(1/2*f*x)^2 + tan 
(1/2*e)^2 + 1))*tan(1/2*f*x)^3*tan(1/2*e)^3 + 9*d*f^2*x^2*tan(1/2*f*x)*tan 
(1/2*e) + 9*c*f*tan(1/2*f*x)^3*tan(1/2*e)^2 + 9*c*f*tan(1/2*f*x)^2*tan(1/2 
*e)^3 - d*tan(1/2*f*x)^3*tan(1/2*e)^3 - d*f*x*tan(1/2*f*x)^3 + 18*c*f^2*x* 
tan(1/2*f*x)*tan(1/2*e) - 21*d*f*x*tan(1/2*f*x)^2*tan(1/2*e) - 21*d*f*x*ta 
n(1/2*f*x)*tan(1/2*e)^2 + 30*d*log(4*(tan(1/2*f*x)^2*tan(1/2*e)^2 - 2*tan( 
1/2*f*x)*tan(1/2*e) + 1)/(tan(1/2*f*x)^2*tan(1/2*e)^2 + tan(1/2*f*x)^2 + t 
an(1/2*e)^2 + 1))*tan(1/2*f*x)^2*tan(1/2*e)^2 - d*f*x*tan(1/2*e)^3 - 3*d*f 
^2*x^2 - c*f*tan(1/2*f*x)^3 - 21*c*f*tan(1/2*f*x)^2*tan(1/2*e) - d*tan(1/2 
*f*x)^3*tan(1/2*e) - 21*c*f*tan(1/2*f*x)*tan(1/2*e)^2 + d*tan(1/2*f*x)^2*t 
an(1/2*e)^2 - c*f*tan(1/2*e)^3 - d*tan(1/2*f*x)*tan(1/2*e)^3 - 6*c*f^2*x + 
 9*d*f*x*tan(1/2*f*x) + 9*d*f*x*tan(1/2*e) - 30*d*log(4*(tan(1/2*f*x)^2*ta 
n(1/2*e)^2 - 2*tan(1/2*f*x)*tan(1/2*e) + 1)/(tan(1/2*f*x)^2*tan(1/2*e)^2 + 
 tan(1/2*f*x)^2 + tan(1/2*e)^2 + 1))*tan(1/2*f*x)*tan(1/2*e) + 9*c*f*tan(1 
/2*f*x) + d*tan(1/2*f*x)^2 + 9*c*f*tan(1/2*e) - d*tan(1/2*f*x)*tan(1/2*e) 
+ d*tan(1/2*e)^2 + 10*d*log(4*(tan(1/2*f*x)^2*tan(1/2*e)^2 - 2*tan(1/2*...
 

Mupad [B] (verification not implemented)

Time = 20.47 (sec) , antiderivative size = 247, normalized size of antiderivative = 1.76 \[ \int \frac {c+d x}{(a+a \sec (e+f x))^2} \, dx=\frac {d\,x^2}{2\,a^2}-\frac {\frac {\left (c+d\,x\right )\,4{}\mathrm {i}}{3\,a^2\,f}+\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}\,\left (c+d\,x\right )\,4{}\mathrm {i}}{3\,a^2\,f}+\frac {{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,\left (c+d\,x\right )\,4{}\mathrm {i}}{3\,a^2\,f}}{3\,{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}+3\,{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+{\mathrm {e}}^{e\,3{}\mathrm {i}+f\,x\,3{}\mathrm {i}}+1}-\frac {10\,d\,\ln \left ({\mathrm {e}}^{e\,1{}\mathrm {i}}\,{\mathrm {e}}^{f\,x\,1{}\mathrm {i}}+1\right )}{3\,a^2\,f^2}-\frac {\left (4\,c\,f+4\,d\,f\,x-d\,1{}\mathrm {i}\right )\,2{}\mathrm {i}}{3\,a^2\,f^2\,\left ({\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}+1\right )}+\frac {\left (c\,f+d\,f\,x-d\,1{}\mathrm {i}\right )\,2{}\mathrm {i}}{3\,a^2\,f^2\,\left (2\,{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}+{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+1\right )}+\frac {x\,\left (3\,c\,f+d\,10{}\mathrm {i}\right )}{3\,a^2\,f} \] Input:

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

Output:

(d*x^2)/(2*a^2) - (((c + d*x)*4i)/(3*a^2*f) + (exp(e*1i + f*x*1i)*(c + d*x 
)*4i)/(3*a^2*f) + (exp(e*2i + f*x*2i)*(c + d*x)*4i)/(3*a^2*f))/(3*exp(e*1i 
 + f*x*1i) + 3*exp(e*2i + f*x*2i) + exp(e*3i + f*x*3i) + 1) - (10*d*log(ex 
p(e*1i)*exp(f*x*1i) + 1))/(3*a^2*f^2) - ((4*c*f - d*1i + 4*d*f*x)*2i)/(3*a 
^2*f^2*(exp(e*1i + f*x*1i) + 1)) + ((c*f - d*1i + d*f*x)*2i)/(3*a^2*f^2*(2 
*exp(e*1i + f*x*1i) + exp(e*2i + f*x*2i) + 1)) + (x*(d*10i + 3*c*f))/(3*a^ 
2*f)
 

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.80 \[ \int \frac {c+d x}{(a+a \sec (e+f x))^2} \, dx=\frac {10 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+1\right ) d +\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} c f +\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} d f x -\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -9 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c f -9 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d f x +6 c \,f^{2} x +3 d \,f^{2} x^{2}}{6 a^{2} f^{2}} \] Input:

int((d*x+c)/(a+a*sec(f*x+e))^2,x)
 

Output:

(10*log(tan((e + f*x)/2)**2 + 1)*d + tan((e + f*x)/2)**3*c*f + tan((e + f* 
x)/2)**3*d*f*x - tan((e + f*x)/2)**2*d - 9*tan((e + f*x)/2)*c*f - 9*tan((e 
 + f*x)/2)*d*f*x + 6*c*f**2*x + 3*d*f**2*x**2)/(6*a**2*f**2)