Integrand size = 23, antiderivative size = 88 \[ \int \frac {\cos ^3(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\frac {b^2 \text {arctanh}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} (a-b)^{5/2} d}+\frac {(a-2 b) \sin (c+d x)}{(a-b)^2 d}-\frac {\sin ^3(c+d x)}{3 (a-b) d} \] Output:
b^2*arctanh((a-b)^(1/2)*sin(d*x+c)/a^(1/2))/a^(1/2)/(a-b)^(5/2)/d+(a-2*b)* sin(d*x+c)/(a-b)^2/d-1/3*sin(d*x+c)^3/(a-b)/d
Time = 0.36 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.31 \[ \int \frac {\cos ^3(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\frac {\frac {6 b^2 \left (-\log \left (\sqrt {a}-\sqrt {a-b} \sin (c+d x)\right )+\log \left (\sqrt {a}+\sqrt {a-b} \sin (c+d x)\right )\right )}{\sqrt {a} (a-b)^{5/2}}+\frac {3 (3 a-7 b) \sin (c+d x)}{(a-b)^2}+\frac {\sin (3 (c+d x))}{a-b}}{12 d} \] Input:
Integrate[Cos[c + d*x]^3/(a + b*Tan[c + d*x]^2),x]
Output:
((6*b^2*(-Log[Sqrt[a] - Sqrt[a - b]*Sin[c + d*x]] + Log[Sqrt[a] + Sqrt[a - b]*Sin[c + d*x]]))/(Sqrt[a]*(a - b)^(5/2)) + (3*(3*a - 7*b)*Sin[c + d*x]) /(a - b)^2 + Sin[3*(c + d*x)]/(a - b))/(12*d)
Time = 0.31 (sec) , antiderivative size = 83, 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.174, Rules used = {3042, 4159, 300, 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+b \tan ^2(c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\sec (c+d x)^3 \left (a+b \tan (c+d x)^2\right )}dx\) |
\(\Big \downarrow \) 4159 |
\(\displaystyle \frac {\int \frac {\left (1-\sin ^2(c+d x)\right )^2}{a-(a-b) \sin ^2(c+d x)}d\sin (c+d x)}{d}\) |
\(\Big \downarrow \) 300 |
\(\displaystyle \frac {\int \left (\frac {b^2}{(a-b)^2 \left (a-(a-b) \sin ^2(c+d x)\right )}-\frac {\sin ^2(c+d x)}{a-b}+\frac {a-2 b}{(a-b)^2}\right )d\sin (c+d x)}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\frac {b^2 \text {arctanh}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} (a-b)^{5/2}}-\frac {\sin ^3(c+d x)}{3 (a-b)}+\frac {(a-2 b) \sin (c+d x)}{(a-b)^2}}{d}\) |
Input:
Int[Cos[c + d*x]^3/(a + b*Tan[c + d*x]^2),x]
Output:
((b^2*ArcTanh[(Sqrt[a - b]*Sin[c + d*x])/Sqrt[a]])/(Sqrt[a]*(a - b)^(5/2)) + ((a - 2*b)*Sin[c + d*x])/(a - b)^2 - Sin[c + d*x]^3/(3*(a - b)))/d
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int [PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c , d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_ ))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2 *x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f} , x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2] && IntegerQ[p]
Time = 5.22 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.11
method | result | size |
derivativedivides | \(\frac {-\frac {\frac {a \sin \left (d x +c \right )^{3}}{3}-\frac {b \sin \left (d x +c \right )^{3}}{3}-\sin \left (d x +c \right ) a +2 b \sin \left (d x +c \right )}{\left (a -b \right )^{2}}+\frac {b^{2} \operatorname {arctanh}\left (\frac {\left (a -b \right ) \sin \left (d x +c \right )}{\sqrt {a \left (a -b \right )}}\right )}{\left (a -b \right )^{2} \sqrt {a \left (a -b \right )}}}{d}\) | \(98\) |
default | \(\frac {-\frac {\frac {a \sin \left (d x +c \right )^{3}}{3}-\frac {b \sin \left (d x +c \right )^{3}}{3}-\sin \left (d x +c \right ) a +2 b \sin \left (d x +c \right )}{\left (a -b \right )^{2}}+\frac {b^{2} \operatorname {arctanh}\left (\frac {\left (a -b \right ) \sin \left (d x +c \right )}{\sqrt {a \left (a -b \right )}}\right )}{\left (a -b \right )^{2} \sqrt {a \left (a -b \right )}}}{d}\) | \(98\) |
risch | \(-\frac {3 i {\mathrm e}^{i \left (d x +c \right )} a}{8 \left (a -b \right )^{2} d}+\frac {7 i {\mathrm e}^{i \left (d x +c \right )} b}{8 \left (a -b \right )^{2} d}+\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} a}{8 \left (a -b \right )^{2} d}-\frac {7 i {\mathrm e}^{-i \left (d x +c \right )} b}{8 \left (a -b \right )^{2} d}+\frac {b^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{\sqrt {a^{2}-a b}}-1\right )}{2 \sqrt {a^{2}-a b}\, \left (a -b \right )^{2} d}-\frac {b^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{\sqrt {a^{2}-a b}}-1\right )}{2 \sqrt {a^{2}-a b}\, \left (a -b \right )^{2} d}+\frac {\sin \left (3 d x +3 c \right )}{12 \left (a -b \right ) d}\) | \(235\) |
Input:
int(cos(d*x+c)^3/(a+b*tan(d*x+c)^2),x,method=_RETURNVERBOSE)
Output:
1/d*(-1/(a-b)^2*(1/3*a*sin(d*x+c)^3-1/3*b*sin(d*x+c)^3-sin(d*x+c)*a+2*b*si n(d*x+c))+b^2/(a-b)^2/(a*(a-b))^(1/2)*arctanh((a-b)*sin(d*x+c)/(a*(a-b))^( 1/2)))
Time = 0.13 (sec) , antiderivative size = 276, normalized size of antiderivative = 3.14 \[ \int \frac {\cos ^3(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\left [\frac {3 \, \sqrt {a^{2} - a b} b^{2} \log \left (-\frac {{\left (a - b\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - a b} \sin \left (d x + c\right ) - 2 \, a + b}{{\left (a - b\right )} \cos \left (d x + c\right )^{2} + b}\right ) + 2 \, {\left (2 \, a^{3} - 7 \, a^{2} b + 5 \, a b^{2} + {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{4} - 3 \, a^{3} b + 3 \, a^{2} b^{2} - a b^{3}\right )} d}, -\frac {3 \, \sqrt {-a^{2} + a b} b^{2} \arctan \left (\frac {\sqrt {-a^{2} + a b} \sin \left (d x + c\right )}{a}\right ) - {\left (2 \, a^{3} - 7 \, a^{2} b + 5 \, a b^{2} + {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{4} - 3 \, a^{3} b + 3 \, a^{2} b^{2} - a b^{3}\right )} d}\right ] \] Input:
integrate(cos(d*x+c)^3/(a+b*tan(d*x+c)^2),x, algorithm="fricas")
Output:
[1/6*(3*sqrt(a^2 - a*b)*b^2*log(-((a - b)*cos(d*x + c)^2 - 2*sqrt(a^2 - a* b)*sin(d*x + c) - 2*a + b)/((a - b)*cos(d*x + c)^2 + b)) + 2*(2*a^3 - 7*a^ 2*b + 5*a*b^2 + (a^3 - 2*a^2*b + a*b^2)*cos(d*x + c)^2)*sin(d*x + c))/((a^ 4 - 3*a^3*b + 3*a^2*b^2 - a*b^3)*d), -1/3*(3*sqrt(-a^2 + a*b)*b^2*arctan(s qrt(-a^2 + a*b)*sin(d*x + c)/a) - (2*a^3 - 7*a^2*b + 5*a*b^2 + (a^3 - 2*a^ 2*b + a*b^2)*cos(d*x + c)^2)*sin(d*x + c))/((a^4 - 3*a^3*b + 3*a^2*b^2 - a *b^3)*d)]
Timed out. \[ \int \frac {\cos ^3(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\text {Timed out} \] Input:
integrate(cos(d*x+c)**3/(a+b*tan(d*x+c)**2),x)
Output:
Timed out
Exception generated. \[ \int \frac {\cos ^3(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate(cos(d*x+c)^3/(a+b*tan(d*x+c)^2),x, algorithm="maxima")
Output:
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for more details)Is
Leaf count of result is larger than twice the leaf count of optimal. 161 vs. \(2 (78) = 156\).
Time = 0.42 (sec) , antiderivative size = 161, normalized size of antiderivative = 1.83 \[ \int \frac {\cos ^3(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\frac {\frac {3 \, b^{2} \arctan \left (-\frac {a \sin \left (d x + c\right ) - b \sin \left (d x + c\right )}{\sqrt {-a^{2} + a b}}\right )}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \sqrt {-a^{2} + a b}} - \frac {a^{2} \sin \left (d x + c\right )^{3} - 2 \, a b \sin \left (d x + c\right )^{3} + b^{2} \sin \left (d x + c\right )^{3} - 3 \, a^{2} \sin \left (d x + c\right ) + 9 \, a b \sin \left (d x + c\right ) - 6 \, b^{2} \sin \left (d x + c\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}}}{3 \, d} \] Input:
integrate(cos(d*x+c)^3/(a+b*tan(d*x+c)^2),x, algorithm="giac")
Output:
1/3*(3*b^2*arctan(-(a*sin(d*x + c) - b*sin(d*x + c))/sqrt(-a^2 + a*b))/((a ^2 - 2*a*b + b^2)*sqrt(-a^2 + a*b)) - (a^2*sin(d*x + c)^3 - 2*a*b*sin(d*x + c)^3 + b^2*sin(d*x + c)^3 - 3*a^2*sin(d*x + c) + 9*a*b*sin(d*x + c) - 6* b^2*sin(d*x + c))/(a^3 - 3*a^2*b + 3*a*b^2 - b^3))/d
Time = 11.16 (sec) , antiderivative size = 251, normalized size of antiderivative = 2.85 \[ \int \frac {\cos ^3(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\frac {\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a-2\,b\right )}{a^2-2\,a\,b+b^2}+\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (a-4\,b\right )}{3\,\left (a^2-2\,a\,b+b^2\right )}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (a-2\,b\right )}{a^2-2\,a\,b+b^2}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {b^2\,\mathrm {atan}\left (\frac {2{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3-6{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+6{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2-2{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}{\sqrt {a}\,{\left (a-b\right )}^{5/2}\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}\right )\,1{}\mathrm {i}}{\sqrt {a}\,d\,{\left (a-b\right )}^{5/2}} \] Input:
int(cos(c + d*x)^3/(a + b*tan(c + d*x)^2),x)
Output:
((2*tan(c/2 + (d*x)/2)*(a - 2*b))/(a^2 - 2*a*b + b^2) + (4*tan(c/2 + (d*x) /2)^3*(a - 4*b))/(3*(a^2 - 2*a*b + b^2)) + (2*tan(c/2 + (d*x)/2)^5*(a - 2* b))/(a^2 - 2*a*b + b^2))/(d*(3*tan(c/2 + (d*x)/2)^2 + 3*tan(c/2 + (d*x)/2) ^4 + tan(c/2 + (d*x)/2)^6 + 1)) - (b^2*atan((a^3*tan(c/2 + (d*x)/2)*2i - b ^3*tan(c/2 + (d*x)/2)*2i + a*b^2*tan(c/2 + (d*x)/2)*6i - a^2*b*tan(c/2 + ( d*x)/2)*6i)/(a^(1/2)*(a - b)^(5/2)*(tan(c/2 + (d*x)/2)^2 + 1)))*1i)/(a^(1/ 2)*d*(a - b)^(5/2))
Time = 0.25 (sec) , antiderivative size = 204, normalized size of antiderivative = 2.32 \[ \int \frac {\cos ^3(c+d x)}{a+b \tan ^2(c+d x)} \, dx=\frac {-3 \sqrt {a}\, \sqrt {a -b}\, \mathrm {log}\left (-2 \sqrt {a -b}\, \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {a}\, \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\sqrt {a}\right ) b^{2}+3 \sqrt {a}\, \sqrt {a -b}\, \mathrm {log}\left (2 \sqrt {a -b}\, \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {a}\, \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\sqrt {a}\right ) b^{2}-2 \sin \left (d x +c \right )^{3} a^{3}+4 \sin \left (d x +c \right )^{3} a^{2} b -2 \sin \left (d x +c \right )^{3} a \,b^{2}+6 \sin \left (d x +c \right ) a^{3}-18 \sin \left (d x +c \right ) a^{2} b +12 \sin \left (d x +c \right ) a \,b^{2}}{6 a d \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )} \] Input:
int(cos(d*x+c)^3/(a+b*tan(d*x+c)^2),x)
Output:
( - 3*sqrt(a)*sqrt(a - b)*log( - 2*sqrt(a - b)*tan((c + d*x)/2) + sqrt(a)* tan((c + d*x)/2)**2 + sqrt(a))*b**2 + 3*sqrt(a)*sqrt(a - b)*log(2*sqrt(a - b)*tan((c + d*x)/2) + sqrt(a)*tan((c + d*x)/2)**2 + sqrt(a))*b**2 - 2*sin (c + d*x)**3*a**3 + 4*sin(c + d*x)**3*a**2*b - 2*sin(c + d*x)**3*a*b**2 + 6*sin(c + d*x)*a**3 - 18*sin(c + d*x)*a**2*b + 12*sin(c + d*x)*a*b**2)/(6* a*d*(a**3 - 3*a**2*b + 3*a*b**2 - b**3))