Integrand size = 21, antiderivative size = 50 \[ \int \frac {\tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\sec (c+d x)}{a d}-\frac {\sec ^3(c+d x)}{3 a d}+\frac {\tan ^3(c+d x)}{3 a d} \] Output:
sec(d*x+c)/a/d-1/3*sec(d*x+c)^3/a/d+1/3*tan(d*x+c)^3/a/d
Leaf count is larger than twice the leaf count of optimal. \(106\) vs. \(2(50)=100\).
Time = 0.72 (sec) , antiderivative size = 106, normalized size of antiderivative = 2.12 \[ \int \frac {\tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {6-10 \cos (c+d x)+2 \cos (2 (c+d x))+8 \sin (c+d x)-5 \sin (2 (c+d x))}{12 a d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) (1+\sin (c+d x))} \] Input:
Integrate[Tan[c + d*x]^2/(a + a*Sin[c + d*x]),x]
Output:
(6 - 10*Cos[c + d*x] + 2*Cos[2*(c + d*x)] + 8*Sin[c + d*x] - 5*Sin[2*(c + d*x)])/(12*a*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])*(Cos[(c + d*x)/2] + S in[(c + d*x)/2])*(1 + Sin[c + d*x]))
Time = 0.36 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.96, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 3185, 3042, 3086, 2009, 3087, 15}
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 {\tan ^2(c+d x)}{a \sin (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\tan (c+d x)^2}{a \sin (c+d x)+a}dx\) |
\(\Big \downarrow \) 3185 |
\(\displaystyle \frac {\int \sec ^2(c+d x) \tan ^2(c+d x)dx}{a}-\frac {\int \sec (c+d x) \tan ^3(c+d x)dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \sec (c+d x)^2 \tan (c+d x)^2dx}{a}-\frac {\int \sec (c+d x) \tan (c+d x)^3dx}{a}\) |
\(\Big \downarrow \) 3086 |
\(\displaystyle \frac {\int \sec (c+d x)^2 \tan (c+d x)^2dx}{a}-\frac {\int \left (\sec ^2(c+d x)-1\right )d\sec (c+d x)}{a d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\int \sec (c+d x)^2 \tan (c+d x)^2dx}{a}-\frac {\frac {1}{3} \sec ^3(c+d x)-\sec (c+d x)}{a d}\) |
\(\Big \downarrow \) 3087 |
\(\displaystyle \frac {\int \tan ^2(c+d x)d\tan (c+d x)}{a d}-\frac {\frac {1}{3} \sec ^3(c+d x)-\sec (c+d x)}{a d}\) |
\(\Big \downarrow \) 15 |
\(\displaystyle \frac {\tan ^3(c+d x)}{3 a d}-\frac {\frac {1}{3} \sec ^3(c+d x)-\sec (c+d x)}{a d}\) |
Input:
Int[Tan[c + d*x]^2/(a + a*Sin[c + d*x]),x]
Output:
-((-Sec[c + d*x] + Sec[c + d*x]^3/3)/(a*d)) + Tan[c + d*x]^3/(3*a*d)
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ {a, m}, x] && NeQ[m, -1]
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( n_.), x_Symbol] :> Simp[a/f Subst[Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2 ), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2 ] && !(IntegerQ[m/2] && LtQ[0, m, n + 1])
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_S ymbol] :> Simp[1/f Subst[Int[(b*x)^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] && !(IntegerQ[(n - 1) /2] && LtQ[0, n, m - 1])
Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*( x_)]), x_Symbol] :> Simp[1/a Int[Sec[e + f*x]^2*(g*Tan[e + f*x])^p, x], x ] - Simp[1/(b*g) Int[Sec[e + f*x]*(g*Tan[e + f*x])^(p + 1), x], x] /; Fre eQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[p, -1]
Time = 0.33 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.40
method | result | size |
derivativedivides | \(\frac {-\frac {2}{3 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {8}{16 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+16}-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}}{a d}\) | \(70\) |
default | \(\frac {-\frac {2}{3 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {1}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {8}{16 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+16}-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}}{a d}\) | \(70\) |
risch | \(\frac {2 i {\mathrm e}^{2 i \left (d x +c \right )}+2 \,{\mathrm e}^{3 i \left (d x +c \right )}+\frac {2 i}{3}-\frac {2 \,{\mathrm e}^{i \left (d x +c \right )}}{3}}{\left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{3} d a}\) | \(74\) |
Input:
int(tan(d*x+c)^2/(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)
Output:
8/d/a*(-1/12/(tan(1/2*d*x+1/2*c)+1)^3+1/8/(tan(1/2*d*x+1/2*c)+1)^2+1/16/(t an(1/2*d*x+1/2*c)+1)-1/16/(tan(1/2*d*x+1/2*c)-1))
Time = 0.13 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.94 \[ \int \frac {\tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\cos \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1}{3 \, {\left (a d \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a d \cos \left (d x + c\right )\right )}} \] Input:
integrate(tan(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="fricas")
Output:
1/3*(cos(d*x + c)^2 + 2*sin(d*x + c) + 1)/(a*d*cos(d*x + c)*sin(d*x + c) + a*d*cos(d*x + c))
\[ \int \frac {\tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\int \frac {\tan ^{2}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \] Input:
integrate(tan(d*x+c)**2/(a+a*sin(d*x+c)),x)
Output:
Integral(tan(c + d*x)**2/(sin(c + d*x) + 1), x)/a
Time = 0.04 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.80 \[ \int \frac {\tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {4 \, {\left (\frac {2 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}}{3 \, {\left (a + \frac {2 \, a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {2 \, a \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}\right )} d} \] Input:
integrate(tan(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="maxima")
Output:
4/3*(2*sin(d*x + c)/(cos(d*x + c) + 1) + 1)/((a + 2*a*sin(d*x + c)/(cos(d* x + c) + 1) - 2*a*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 - a*sin(d*x + c)^4/( cos(d*x + c) + 1)^4)*d)
Time = 0.19 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.36 \[ \int \frac {\tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\frac {3}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}} - \frac {3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}^{3}}}{6 \, d} \] Input:
integrate(tan(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="giac")
Output:
-1/6*(3/(a*(tan(1/2*d*x + 1/2*c) - 1)) - (3*tan(1/2*d*x + 1/2*c)^2 + 12*ta n(1/2*d*x + 1/2*c) + 5)/(a*(tan(1/2*d*x + 1/2*c) + 1)^3))/d
Time = 17.39 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.94 \[ \int \frac {\tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {4\,\left (2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )}{3\,a\,d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,{\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )}^3} \] Input:
int(tan(c + d*x)^2/(a + a*sin(c + d*x)),x)
Output:
-(4*(2*tan(c/2 + (d*x)/2) + 1))/(3*a*d*(tan(c/2 + (d*x)/2) - 1)*(tan(c/2 + (d*x)/2) + 1)^3)
Time = 0.16 (sec) , antiderivative size = 102, normalized size of antiderivative = 2.04 \[ \int \frac {\tan ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {3 \cos \left (d x +c \right ) \sin \left (d x +c \right ) \tan \left (d x +c \right )-\cos \left (d x +c \right ) \sin \left (d x +c \right )+3 \cos \left (d x +c \right ) \tan \left (d x +c \right )-\cos \left (d x +c \right )-4 \sin \left (d x +c \right )^{2}-\sin \left (d x +c \right )+2}{3 \cos \left (d x +c \right ) a d \left (\sin \left (d x +c \right )+1\right )} \] Input:
int(tan(d*x+c)^2/(a+a*sin(d*x+c)),x)
Output:
(3*cos(c + d*x)*sin(c + d*x)*tan(c + d*x) - cos(c + d*x)*sin(c + d*x) + 3* cos(c + d*x)*tan(c + d*x) - cos(c + d*x) - 4*sin(c + d*x)**2 - sin(c + d*x ) + 2)/(3*cos(c + d*x)*a*d*(sin(c + d*x) + 1))