Integrand size = 21, antiderivative size = 79 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {\left (a^2+b^2\right ) \cot (c+d x)}{d}-\frac {a b \cot ^2(c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}+\frac {2 a b \log (\tan (c+d x))}{d}+\frac {b^2 \tan (c+d x)}{d} \] Output:
-(a^2+b^2)*cot(d*x+c)/d-a*b*cot(d*x+c)^2/d-1/3*a^2*cot(d*x+c)^3/d+2*a*b*ln (tan(d*x+c))/d+b^2*tan(d*x+c)/d
Time = 1.74 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.61 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {\left (3 a b \cot ^2(c+d x)+a^2 \cot ^3(c+d x)+\cos ^2(c+d x) \left (\left (2 a^2+3 b^2\right ) \cot (c+d x)+6 a b (\log (\cos (c+d x))-\log (\sin (c+d x)))\right )-\frac {3}{2} b^2 \sin (2 (c+d x))\right ) (a+b \tan (c+d x))^2}{3 d (a \cos (c+d x)+b \sin (c+d x))^2} \] Input:
Integrate[Csc[c + d*x]^4*(a + b*Tan[c + d*x])^2,x]
Output:
-1/3*((3*a*b*Cot[c + d*x]^2 + a^2*Cot[c + d*x]^3 + Cos[c + d*x]^2*((2*a^2 + 3*b^2)*Cot[c + d*x] + 6*a*b*(Log[Cos[c + d*x]] - Log[Sin[c + d*x]])) - ( 3*b^2*Sin[2*(c + d*x)])/2)*(a + b*Tan[c + d*x])^2)/(d*(a*Cos[c + d*x] + b* Sin[c + d*x])^2)
Time = 0.27 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.92, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 3999, 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 \csc ^4(c+d x) (a+b \tan (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+b \tan (c+d x))^2}{\sin (c+d x)^4}dx\) |
\(\Big \downarrow \) 3999 |
\(\displaystyle \frac {b \int \frac {\cot ^4(c+d x) (a+b \tan (c+d x))^2 \left (\tan ^2(c+d x) b^2+b^2\right )}{b^4}d(b \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 522 |
\(\displaystyle \frac {b \int \left (\frac {a^2 \cot ^4(c+d x)}{b^2}+\frac {2 a \cot ^3(c+d x)}{b}+\frac {\left (a^2+b^2\right ) \cot ^2(c+d x)}{b^2}+\frac {2 a \cot (c+d x)}{b}+1\right )d(b \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {b \left (-\frac {\left (a^2+b^2\right ) \cot (c+d x)}{b}-\frac {a^2 \cot ^3(c+d x)}{3 b}+2 a \log (b \tan (c+d x))-a \cot ^2(c+d x)+b \tan (c+d x)\right )}{d}\) |
Input:
Int[Csc[c + d*x]^4*(a + b*Tan[c + d*x])^2,x]
Output:
(b*(-(((a^2 + b^2)*Cot[c + d*x])/b) - a*Cot[c + d*x]^2 - (a^2*Cot[c + d*x] ^3)/(3*b) + 2*a*Log[b*Tan[c + d*x]] + b*Tan[c + d*x]))/d
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]
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ ), x_Symbol] :> Simp[b/f Subst[Int[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/2]
Time = 5.98 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.01
method | result | size |
derivativedivides | \(\frac {b^{2} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+2 a b \left (-\frac {1}{2 \sin \left (d x +c \right )^{2}}+\ln \left (\tan \left (d x +c \right )\right )\right )+a^{2} \left (-\frac {2}{3}-\frac {\csc \left (d x +c \right )^{2}}{3}\right ) \cot \left (d x +c \right )}{d}\) | \(80\) |
default | \(\frac {b^{2} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+2 a b \left (-\frac {1}{2 \sin \left (d x +c \right )^{2}}+\ln \left (\tan \left (d x +c \right )\right )\right )+a^{2} \left (-\frac {2}{3}-\frac {\csc \left (d x +c \right )^{2}}{3}\right ) \cot \left (d x +c \right )}{d}\) | \(80\) |
risch | \(\frac {4 a b \,{\mathrm e}^{6 i \left (d x +c \right )}+4 i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-4 i b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+\frac {8 i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{3}+8 i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-4 a b \,{\mathrm e}^{2 i \left (d x +c \right )}-\frac {4 i a^{2}}{3}-4 i b^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {2 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}-\frac {2 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(170\) |
Input:
int(csc(d*x+c)^4*(a+b*tan(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
1/d*(b^2*(1/sin(d*x+c)/cos(d*x+c)-2*cot(d*x+c))+2*a*b*(-1/2/sin(d*x+c)^2+l n(tan(d*x+c)))+a^2*(-2/3-1/3*csc(d*x+c)^2)*cot(d*x+c))
Leaf count of result is larger than twice the leaf count of optimal. 174 vs. \(2 (77) = 154\).
Time = 0.09 (sec) , antiderivative size = 174, normalized size of antiderivative = 2.20 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {2 \, {\left (a^{2} + 3 \, b^{2}\right )} \cos \left (d x + c\right )^{4} - 3 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 3 \, {\left (a^{2} + 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (a b \cos \left (d x + c\right )^{3} - a b \cos \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2}\right ) \sin \left (d x + c\right ) - 3 \, {\left (a b \cos \left (d x + c\right )^{3} - a b \cos \left (d x + c\right )\right )} \log \left (-\frac {1}{4} \, \cos \left (d x + c\right )^{2} + \frac {1}{4}\right ) \sin \left (d x + c\right ) + 3 \, b^{2}}{3 \, {\left (d \cos \left (d x + c\right )^{3} - d \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )} \] Input:
integrate(csc(d*x+c)^4*(a+b*tan(d*x+c))^2,x, algorithm="fricas")
Output:
-1/3*(2*(a^2 + 3*b^2)*cos(d*x + c)^4 - 3*a*b*cos(d*x + c)*sin(d*x + c) - 3 *(a^2 + 3*b^2)*cos(d*x + c)^2 + 3*(a*b*cos(d*x + c)^3 - a*b*cos(d*x + c))* log(cos(d*x + c)^2)*sin(d*x + c) - 3*(a*b*cos(d*x + c)^3 - a*b*cos(d*x + c ))*log(-1/4*cos(d*x + c)^2 + 1/4)*sin(d*x + c) + 3*b^2)/((d*cos(d*x + c)^3 - d*cos(d*x + c))*sin(d*x + c))
\[ \int \csc ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{2} \csc ^{4}{\left (c + d x \right )}\, dx \] Input:
integrate(csc(d*x+c)**4*(a+b*tan(d*x+c))**2,x)
Output:
Integral((a + b*tan(c + d*x))**2*csc(c + d*x)**4, x)
Time = 0.03 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.87 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {6 \, a b \log \left (\tan \left (d x + c\right )\right ) + 3 \, b^{2} \tan \left (d x + c\right ) - \frac {3 \, a b \tan \left (d x + c\right ) + 3 \, {\left (a^{2} + b^{2}\right )} \tan \left (d x + c\right )^{2} + a^{2}}{\tan \left (d x + c\right )^{3}}}{3 \, d} \] Input:
integrate(csc(d*x+c)^4*(a+b*tan(d*x+c))^2,x, algorithm="maxima")
Output:
1/3*(6*a*b*log(tan(d*x + c)) + 3*b^2*tan(d*x + c) - (3*a*b*tan(d*x + c) + 3*(a^2 + b^2)*tan(d*x + c)^2 + a^2)/tan(d*x + c)^3)/d
Time = 0.19 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.89 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {6 \, a b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) + 3 \, b^{2} \tan \left (d x + c\right ) - \frac {3 \, a b \tan \left (d x + c\right ) + 3 \, {\left (a^{2} + b^{2}\right )} \tan \left (d x + c\right )^{2} + a^{2}}{\tan \left (d x + c\right )^{3}}}{3 \, d} \] Input:
integrate(csc(d*x+c)^4*(a+b*tan(d*x+c))^2,x, algorithm="giac")
Output:
1/3*(6*a*b*log(abs(tan(d*x + c))) + 3*b^2*tan(d*x + c) - (3*a*b*tan(d*x + c) + 3*(a^2 + b^2)*tan(d*x + c)^2 + a^2)/tan(d*x + c)^3)/d
Time = 0.81 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.91 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (a^2+b^2\right )+\frac {a^2}{3}+a\,b\,\mathrm {tan}\left (c+d\,x\right )}{d\,{\mathrm {tan}\left (c+d\,x\right )}^3}+\frac {2\,a\,b\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d} \] Input:
int((a + b*tan(c + d*x))^2/sin(c + d*x)^4,x)
Output:
(b^2*tan(c + d*x))/d - (tan(c + d*x)^2*(a^2 + b^2) + a^2/3 + a*b*tan(c + d *x))/(d*tan(c + d*x)^3) + (2*a*b*log(tan(c + d*x)))/d
Time = 0.20 (sec) , antiderivative size = 201, normalized size of antiderivative = 2.54 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {-24 \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 )^{3} a b -24 \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 )^{3} a b +24 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{3} a b +3 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} a b -12 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a b +8 \sin \left (d x +c \right )^{4} a^{2}+24 \sin \left (d x +c \right )^{4} b^{2}-4 \sin \left (d x +c \right )^{2} a^{2}-12 \sin \left (d x +c \right )^{2} b^{2}-4 a^{2}}{12 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} d} \] Input:
int(csc(d*x+c)^4*(a+b*tan(d*x+c))^2,x)
Output:
( - 24*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**3*a*b - 24*cos (c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**3*a*b + 24*cos(c + d*x)* log(tan((c + d*x)/2))*sin(c + d*x)**3*a*b + 3*cos(c + d*x)*sin(c + d*x)**3 *a*b - 12*cos(c + d*x)*sin(c + d*x)*a*b + 8*sin(c + d*x)**4*a**2 + 24*sin( c + d*x)**4*b**2 - 4*sin(c + d*x)**2*a**2 - 12*sin(c + d*x)**2*b**2 - 4*a* *2)/(12*cos(c + d*x)*sin(c + d*x)**3*d)