Integrand size = 21, antiderivative size = 94 \[ \int \frac {\sin ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {a \left (a^2-b^2\right ) x}{2 \left (a^2+b^2\right )^2}+\frac {a^2 b \log (a \cos (c+d x)+b \sin (c+d x))}{\left (a^2+b^2\right )^2 d}-\frac {\cos ^2(c+d x) (b+a \tan (c+d x))}{2 \left (a^2+b^2\right ) d} \] Output:
1/2*a*(a^2-b^2)*x/(a^2+b^2)^2+a^2*b*ln(a*cos(d*x+c)+b*sin(d*x+c))/(a^2+b^2 )^2/d-1/2*cos(d*x+c)^2*(b+a*tan(d*x+c))/(a^2+b^2)/d
Time = 0.72 (sec) , antiderivative size = 170, normalized size of antiderivative = 1.81 \[ \int \frac {\sin ^2(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {2 a b \left (a^2+b^2\right ) \arctan (\tan (c+d x))+2 b^2 \left (a^2+b^2\right ) \cos ^2(c+d x)+a \left (2 a \left (\left (b^2+a \sqrt {-b^2}\right ) \log \left (\sqrt {-b^2}-b \tan (c+d x)\right )-2 b^2 \log (a+b \tan (c+d x))+\left (b^2-a \sqrt {-b^2}\right ) \log \left (\sqrt {-b^2}+b \tan (c+d x)\right )\right )+b \left (a^2+b^2\right ) \sin (2 (c+d x))\right )}{4 b \left (a^2+b^2\right )^2 d} \] Input:
Integrate[Sin[c + d*x]^2/(a + b*Tan[c + d*x]),x]
Output:
-1/4*(2*a*b*(a^2 + b^2)*ArcTan[Tan[c + d*x]] + 2*b^2*(a^2 + b^2)*Cos[c + d *x]^2 + a*(2*a*((b^2 + a*Sqrt[-b^2])*Log[Sqrt[-b^2] - b*Tan[c + d*x]] - 2* b^2*Log[a + b*Tan[c + d*x]] + (b^2 - a*Sqrt[-b^2])*Log[Sqrt[-b^2] + b*Tan[ c + d*x]]) + b*(a^2 + b^2)*Sin[2*(c + d*x)]))/(b*(a^2 + b^2)^2*d)
Time = 0.38 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.55, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 3999, 601, 25, 27, 657, 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 {\sin ^2(c+d x)}{a+b \tan (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (c+d x)^2}{a+b \tan (c+d x)}dx\) |
\(\Big \downarrow \) 3999 |
\(\displaystyle \frac {b \int \frac {b^2 \tan ^2(c+d x)}{(a+b \tan (c+d x)) \left (\tan ^2(c+d x) b^2+b^2\right )^2}d(b \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 601 |
\(\displaystyle \frac {b \left (-\frac {\int -\frac {a b^2 (a-b \tan (c+d x))}{\left (a^2+b^2\right ) (a+b \tan (c+d x)) \left (\tan ^2(c+d x) b^2+b^2\right )}d(b \tan (c+d x))}{2 b^2}-\frac {a b \tan (c+d x)+b^2}{2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {b \left (\frac {\int \frac {a b^2 (a-b \tan (c+d x))}{\left (a^2+b^2\right ) (a+b \tan (c+d x)) \left (\tan ^2(c+d x) b^2+b^2\right )}d(b \tan (c+d x))}{2 b^2}-\frac {a b \tan (c+d x)+b^2}{2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {b \left (\frac {a \int \frac {a-b \tan (c+d x)}{(a+b \tan (c+d x)) \left (\tan ^2(c+d x) b^2+b^2\right )}d(b \tan (c+d x))}{2 \left (a^2+b^2\right )}-\frac {a b \tan (c+d x)+b^2}{2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 657 |
\(\displaystyle \frac {b \left (\frac {a \int \left (\frac {2 a}{\left (a^2+b^2\right ) (a+b \tan (c+d x))}+\frac {a^2-2 b \tan (c+d x) a-b^2}{\left (a^2+b^2\right ) \left (\tan ^2(c+d x) b^2+b^2\right )}\right )d(b \tan (c+d x))}{2 \left (a^2+b^2\right )}-\frac {a b \tan (c+d x)+b^2}{2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {b \left (\frac {a \left (\frac {\left (a^2-b^2\right ) \arctan (\tan (c+d x))}{b \left (a^2+b^2\right )}-\frac {a \log \left (b^2 \tan ^2(c+d x)+b^2\right )}{a^2+b^2}+\frac {2 a \log (a+b \tan (c+d x))}{a^2+b^2}\right )}{2 \left (a^2+b^2\right )}-\frac {a b \tan (c+d x)+b^2}{2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
Input:
Int[Sin[c + d*x]^2/(a + b*Tan[c + d*x]),x]
Output:
(b*((a*(((a^2 - b^2)*ArcTan[Tan[c + d*x]])/(b*(a^2 + b^2)) + (2*a*Log[a + b*Tan[c + d*x]])/(a^2 + b^2) - (a*Log[b^2 + b^2*Tan[c + d*x]^2])/(a^2 + b^ 2)))/(2*(a^2 + b^2)) - (b^2 + a*b*Tan[c + d*x])/(2*(a^2 + b^2)*(b^2 + b^2* Tan[c + d*x]^2))))/d
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[(x_)^(m_)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbo l] :> With[{Qx = PolynomialQuotient[x^m*(c + d*x)^n, a + b*x^2, x], e = Coe ff[PolynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 0], f = Coeff[Pol ynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 1]}, Simp[(a*f - b*e*x) *((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] + Simp[1/(2*a*(p + 1)) Int[(c + d*x)^n*(a + b*x^2)^(p + 1)*ExpandToSum[(2*a*(p + 1)*Qx)/(c + d*x)^n + (e* (2*p + 3))/(c + d*x)^n, x], x], x]] /; FreeQ[{a, b, c, d}, x] && IGtQ[m, 1] && LtQ[p, -1] && ILtQ[n, 0] && NeQ[b*c^2 + a*d^2, 0]
Int[(((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.))/((a_) + (c_.)*( x_)^2), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*((f + g*x)^n/(a + c*x^ 2)), x], x] /; FreeQ[{a, c, d, e, f, g, m}, x] && IntegersQ[n]
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 = 1.96 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.30
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (-\frac {1}{2} a^{3}-\frac {1}{2} a \,b^{2}\right ) \tan \left (d x +c \right )-\frac {a^{2} b}{2}-\frac {b^{3}}{2}}{1+\tan \left (d x +c \right )^{2}}+\frac {a \left (-a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )+\left (a^{2}-b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )\right )}{2}}{\left (a^{2}+b^{2}\right )^{2}}+\frac {a^{2} b \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right )^{2}}}{d}\) | \(122\) |
default | \(\frac {\frac {\frac {\left (-\frac {1}{2} a^{3}-\frac {1}{2} a \,b^{2}\right ) \tan \left (d x +c \right )-\frac {a^{2} b}{2}-\frac {b^{3}}{2}}{1+\tan \left (d x +c \right )^{2}}+\frac {a \left (-a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )+\left (a^{2}-b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )\right )}{2}}{\left (a^{2}+b^{2}\right )^{2}}+\frac {a^{2} b \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right )^{2}}}{d}\) | \(122\) |
risch | \(-\frac {a x}{2 \left (2 i a b -a^{2}+b^{2}\right )}+\frac {i {\mathrm e}^{2 i \left (d x +c \right )}}{8 \left (-i b +a \right ) d}-\frac {i {\mathrm e}^{-2 i \left (d x +c \right )}}{8 \left (i b +a \right ) d}-\frac {2 i a^{2} b x}{a^{4}+2 b^{2} a^{2}+b^{4}}-\frac {2 i a^{2} b c}{d \left (a^{4}+2 b^{2} a^{2}+b^{4}\right )}+\frac {a^{2} b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{d \left (a^{4}+2 b^{2} a^{2}+b^{4}\right )}\) | \(175\) |
Input:
int(sin(d*x+c)^2/(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)
Output:
1/d*(1/(a^2+b^2)^2*(((-1/2*a^3-1/2*a*b^2)*tan(d*x+c)-1/2*a^2*b-1/2*b^3)/(1 +tan(d*x+c)^2)+1/2*a*(-a*b*ln(1+tan(d*x+c)^2)+(a^2-b^2)*arctan(tan(d*x+c)) ))+a^2*b/(a^2+b^2)^2*ln(a+b*tan(d*x+c)))
Time = 0.11 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.30 \[ \int \frac {\sin ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {a^{2} b \log \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 ) + {\left (a^{3} - a b^{2}\right )} d x - {\left (a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} - {\left (a^{3} + a b^{2}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d} \] Input:
integrate(sin(d*x+c)^2/(a+b*tan(d*x+c)),x, algorithm="fricas")
Output:
1/2*(a^2*b*log(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^ 2 + b^2) + (a^3 - a*b^2)*d*x - (a^2*b + b^3)*cos(d*x + c)^2 - (a^3 + a*b^2 )*cos(d*x + c)*sin(d*x + c))/((a^4 + 2*a^2*b^2 + b^4)*d)
\[ \int \frac {\sin ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\int \frac {\sin ^{2}{\left (c + d x \right )}}{a + b \tan {\left (c + d x \right )}}\, dx \] Input:
integrate(sin(d*x+c)**2/(a+b*tan(d*x+c)),x)
Output:
Integral(sin(c + d*x)**2/(a + b*tan(c + d*x)), x)
Time = 0.12 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.53 \[ \int \frac {\sin ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {2 \, a^{2} b \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {a^{2} b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} + \frac {{\left (a^{3} - a b^{2}\right )} {\left (d x + c\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {a \tan \left (d x + c\right ) + b}{{\left (a^{2} + b^{2}\right )} \tan \left (d x + c\right )^{2} + a^{2} + b^{2}}}{2 \, d} \] Input:
integrate(sin(d*x+c)^2/(a+b*tan(d*x+c)),x, algorithm="maxima")
Output:
1/2*(2*a^2*b*log(b*tan(d*x + c) + a)/(a^4 + 2*a^2*b^2 + b^4) - a^2*b*log(t an(d*x + c)^2 + 1)/(a^4 + 2*a^2*b^2 + b^4) + (a^3 - a*b^2)*(d*x + c)/(a^4 + 2*a^2*b^2 + b^4) - (a*tan(d*x + c) + b)/((a^2 + b^2)*tan(d*x + c)^2 + a^ 2 + b^2))/d
Time = 0.15 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.83 \[ \int \frac {\sin ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {a^{2} b^{2} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{4} b d + 2 \, a^{2} b^{3} d + b^{5} d} - \frac {a^{2} b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, {\left (a^{4} d + 2 \, a^{2} b^{2} d + b^{4} d\right )}} + \frac {{\left (a^{3} - a b^{2}\right )} {\left (d x + c\right )}}{2 \, {\left (a^{4} d + 2 \, a^{2} b^{2} d + b^{4} d\right )}} - \frac {a^{2} b + b^{3} + {\left (a^{3} + a b^{2}\right )} \tan \left (d x + c\right )}{2 \, {\left (a^{2} + b^{2}\right )}^{2} {\left (\tan \left (d x + c\right )^{2} + 1\right )} d} \] Input:
integrate(sin(d*x+c)^2/(a+b*tan(d*x+c)),x, algorithm="giac")
Output:
a^2*b^2*log(abs(b*tan(d*x + c) + a))/(a^4*b*d + 2*a^2*b^3*d + b^5*d) - 1/2 *a^2*b*log(tan(d*x + c)^2 + 1)/(a^4*d + 2*a^2*b^2*d + b^4*d) + 1/2*(a^3 - a*b^2)*(d*x + c)/(a^4*d + 2*a^2*b^2*d + b^4*d) - 1/2*(a^2*b + b^3 + (a^3 + a*b^2)*tan(d*x + c))/((a^2 + b^2)^2*(tan(d*x + c)^2 + 1)*d)
Time = 1.03 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.56 \[ \int \frac {\sin ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {a^2\,b\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}{d\,{\left (a^2+b^2\right )}^2}-\frac {a\,\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}{4\,d\,\left (-a^2\,1{}\mathrm {i}+2\,a\,b+b^2\,1{}\mathrm {i}\right )}-\frac {{\cos \left (c+d\,x\right )}^2\,\left (\frac {b}{2\,\left (a^2+b^2\right )}+\frac {a\,\mathrm {tan}\left (c+d\,x\right )}{2\,\left (a^2+b^2\right )}\right )}{d}-\frac {a\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4\,d\,\left (-a^2+a\,b\,2{}\mathrm {i}+b^2\right )} \] Input:
int(sin(c + d*x)^2/(a + b*tan(c + d*x)),x)
Output:
(a^2*b*log(a + b*tan(c + d*x)))/(d*(a^2 + b^2)^2) - (a*log(tan(c + d*x) + 1i)*1i)/(4*d*(a*b*2i - a^2 + b^2)) - (a*log(tan(c + d*x) - 1i))/(4*d*(2*a* b - a^2*1i + b^2*1i)) - (cos(c + d*x)^2*(b/(2*(a^2 + b^2)) + (a*tan(c + d* x))/(2*(a^2 + b^2))))/d
Time = 0.21 (sec) , antiderivative size = 176, normalized size of antiderivative = 1.87 \[ \int \frac {\sin ^2(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {-\cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{3}-\cos \left (d x +c \right ) \sin \left (d x +c \right ) a \,b^{2}-2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) a^{2} b +2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b -a \right ) a^{2} b +\sin \left (d x +c \right )^{2} a^{2} b +\sin \left (d x +c \right )^{2} b^{3}+a^{3} c +a^{3} d x -2 a^{2} b -a \,b^{2} c -a \,b^{2} d x -2 b^{3}}{2 d \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )} \] Input:
int(sin(d*x+c)^2/(a+b*tan(d*x+c)),x)
Output:
( - cos(c + d*x)*sin(c + d*x)*a**3 - cos(c + d*x)*sin(c + d*x)*a*b**2 - 2* log(tan((c + d*x)/2)**2 + 1)*a**2*b + 2*log(tan((c + d*x)/2)**2*a - 2*tan( (c + d*x)/2)*b - a)*a**2*b + sin(c + d*x)**2*a**2*b + sin(c + d*x)**2*b**3 + a**3*c + a**3*d*x - 2*a**2*b - a*b**2*c - a*b**2*d*x - 2*b**3)/(2*d*(a* *4 + 2*a**2*b**2 + b**4))