Integrand size = 21, antiderivative size = 55 \[ \int \cos ^3(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {2 a b \cos ^3(c+d x)}{3 d}+\frac {a^2 \sin (c+d x)}{d}-\frac {\left (a^2-b^2\right ) \sin ^3(c+d x)}{3 d} \] Output:
-2/3*a*b*cos(d*x+c)^3/d+a^2*sin(d*x+c)/d-1/3*(a^2-b^2)*sin(d*x+c)^3/d
Time = 0.04 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.22 \[ \int \cos ^3(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {2 a b \cos ^3(c+d x)}{3 d}+\frac {a^2 \sin (c+d x)}{d}-\frac {a^2 \sin ^3(c+d x)}{3 d}+\frac {b^2 \sin ^3(c+d x)}{3 d} \] Input:
Integrate[Cos[c + d*x]^3*(a + b*Tan[c + d*x])^2,x]
Output:
(-2*a*b*Cos[c + d*x]^3)/(3*d) + (a^2*Sin[c + d*x])/d - (a^2*Sin[c + d*x]^3 )/(3*d) + (b^2*Sin[c + d*x]^3)/(3*d)
Time = 0.39 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.98, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3042, 3991, 27, 3042, 3045, 15, 4159, 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 \cos ^3(c+d x) (a+b \tan (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+b \tan (c+d x))^2}{\sec (c+d x)^3}dx\) |
\(\Big \downarrow \) 3991 |
\(\displaystyle \int \cos ^3(c+d x) \left (a^2+b^2 \tan ^2(c+d x)\right )dx+\int 2 a b \cos ^2(c+d x) \sin (c+d x)dx\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \int \cos ^3(c+d x) \left (a^2+b^2 \tan ^2(c+d x)\right )dx+2 a b \int \cos ^2(c+d x) \sin (c+d x)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {a^2+b^2 \tan (c+d x)^2}{\sec (c+d x)^3}dx+2 a b \int \cos (c+d x)^2 \sin (c+d x)dx\) |
\(\Big \downarrow \) 3045 |
\(\displaystyle \int \frac {a^2+b^2 \tan (c+d x)^2}{\sec (c+d x)^3}dx-\frac {2 a b \int \cos ^2(c+d x)d\cos (c+d x)}{d}\) |
\(\Big \downarrow \) 15 |
\(\displaystyle \int \frac {a^2+b^2 \tan (c+d x)^2}{\sec (c+d x)^3}dx-\frac {2 a b \cos ^3(c+d x)}{3 d}\) |
\(\Big \downarrow \) 4159 |
\(\displaystyle \frac {\int \left (a^2-\left (a^2-b^2\right ) \sin ^2(c+d x)\right )d\sin (c+d x)}{d}-\frac {2 a b \cos ^3(c+d x)}{3 d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a^2 \sin (c+d x)-\frac {1}{3} \left (a^2-b^2\right ) \sin ^3(c+d x)}{d}-\frac {2 a b \cos ^3(c+d x)}{3 d}\) |
Input:
Int[Cos[c + d*x]^3*(a + b*Tan[c + d*x])^2,x]
Output:
(-2*a*b*Cos[c + d*x]^3)/(3*d) + (a^2*Sin[c + d*x] - ((a^2 - b^2)*Sin[c + d *x]^3)/3)/d
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ {a, m}, x] && NeQ[m, -1]
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_.)*sin[(e_.) + (f_.)*(x_)]^(n_.), x_ Symbol] :> Simp[-(a*f)^(-1) Subst[Int[x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Cos[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] && !(IntegerQ[(m - 1)/2] && GtQ[m, 0] && LeQ[m, n])
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n _), x_Symbol] :> Module[{k}, Int[Sec[e + f*x]^m*Sum[Binomial[n, 2*k]*a^(n - 2*k)*b^(2*k)*Tan[e + f*x]^(2*k), {k, 0, n/2}], x] + Int[Sec[e + f*x]^m*Tan [e + f*x]*Sum[Binomial[n, 2*k + 1]*a^(n - 2*k - 1)*b^(2*k + 1)*Tan[e + f*x] ^(2*k), {k, 0, (n - 1)/2}], x]] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 0] && IntegerQ[(m - 1)/2] && IGtQ[n, 0]
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 = 4.78 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.95
method | result | size |
derivativedivides | \(\frac {\frac {b^{2} \sin \left (d x +c \right )^{3}}{3}-\frac {2 a b \cos \left (d x +c \right )^{3}}{3}+\frac {a^{2} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}}{d}\) | \(52\) |
default | \(\frac {\frac {b^{2} \sin \left (d x +c \right )^{3}}{3}-\frac {2 a b \cos \left (d x +c \right )^{3}}{3}+\frac {a^{2} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}}{d}\) | \(52\) |
risch | \(-\frac {a b \cos \left (d x +c \right )}{2 d}+\frac {3 a^{2} \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (d x +c \right ) b^{2}}{4 d}-\frac {a b \cos \left (3 d x +3 c \right )}{6 d}+\frac {\sin \left (3 d x +3 c \right ) a^{2}}{12 d}-\frac {\sin \left (3 d x +3 c \right ) b^{2}}{12 d}\) | \(93\) |
Input:
int(cos(d*x+c)^3*(a+b*tan(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
1/d*(1/3*b^2*sin(d*x+c)^3-2/3*a*b*cos(d*x+c)^3+1/3*a^2*(2+cos(d*x+c)^2)*si n(d*x+c))
Time = 0.08 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.96 \[ \int \cos ^3(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {2 \, a b \cos \left (d x + c\right )^{3} - {\left ({\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, a^{2} + b^{2}\right )} \sin \left (d x + c\right )}{3 \, d} \] Input:
integrate(cos(d*x+c)^3*(a+b*tan(d*x+c))^2,x, algorithm="fricas")
Output:
-1/3*(2*a*b*cos(d*x + c)^3 - ((a^2 - b^2)*cos(d*x + c)^2 + 2*a^2 + b^2)*si n(d*x + c))/d
\[ \int \cos ^3(c+d x) (a+b \tan (c+d x))^2 \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{2} \cos ^{3}{\left (c + d x \right )}\, dx \] Input:
integrate(cos(d*x+c)**3*(a+b*tan(d*x+c))**2,x)
Output:
Integral((a + b*tan(c + d*x))**2*cos(c + d*x)**3, x)
Time = 0.03 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.95 \[ \int \cos ^3(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {2 \, a b \cos \left (d x + c\right )^{3} - b^{2} \sin \left (d x + c\right )^{3} + {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{2}}{3 \, d} \] Input:
integrate(cos(d*x+c)^3*(a+b*tan(d*x+c))^2,x, algorithm="maxima")
Output:
-1/3*(2*a*b*cos(d*x + c)^3 - b^2*sin(d*x + c)^3 + (sin(d*x + c)^3 - 3*sin( d*x + c))*a^2)/d
Leaf count of result is larger than twice the leaf count of optimal. 11162 vs. \(2 (51) = 102\).
Time = 14.48 (sec) , antiderivative size = 11162, normalized size of antiderivative = 202.95 \[ \int \cos ^3(c+d x) (a+b \tan (c+d x))^2 \, dx=\text {Too large to display} \] Input:
integrate(cos(d*x+c)^3*(a+b*tan(d*x+c))^2,x, algorithm="giac")
Output:
-1/48*(3*pi*a*b*sgn(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1/2 *c) + tan(1/2*d*x)^2 - tan(1/2*c)^2 + 2*tan(1/2*c) - 1)*sgn(tan(1/2*d*x)^2 *tan(1/2*c)^2 + 2*tan(1/2*d*x)*tan(1/2*c)^2 - tan(1/2*d*x)^2 + tan(1/2*c)^ 2 + 2*tan(1/2*d*x) - 1)*tan(1/2*d*x)^6*tan(1/2*c)^6 + 3*pi*a*b*sgn(tan(1/2 *d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^2*tan(1/2*c) + tan(1/2*d*x)^2 - tan( 1/2*c)^2 - 2*tan(1/2*c) - 1)*sgn(tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d *x)*tan(1/2*c)^2 - tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 1)*tan (1/2*d*x)^6*tan(1/2*c)^6 + 3*pi*a*b*sgn(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*ta n(1/2*d*x)^2*tan(1/2*c) + tan(1/2*d*x)^2 - tan(1/2*c)^2 + 2*tan(1/2*c) - 1 )*tan(1/2*d*x)^6*tan(1/2*c)^6 + 3*pi*a*b*sgn(tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^2*tan(1/2*c) + tan(1/2*d*x)^2 - tan(1/2*c)^2 - 2*tan(1/2*c ) - 1)*tan(1/2*d*x)^6*tan(1/2*c)^6 + 9*pi*a*b*sgn(tan(1/2*d*x)^2*tan(1/2*c )^2 + 2*tan(1/2*d*x)^2*tan(1/2*c) + tan(1/2*d*x)^2 - tan(1/2*c)^2 + 2*tan( 1/2*c) - 1)*sgn(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)*tan(1/2*c)^2 - tan(1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) - 1)*tan(1/2*d*x)^6*tan(1 /2*c)^4 + 9*pi*a*b*sgn(tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^2*tan( 1/2*c) + tan(1/2*d*x)^2 - tan(1/2*c)^2 - 2*tan(1/2*c) - 1)*sgn(tan(1/2*d*x )^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)*tan(1/2*c)^2 - tan(1/2*d*x)^2 + tan(1/2* c)^2 - 2*tan(1/2*d*x) - 1)*tan(1/2*d*x)^6*tan(1/2*c)^4 + 9*pi*a*b*sgn(tan( 1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1/2*c) + tan(1/2*d*x)^2 ...
Time = 0.80 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.40 \[ \int \cos ^3(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {2\,\left (\frac {\sin \left (c+d\,x\right )\,a^2\,{\cos \left (c+d\,x\right )}^2}{2}+\sin \left (c+d\,x\right )\,a^2-a\,b\,{\cos \left (c+d\,x\right )}^3-\frac {\sin \left (c+d\,x\right )\,b^2\,{\cos \left (c+d\,x\right )}^2}{2}+\frac {\sin \left (c+d\,x\right )\,b^2}{2}\right )}{3\,d} \] Input:
int(cos(c + d*x)^3*(a + b*tan(c + d*x))^2,x)
Output:
(2*(a^2*sin(c + d*x) + (b^2*sin(c + d*x))/2 + (a^2*cos(c + d*x)^2*sin(c + d*x))/2 - (b^2*cos(c + d*x)^2*sin(c + d*x))/2 - a*b*cos(c + d*x)^3))/(3*d)
Time = 0.20 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.35 \[ \int \cos ^3(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a b -2 \cos \left (d x +c \right ) a b -\sin \left (d x +c \right )^{3} a^{2}+\sin \left (d x +c \right )^{3} b^{2}+3 \sin \left (d x +c \right ) a^{2}+2 a b}{3 d} \] Input:
int(cos(d*x+c)^3*(a+b*tan(d*x+c))^2,x)
Output:
(2*cos(c + d*x)*sin(c + d*x)**2*a*b - 2*cos(c + d*x)*a*b - sin(c + d*x)**3 *a**2 + sin(c + d*x)**3*b**2 + 3*sin(c + d*x)*a**2 + 2*a*b)/(3*d)