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

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

Optimal result

Integrand size = 28, antiderivative size = 138 \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=-\frac {3 a b^2 \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{5/2} d}+\frac {2 a b \cos (c+d x)}{\left (a^2+b^2\right )^2 d}+\frac {\left (a^2-b^2\right ) \sin (c+d x)}{\left (a^2+b^2\right )^2 d}-\frac {b^3}{\left (a^2+b^2\right )^2 d (a \cos (c+d x)+b \sin (c+d x))} \] Output:

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

Mathematica [A] (verified)

Time = 0.87 (sec) , antiderivative size = 130, normalized size of antiderivative = 0.94 \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\frac {\frac {12 a b^2 \text {arctanh}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{5/2}}+\frac {3 b \left (a^2-b^2\right )+b \left (a^2+b^2\right ) \cos (2 (c+d x))+a \left (a^2+b^2\right ) \sin (2 (c+d x))}{\left (a^2+b^2\right )^2 (a \cos (c+d x)+b \sin (c+d x))}}{2 d} \] Input:

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

Output:

((12*a*b^2*ArcTanh[(-b + a*Tan[(c + d*x)/2])/Sqrt[a^2 + b^2]])/(a^2 + b^2) 
^(5/2) + (3*b*(a^2 - b^2) + b*(a^2 + b^2)*Cos[2*(c + d*x)] + a*(a^2 + b^2) 
*Sin[2*(c + d*x)])/((a^2 + b^2)^2*(a*Cos[c + d*x] + b*Sin[c + d*x])))/(2*d 
)
 

Rubi [A] (verified)

Time = 0.89 (sec) , antiderivative size = 222, normalized size of antiderivative = 1.61, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 4902, 7293, 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 {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4902

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

\(\Big \downarrow \) 7293

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {2 \left (-\frac {b^2 \left (3 a^2+b^2\right ) \text {arctanh}\left (\frac {b-a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{a \left (a^2+b^2\right )^{5/2}}+\frac {b^4 \text {arctanh}\left (\frac {b-a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{a \left (a^2+b^2\right )^{5/2}}+\frac {\left (a^2-b^2\right ) \tan \left (\frac {1}{2} (c+d x)\right )+2 a b}{\left (a^2+b^2\right )^2 \left (\tan ^2\left (\frac {1}{2} (c+d x)\right )+1\right )}-\frac {b^3 \left (a+b \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \left (a^2+b^2\right )^2 \left (-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+2 b \tan \left (\frac {1}{2} (c+d x)\right )\right )}\right )}{d}\)

Input:

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

Output:

(2*((b^4*ArcTanh[(b - a*Tan[(c + d*x)/2])/Sqrt[a^2 + b^2]])/(a*(a^2 + b^2) 
^(5/2)) - (b^2*(3*a^2 + b^2)*ArcTanh[(b - a*Tan[(c + d*x)/2])/Sqrt[a^2 + b 
^2]])/(a*(a^2 + b^2)^(5/2)) + (2*a*b + (a^2 - b^2)*Tan[(c + d*x)/2])/((a^2 
 + b^2)^2*(1 + Tan[(c + d*x)/2]^2)) - (b^3*(a + b*Tan[(c + d*x)/2]))/(a*(a 
^2 + b^2)^2*(a + 2*b*Tan[(c + d*x)/2] - a*Tan[(c + d*x)/2]^2))))/d
 

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 4902
Int[u_, x_Symbol] :> With[{w = Block[{$ShowSteps = False, $StepCounter = Nu 
ll}, Int[SubstFor[1/(1 + FreeFactors[Tan[FunctionOfTrig[u, x]/2], x]^2*x^2) 
, Tan[FunctionOfTrig[u, x]/2]/FreeFactors[Tan[FunctionOfTrig[u, x]/2], x], 
u, x], x]]}, Module[{v = FunctionOfTrig[u, x], d}, Simp[d = FreeFactors[Tan 
[v/2], x]; 2*(d/Coefficient[v, x, 1])   Subst[Int[SubstFor[1/(1 + d^2*x^2), 
 Tan[v/2]/d, u, x], x], x, Tan[v/2]/d], x]] /; CalculusFreeQ[w, x]] /; Inve 
rseFunctionFreeQ[u, x] &&  !FalseQ[FunctionOfTrig[u, x]]
 

rule 7293
Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v] 
]
 
Maple [A] (verified)

Time = 0.52 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.25

method result size
derivativedivides \(\frac {-\frac {2 \left (\left (-a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 a b \right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}-\frac {2 b^{2} \left (\frac {-\frac {b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}-b}{\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}-\frac {3 a \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{2}}}{d}\) \(172\)
default \(\frac {-\frac {2 \left (\left (-a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 a b \right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}-\frac {2 b^{2} \left (\frac {-\frac {b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}-b}{\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}-\frac {3 a \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{2}}}{d}\) \(172\)
risch \(-\frac {i {\mathrm e}^{i \left (d x +c \right )}}{2 \left (-2 i a b +a^{2}-b^{2}\right ) d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )}}{2 \left (2 i a b +a^{2}-b^{2}\right ) d}-\frac {2 i b^{3} {\mathrm e}^{i \left (d x +c \right )}}{\left (-i a +b \right )^{2} d \left (i a +b \right )^{2} \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 )}+\frac {3 b^{2} a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{5}+2 i a^{3} b^{2}+i a \,b^{4}-a^{4} b -2 a^{2} b^{3}-b^{5}}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}} d}-\frac {3 b^{2} a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{5}+2 i a^{3} b^{2}+i a \,b^{4}-a^{4} b -2 a^{2} b^{3}-b^{5}}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}} d}\) \(295\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 302 vs. \(2 (134) = 268\).

Time = 0.09 (sec) , antiderivative size = 302, normalized size of antiderivative = 2.19 \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\frac {2 \, a^{4} b - 2 \, a^{2} b^{3} - 4 \, b^{5} + 2 \, {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \, {\left (a^{2} b^{2} \cos \left (d x + c\right ) + a b^{3} \sin \left (d x + c\right )\right )} \sqrt {a^{2} + b^{2}} \log \left (-\frac {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} - 2 \, a^{2} - b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{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 )}{2 \, {\left ({\left (a^{7} + 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} + a b^{6}\right )} d \cos \left (d x + c\right ) + {\left (a^{6} b + 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}\right )} d \sin \left (d x + c\right )\right )}} \] Input:

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

Output:

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

Sympy [F(-1)]

Timed out. \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 348 vs. \(2 (134) = 268\).

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

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

Output:

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 286 vs. \(2 (134) = 268\).

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 18.51 (sec) , antiderivative size = 286, normalized size of antiderivative = 2.07 \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\frac {\frac {4\,a^2\,b-2\,b^3}{a^4+2\,a^2\,b^2+b^4}-\frac {6\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{a^4+2\,a^2\,b^2+b^4}+\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^4+3\,a^2\,b^2-b^4\right )}{a\,\left (a^4+2\,a^2\,b^2+b^4\right )}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,a^4-2\,a^2\,b^2+2\,b^4\right )}{a\,\left (a^4+2\,a^2\,b^2+b^4\right )}}{d\,\left (-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}-\frac {6\,a\,b^2\,\mathrm {atanh}\left (\frac {a^4\,b+b^5+2\,a^2\,b^3-a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^4+2\,a^2\,b^2+b^4\right )}{{\left (a^2+b^2\right )}^{5/2}}\right )}{d\,{\left (a^2+b^2\right )}^{5/2}} \] Input:

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

Output:

((4*a^2*b - 2*b^3)/(a^4 + b^4 + 2*a^2*b^2) - (6*b^3*tan(c/2 + (d*x)/2)^2)/ 
(a^4 + b^4 + 2*a^2*b^2) + (2*tan(c/2 + (d*x)/2)*(a^4 - b^4 + 3*a^2*b^2))/( 
a*(a^4 + b^4 + 2*a^2*b^2)) - (tan(c/2 + (d*x)/2)^3*(2*a^4 + 2*b^4 - 2*a^2* 
b^2))/(a*(a^4 + b^4 + 2*a^2*b^2)))/(d*(a + 2*b*tan(c/2 + (d*x)/2) - a*tan( 
c/2 + (d*x)/2)^4 + 2*b*tan(c/2 + (d*x)/2)^3)) - (6*a*b^2*atanh((a^4*b + b^ 
5 + 2*a^2*b^3 - a*tan(c/2 + (d*x)/2)*(a^4 + b^4 + 2*a^2*b^2))/(a^2 + b^2)^ 
(5/2)))/(d*(a^2 + b^2)^(5/2))
 

Reduce [B] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 403, normalized size of antiderivative = 2.92 \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\frac {-6 \sqrt {a^{2}+b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a i -b i}{\sqrt {a^{2}+b^{2}}}\right ) \cos \left (d x +c \right ) a^{2} b^{3} i -6 \sqrt {a^{2}+b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a i -b i}{\sqrt {a^{2}+b^{2}}}\right ) \sin \left (d x +c \right ) a \,b^{4} i +\cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{5} b +2 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{3} b^{3}+\cos \left (d x +c \right ) \sin \left (d x +c \right ) a \,b^{5}+\cos \left (d x +c \right ) a^{6}+2 \cos \left (d x +c \right ) a^{4} b^{2}+\cos \left (d x +c \right ) a^{2} b^{4}-\sin \left (d x +c \right )^{2} a^{4} b^{2}-2 \sin \left (d x +c \right )^{2} a^{2} b^{4}-\sin \left (d x +c \right )^{2} b^{6}+\sin \left (d x +c \right ) a^{5} b +2 \sin \left (d x +c \right ) a^{3} b^{3}+\sin \left (d x +c \right ) a \,b^{5}+2 a^{4} b^{2}+a^{2} b^{4}-b^{6}}{b d \left (\cos \left (d x +c \right ) a^{7}+3 \cos \left (d x +c \right ) a^{5} b^{2}+3 \cos \left (d x +c \right ) a^{3} b^{4}+\cos \left (d x +c \right ) a \,b^{6}+\sin \left (d x +c \right ) a^{6} b +3 \sin \left (d x +c \right ) a^{4} b^{3}+3 \sin \left (d x +c \right ) a^{2} b^{5}+\sin \left (d x +c \right ) b^{7}\right )} \] Input:

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

Output:

( - 6*sqrt(a**2 + b**2)*atan((tan((c + d*x)/2)*a*i - b*i)/sqrt(a**2 + b**2 
))*cos(c + d*x)*a**2*b**3*i - 6*sqrt(a**2 + b**2)*atan((tan((c + d*x)/2)*a 
*i - b*i)/sqrt(a**2 + b**2))*sin(c + d*x)*a*b**4*i + cos(c + d*x)*sin(c + 
d*x)*a**5*b + 2*cos(c + d*x)*sin(c + d*x)*a**3*b**3 + cos(c + d*x)*sin(c + 
 d*x)*a*b**5 + cos(c + d*x)*a**6 + 2*cos(c + d*x)*a**4*b**2 + cos(c + d*x) 
*a**2*b**4 - sin(c + d*x)**2*a**4*b**2 - 2*sin(c + d*x)**2*a**2*b**4 - sin 
(c + d*x)**2*b**6 + sin(c + d*x)*a**5*b + 2*sin(c + d*x)*a**3*b**3 + sin(c 
 + d*x)*a*b**5 + 2*a**4*b**2 + a**2*b**4 - b**6)/(b*d*(cos(c + d*x)*a**7 + 
 3*cos(c + d*x)*a**5*b**2 + 3*cos(c + d*x)*a**3*b**4 + cos(c + d*x)*a*b**6 
 + sin(c + d*x)*a**6*b + 3*sin(c + d*x)*a**4*b**3 + 3*sin(c + d*x)*a**2*b* 
*5 + sin(c + d*x)*b**7))