\(\int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx\) [136]

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

Optimal result

Integrand size = 26, antiderivative size = 86 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=-\frac {\frac {1}{b}+\frac {b}{a^2}}{2 d (b+a \cot (c+d x))^2}+\frac {\frac {1}{a^2}-\frac {1}{b^2}}{d (b+a \cot (c+d x))}+\frac {\log (b+a \cot (c+d x))}{b^3 d}+\frac {\log (\tan (c+d x))}{b^3 d} \] Output:

-1/2*(1/b+b/a^2)/d/(b+a*cot(d*x+c))^2+(1/a^2-1/b^2)/d/(b+a*cot(d*x+c))+ln( 
b+a*cot(d*x+c))/b^3/d+ln(tan(d*x+c))/b^3/d
 

Mathematica [A] (verified)

Time = 0.43 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.66 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\frac {\log (a+b \tan (c+d x))-\frac {a^2+b^2}{2 (a+b \tan (c+d x))^2}+\frac {2 a}{a+b \tan (c+d x)}}{b^3 d} \] Input:

Integrate[Sec[c + d*x]/(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]
 

Output:

(Log[a + b*Tan[c + d*x]] - (a^2 + b^2)/(2*(a + b*Tan[c + d*x])^2) + (2*a)/ 
(a + b*Tan[c + d*x]))/(b^3*d)
 

Rubi [A] (verified)

Time = 0.30 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.94, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3042, 3567, 522, 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 {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\cos (c+d x) (a \cos (c+d x)+b \sin (c+d x))^3}dx\)

\(\Big \downarrow \) 3567

\(\displaystyle -\frac {\int \frac {\left (\cot ^2(c+d x)+1\right ) \tan (c+d x)}{(b+a \cot (c+d x))^3}d\cot (c+d x)}{d}\)

\(\Big \downarrow \) 522

\(\displaystyle -\frac {\int \left (-\frac {a}{b^3 (b+a \cot (c+d x))}+\frac {\tan (c+d x)}{b^3}+\frac {b^2-a^2}{b^2 (b+a \cot (c+d x))^2 a}+\frac {-a^2-b^2}{b (b+a \cot (c+d x))^3 a}\right )d\cot (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {-\frac {\frac {1}{a^2}-\frac {1}{b^2}}{a \cot (c+d x)+b}+\frac {\frac {b}{a^2}+\frac {1}{b}}{2 (a \cot (c+d x)+b)^2}-\frac {\log (a \cot (c+d x)+b)}{b^3}+\frac {\log (\cot (c+d x))}{b^3}}{d}\)

Input:

Int[Sec[c + d*x]/(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]
 

Output:

-(((b^(-1) + b/a^2)/(2*(b + a*Cot[c + d*x])^2) - (a^(-2) - b^(-2))/(b + a* 
Cot[c + d*x]) + Log[Cot[c + d*x]]/b^3 - Log[b + a*Cot[c + d*x]]/b^3)/d)
 

Defintions of rubi rules used

rule 522
Int[((e_.)*(x_))^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_. 
), x_Symbol] :> Int[ExpandIntegrand[(e*x)^m*(c + d*x)^n*(a + b*x^2)^p, x], 
x] /; FreeQ[{a, b, c, d, e, m, n}, x] && IGtQ[p, 0]
 

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 3567
Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*si 
n[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[x^m*((b 
+ a*x)^n/(1 + x^2)^((m + n + 2)/2)), x], x, Cot[c + d*x]], x] /; FreeQ[{a, 
b, c, d}, x] && IntegerQ[n] && IntegerQ[(m + n)/2] && NeQ[n, -1] &&  !(GtQ[ 
n, 0] && GtQ[m, 1])
 
Maple [A] (verified)

Time = 0.81 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.73

method result size
derivativedivides \(\frac {\frac {\ln \left (a +b \tan \left (d x +c \right )\right )}{b^{3}}+\frac {2 a}{b^{3} \left (a +b \tan \left (d x +c \right )\right )}-\frac {a^{2}+b^{2}}{2 b^{3} \left (a +b \tan \left (d x +c \right )\right )^{2}}}{d}\) \(63\)
default \(\frac {\frac {\ln \left (a +b \tan \left (d x +c \right )\right )}{b^{3}}+\frac {2 a}{b^{3} \left (a +b \tan \left (d x +c \right )\right )}-\frac {a^{2}+b^{2}}{2 b^{3} \left (a +b \tan \left (d x +c \right )\right )^{2}}}{d}\) \(63\)
risch \(\frac {-2 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+4 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 a^{2}-2 i a b}{b^{2} \left (i a +b \right ) \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right )^{2} d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{b^{3} d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b^{3} d}\) \(160\)
norman \(\frac {-\frac {2 \left (a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{b^{2} d a}+\frac {2 \left (a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{b^{2} d a}-\frac {2 \left (3 a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a^{2} b d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )^{2}}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}{b^{3} d}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{3} d}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{3} d}\) \(205\)
parallelrisch \(\frac {\left (\left (2 a^{2}-2 b^{2}\right ) \cos \left (2 d x +2 c \right )+4 a b \sin \left (2 d x +2 c \right )+2 a^{2}+2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )+\left (\left (-2 a^{2}+2 b^{2}\right ) \cos \left (2 d x +2 c \right )-4 a b \sin \left (2 d x +2 c \right )-2 a^{2}-2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\left (\left (-2 a^{2}+2 b^{2}\right ) \cos \left (2 d x +2 c \right )-4 a b \sin \left (2 d x +2 c \right )-2 a^{2}-2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (a^{2}+b^{2}\right ) \cos \left (2 d x +2 c \right )+a^{2}-3 b^{2}}{2 \left (\left (a^{2}-b^{2}\right ) \cos \left (2 d x +2 c \right )+2 a b \sin \left (2 d x +2 c \right )+a^{2}+b^{2}\right ) d \,b^{3}}\) \(268\)

Input:

int(sec(d*x+c)/(a*cos(d*x+c)+b*sin(d*x+c))^3,x,method=_RETURNVERBOSE)
 

Output:

1/d*(1/b^3*ln(a+b*tan(d*x+c))+2*a/b^3/(a+b*tan(d*x+c))-1/2*(a^2+b^2)/b^3/( 
a+b*tan(d*x+c))^2)
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 284 vs. \(2 (84) = 168\).

Time = 0.09 (sec) , antiderivative size = 284, normalized size of antiderivative = 3.30 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\frac {4 \, a^{2} b^{2} \cos \left (d x + c\right )^{2} - 3 \, a^{2} b^{2} - b^{4} - 2 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} b^{2} + b^{4} + {\left (a^{4} - b^{4}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{3} b + a b^{3}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )\right )} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) - {\left (a^{2} b^{2} + b^{4} + {\left (a^{4} - b^{4}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{3} b + a b^{3}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2}\right )}{2 \, {\left ({\left (a^{4} b^{3} - b^{7}\right )} d \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{3} b^{4} + a b^{6}\right )} d \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} b^{5} + b^{7}\right )} d\right )}} \] Input:

integrate(sec(d*x+c)/(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="fricas")
 

Output:

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

Sympy [F]

\[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\int \frac {\sec {\left (c + d x \right )}}{\left (a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}\right )^{3}}\, dx \] Input:

integrate(sec(d*x+c)/(a*cos(d*x+c)+b*sin(d*x+c))**3,x)
 

Output:

Integral(sec(c + d*x)/(a*cos(c + d*x) + b*sin(c + d*x))**3, x)
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 315 vs. \(2 (84) = 168\).

Time = 0.04 (sec) , antiderivative size = 315, normalized size of antiderivative = 3.66 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=-\frac {\frac {2 \, {\left (\frac {{\left (a^{3} - a b^{2}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {{\left (3 \, a^{2} b - b^{3}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {{\left (a^{3} - a b^{2}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{4} b^{2} + \frac {4 \, a^{3} b^{3} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {4 \, a^{3} b^{3} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {a^{4} b^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {2 \, {\left (a^{4} b^{2} - 2 \, a^{2} b^{4}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} - \frac {\log \left (-a - \frac {2 \, b \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}{b^{3}} + \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{b^{3}} + \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{b^{3}}}{d} \] Input:

integrate(sec(d*x+c)/(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="maxima")
 

Output:

-(2*((a^3 - a*b^2)*sin(d*x + c)/(cos(d*x + c) + 1) + (3*a^2*b - b^3)*sin(d 
*x + c)^2/(cos(d*x + c) + 1)^2 - (a^3 - a*b^2)*sin(d*x + c)^3/(cos(d*x + c 
) + 1)^3)/(a^4*b^2 + 4*a^3*b^3*sin(d*x + c)/(cos(d*x + c) + 1) - 4*a^3*b^3 
*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + a^4*b^2*sin(d*x + c)^4/(cos(d*x + c 
) + 1)^4 - 2*(a^4*b^2 - 2*a^2*b^4)*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) - 
log(-a - 2*b*sin(d*x + c)/(cos(d*x + c) + 1) + a*sin(d*x + c)^2/(cos(d*x + 
 c) + 1)^2)/b^3 + log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/b^3 + log(sin(d 
*x + c)/(cos(d*x + c) + 1) - 1)/b^3)/d
 

Giac [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.72 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\frac {\frac {2 \, \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{b^{3}} - \frac {3 \, b \tan \left (d x + c\right )^{2} + 2 \, a \tan \left (d x + c\right ) + b}{{\left (b \tan \left (d x + c\right ) + a\right )}^{2} b^{2}}}{2 \, d} \] Input:

integrate(sec(d*x+c)/(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="giac")
 

Output:

1/2*(2*log(abs(b*tan(d*x + c) + a))/b^3 - (3*b*tan(d*x + c)^2 + 2*a*tan(d* 
x + c) + b)/((b*tan(d*x + c) + a)^2*b^2))/d
 

Mupad [B] (verification not implemented)

Time = 18.37 (sec) , antiderivative size = 396, normalized size of antiderivative = 4.60 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\frac {2\,\mathrm {atanh}\left (\frac {16\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{16\,a+\frac {32\,a^3}{b^2}-16\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-\frac {32\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b^2}+\frac {32\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}}-\frac {16\,a}{16\,a+\frac {32\,a^3}{b^2}-16\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-\frac {32\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b^2}+\frac {32\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}}+\frac {32\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16\,a\,b+\frac {32\,a^3}{b}+32\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {32\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b}-16\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )}{b^3\,d}-\frac {\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (3\,a^2-b^2\right )}{a^2\,b}-\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (a^2-b^2\right )}{a\,b^2}+\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )}{a\,b^2}}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2-4\,b^2\right )+a^2-4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )} \] Input:

int(1/(cos(c + d*x)*(a*cos(c + d*x) + b*sin(c + d*x))^3),x)
 

Output:

(2*atanh((16*a*tan(c/2 + (d*x)/2)^2)/(16*a + (32*a^3)/b^2 - 16*a*tan(c/2 + 
 (d*x)/2)^2 - (32*a^3*tan(c/2 + (d*x)/2)^2)/b^2 + (32*a^2*tan(c/2 + (d*x)/ 
2))/b) - (16*a)/(16*a + (32*a^3)/b^2 - 16*a*tan(c/2 + (d*x)/2)^2 - (32*a^3 
*tan(c/2 + (d*x)/2)^2)/b^2 + (32*a^2*tan(c/2 + (d*x)/2))/b) + (32*a^2*tan( 
c/2 + (d*x)/2))/(16*a*b + (32*a^3)/b + 32*a^2*tan(c/2 + (d*x)/2) - (32*a^3 
*tan(c/2 + (d*x)/2)^2)/b - 16*a*b*tan(c/2 + (d*x)/2)^2)))/(b^3*d) - ((2*ta 
n(c/2 + (d*x)/2)^2*(3*a^2 - b^2))/(a^2*b) - (2*tan(c/2 + (d*x)/2)^3*(a^2 - 
 b^2))/(a*b^2) + (2*tan(c/2 + (d*x)/2)*(a^2 - b^2))/(a*b^2))/(d*(a^2*tan(c 
/2 + (d*x)/2)^4 - tan(c/2 + (d*x)/2)^2*(2*a^2 - 4*b^2) + a^2 - 4*a*b*tan(c 
/2 + (d*x)/2)^3 + 4*a*b*tan(c/2 + (d*x)/2)))
 

Reduce [B] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 447, normalized size of antiderivative = 5.20 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\frac {-4 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right ) a b -4 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right ) a b +4 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b -a \right ) \sin \left (d x +c \right ) a b +2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} a^{2}-2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} b^{2}-2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a^{2}+2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} a^{2}-2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} b^{2}-2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a^{2}-2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b -a \right ) \sin \left (d x +c \right )^{2} a^{2}+2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b -a \right ) \sin \left (d x +c \right )^{2} b^{2}+2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b -a \right ) a^{2}-\sin \left (d x +c \right )^{2} a^{2}-\sin \left (d x +c \right )^{2} b^{2}+a^{2}-b^{2}}{2 b^{3} d \left (2 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a b -\sin \left (d x +c \right )^{2} a^{2}+\sin \left (d x +c \right )^{2} b^{2}+a^{2}\right )} \] Input:

int(sec(d*x+c)/(a*cos(d*x+c)+b*sin(d*x+c))^3,x)
 

Output:

( - 4*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)*a*b - 4*cos(c + 
d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)*a*b + 4*cos(c + d*x)*log(tan(( 
c + d*x)/2)**2*a - 2*tan((c + d*x)/2)*b - a)*sin(c + d*x)*a*b + 2*log(tan( 
(c + d*x)/2) - 1)*sin(c + d*x)**2*a**2 - 2*log(tan((c + d*x)/2) - 1)*sin(c 
 + d*x)**2*b**2 - 2*log(tan((c + d*x)/2) - 1)*a**2 + 2*log(tan((c + d*x)/2 
) + 1)*sin(c + d*x)**2*a**2 - 2*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2* 
b**2 - 2*log(tan((c + d*x)/2) + 1)*a**2 - 2*log(tan((c + d*x)/2)**2*a - 2* 
tan((c + d*x)/2)*b - a)*sin(c + d*x)**2*a**2 + 2*log(tan((c + d*x)/2)**2*a 
 - 2*tan((c + d*x)/2)*b - a)*sin(c + d*x)**2*b**2 + 2*log(tan((c + d*x)/2) 
**2*a - 2*tan((c + d*x)/2)*b - a)*a**2 - sin(c + d*x)**2*a**2 - sin(c + d* 
x)**2*b**2 + a**2 - b**2)/(2*b**3*d*(2*cos(c + d*x)*sin(c + d*x)*a*b - sin 
(c + d*x)**2*a**2 + sin(c + d*x)**2*b**2 + a**2))