Optimal. Leaf size=103 \[ -\frac {b \cos (c+d x)-a \sin (c+d x)}{2 d \left (a^2+b^2\right ) (a \cos (c+d x)+b \sin (c+d x))^2}-\frac {\tanh ^{-1}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{2 d \left (a^2+b^2\right )^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3076, 3074, 206} \[ -\frac {b \cos (c+d x)-a \sin (c+d x)}{2 d \left (a^2+b^2\right ) (a \cos (c+d x)+b \sin (c+d x))^2}-\frac {\tanh ^{-1}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{2 d \left (a^2+b^2\right )^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 3074
Rule 3076
Rubi steps
\begin {align*} \int \frac {1}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx &=-\frac {b \cos (c+d x)-a \sin (c+d x)}{2 \left (a^2+b^2\right ) d (a \cos (c+d x)+b \sin (c+d x))^2}+\frac {\int \frac {1}{a \cos (c+d x)+b \sin (c+d x)} \, dx}{2 \left (a^2+b^2\right )}\\ &=-\frac {b \cos (c+d x)-a \sin (c+d x)}{2 \left (a^2+b^2\right ) d (a \cos (c+d x)+b \sin (c+d x))^2}-\frac {\operatorname {Subst}\left (\int \frac {1}{a^2+b^2-x^2} \, dx,x,b \cos (c+d x)-a \sin (c+d x)\right )}{2 \left (a^2+b^2\right ) d}\\ &=-\frac {\tanh ^{-1}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{2 \left (a^2+b^2\right )^{3/2} d}-\frac {b \cos (c+d x)-a \sin (c+d x)}{2 \left (a^2+b^2\right ) d (a \cos (c+d x)+b \sin (c+d x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.29, size = 132, normalized size = 1.28 \[ \frac {\left (a^2+b^2\right ) (a \sin (c+d x)-b \cos (c+d x))+2 \sqrt {a^2+b^2} (a \cos (c+d x)+b \sin (c+d x))^2 \tanh ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )-b}{\sqrt {a^2+b^2}}\right )}{2 d (a-i b)^2 (a+i b)^2 (a \cos (c+d x)+b \sin (c+d x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.38, size = 294, normalized size = 2.85 \[ \frac {{\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 )} \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 (a^{2} b + b^{3}\right )} \cos \left (d x + c\right ) + 2 \, {\left (a^{3} + a b^{2}\right )} \sin \left (d x + c\right )}{4 \, {\left ({\left (a^{6} + a^{4} b^{2} - a^{2} b^{4} - b^{6}\right )} d \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{5} b + 2 \, a^{3} b^{3} + a b^{5}\right )} d \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}\right )} d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.23, size = 221, normalized size = 2.15 \[ -\frac {\frac {\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^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{2} b\right )}}{{\left (a^{4} + a^{2} b^{2}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a\right )}^{2}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.53, size = 191, normalized size = 1.85 \[ \frac {-\frac {2 \left (-\frac {\left (a^{2}+2 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a^{2}+b^{2}\right ) a}-\frac {b \left (a^{2}-2 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a^{2}+b^{2}\right ) a^{2}}-\frac {\left (a^{2}-2 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a \left (a^{2}+b^{2}\right )}+\frac {b}{2 a^{2}+2 b^{2}}\right )}{\left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )^{2}}+\frac {\arctanh \left (\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a -2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.46, size = 326, normalized size = 3.17 \[ -\frac {\frac {2 \, {\left (a^{2} b - \frac {{\left (a^{3} - 2 \, a b^{2}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {{\left (a^{2} b - 2 \, b^{3}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {{\left (a^{3} + 2 \, a b^{2}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{6} + a^{4} b^{2} + \frac {4 \, {\left (a^{5} b + a^{3} b^{3}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {2 \, {\left (a^{6} - 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 {4 \, {\left (a^{5} b + a^{3} b^{3}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {{\left (a^{6} + a^{4} b^{2}\right )} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {\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^{2} + b^{2}\right )}^{\frac {3}{2}}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.55, size = 260, normalized size = 2.52 \[ \frac {\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-2\,b^2\right )}{a\,\left (a^2+b^2\right )}-\frac {b}{a^2+b^2}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (a^2+2\,b^2\right )}{a\,\left (a^2+b^2\right )}+\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (a^2-2\,b^2\right )}{a^2\,\left (a^2+b^2\right )}}{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 )}+\frac {\mathrm {atanh}\left (\frac {\left (2\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {2\,a^2\,b+2\,b^3}{a^2+b^2}\right )\,\left (\frac {a^2}{2}+\frac {b^2}{2}\right )}{{\left (a^2+b^2\right )}^{3/2}}\right )}{d\,{\left (a^2+b^2\right )}^{3/2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________