Integrand size = 16, antiderivative size = 81 \[ \int \frac {\sin ^2(a+b x)}{(c+d x)^2} \, dx=\frac {b \operatorname {CosIntegral}\left (\frac {2 b c}{d}+2 b x\right ) \sin \left (2 a-\frac {2 b c}{d}\right )}{d^2}-\frac {\sin ^2(a+b x)}{d (c+d x)}+\frac {b \cos \left (2 a-\frac {2 b c}{d}\right ) \text {Si}\left (\frac {2 b c}{d}+2 b x\right )}{d^2} \] Output:
b*Ci(2*b*c/d+2*b*x)*sin(2*a-2*b*c/d)/d^2-sin(b*x+a)^2/d/(d*x+c)+b*cos(2*a- 2*b*c/d)*Si(2*b*c/d+2*b*x)/d^2
Time = 0.47 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.93 \[ \int \frac {\sin ^2(a+b x)}{(c+d x)^2} \, dx=\frac {b \operatorname {CosIntegral}\left (\frac {2 b (c+d x)}{d}\right ) \sin \left (2 a-\frac {2 b c}{d}\right )-\frac {d \sin ^2(a+b x)}{c+d x}+b \cos \left (2 a-\frac {2 b c}{d}\right ) \text {Si}\left (\frac {2 b (c+d x)}{d}\right )}{d^2} \] Input:
Integrate[Sin[a + b*x]^2/(c + d*x)^2,x]
Output:
(b*CosIntegral[(2*b*(c + d*x))/d]*Sin[2*a - (2*b*c)/d] - (d*Sin[a + b*x]^2 )/(c + d*x) + b*Cos[2*a - (2*b*c)/d]*SinIntegral[(2*b*(c + d*x))/d])/d^2
Time = 0.52 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.05, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3042, 3794, 27, 3042, 3784, 3042, 3780, 3783}
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(a+b x)}{(c+d x)^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (a+b x)^2}{(c+d x)^2}dx\) |
\(\Big \downarrow \) 3794 |
\(\displaystyle \frac {2 b \int \frac {\sin (2 a+2 b x)}{2 (c+d x)}dx}{d}-\frac {\sin ^2(a+b x)}{d (c+d x)}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {b \int \frac {\sin (2 a+2 b x)}{c+d x}dx}{d}-\frac {\sin ^2(a+b x)}{d (c+d x)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {b \int \frac {\sin (2 a+2 b x)}{c+d x}dx}{d}-\frac {\sin ^2(a+b x)}{d (c+d x)}\) |
\(\Big \downarrow \) 3784 |
\(\displaystyle \frac {b \left (\sin \left (2 a-\frac {2 b c}{d}\right ) \int \frac {\cos \left (\frac {2 b c}{d}+2 b x\right )}{c+d x}dx+\cos \left (2 a-\frac {2 b c}{d}\right ) \int \frac {\sin \left (\frac {2 b c}{d}+2 b x\right )}{c+d x}dx\right )}{d}-\frac {\sin ^2(a+b x)}{d (c+d x)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {b \left (\sin \left (2 a-\frac {2 b c}{d}\right ) \int \frac {\sin \left (\frac {2 b c}{d}+2 b x+\frac {\pi }{2}\right )}{c+d x}dx+\cos \left (2 a-\frac {2 b c}{d}\right ) \int \frac {\sin \left (\frac {2 b c}{d}+2 b x\right )}{c+d x}dx\right )}{d}-\frac {\sin ^2(a+b x)}{d (c+d x)}\) |
\(\Big \downarrow \) 3780 |
\(\displaystyle \frac {b \left (\sin \left (2 a-\frac {2 b c}{d}\right ) \int \frac {\sin \left (\frac {2 b c}{d}+2 b x+\frac {\pi }{2}\right )}{c+d x}dx+\frac {\cos \left (2 a-\frac {2 b c}{d}\right ) \text {Si}\left (\frac {2 b c}{d}+2 b x\right )}{d}\right )}{d}-\frac {\sin ^2(a+b x)}{d (c+d x)}\) |
\(\Big \downarrow \) 3783 |
\(\displaystyle \frac {b \left (\frac {\sin \left (2 a-\frac {2 b c}{d}\right ) \operatorname {CosIntegral}\left (\frac {2 b c}{d}+2 b x\right )}{d}+\frac {\cos \left (2 a-\frac {2 b c}{d}\right ) \text {Si}\left (\frac {2 b c}{d}+2 b x\right )}{d}\right )}{d}-\frac {\sin ^2(a+b x)}{d (c+d x)}\) |
Input:
Int[Sin[a + b*x]^2/(c + d*x)^2,x]
Output:
-(Sin[a + b*x]^2/(d*(c + d*x))) + (b*((CosIntegral[(2*b*c)/d + 2*b*x]*Sin[ 2*a - (2*b*c)/d])/d + (Cos[2*a - (2*b*c)/d]*SinIntegral[(2*b*c)/d + 2*b*x] )/d))/d
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinInte gral[e + f*x]/d, x] /; FreeQ[{c, d, e, f}, x] && EqQ[d*e - c*f, 0]
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosInte gral[e - Pi/2 + f*x]/d, x] /; FreeQ[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[Cos[(d* e - c*f)/d] Int[Sin[c*(f/d) + f*x]/(c + d*x), x], x] + Simp[Sin[(d*e - c* f)/d] Int[Cos[c*(f/d) + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f}, x] && NeQ[d*e - c*f, 0]
Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)]^(n_), x_Symbol] :> Si mp[(c + d*x)^(m + 1)*(Sin[e + f*x]^n/(d*(m + 1))), x] - Simp[f*(n/(d*(m + 1 ))) Int[ExpandTrigReduce[(c + d*x)^(m + 1), Cos[e + f*x]*Sin[e + f*x]^(n - 1), x], x], x] /; FreeQ[{c, d, e, f, m}, x] && IGtQ[n, 1] && GeQ[m, -2] & & LtQ[m, -1]
Result contains complex when optimal does not.
Time = 1.05 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.91
method | result | size |
risch | \(-\frac {i b \,{\mathrm e}^{-\frac {2 i \left (a d -b c \right )}{d}} \operatorname {expIntegral}_{1}\left (2 i b x +2 i a -\frac {2 i \left (a d -b c \right )}{d}\right )}{2 d^{2}}+\frac {i b \,{\mathrm e}^{\frac {2 i \left (a d -b c \right )}{d}} \operatorname {expIntegral}_{1}\left (-2 i b x -2 i a -\frac {2 \left (-i a d +i b c \right )}{d}\right )}{2 d^{2}}-\frac {1}{2 d \left (d x +c \right )}+\frac {\left (-2 d x b -2 b c \right ) \cos \left (2 b x +2 a \right )}{4 d \left (-d x b -b c \right ) \left (d x +c \right )}\) | \(155\) |
derivativedivides | \(\frac {-\frac {b^{2}}{2 \left (-a d +b c +d \left (b x +a \right )\right ) d}-\frac {b^{2} \left (-\frac {2 \cos \left (2 b x +2 a \right )}{\left (-a d +b c +d \left (b x +a \right )\right ) d}-\frac {2 \left (-\frac {2 \,\operatorname {Si}\left (-2 b x -2 a -\frac {2 \left (-a d +b c \right )}{d}\right ) \cos \left (\frac {-2 a d +2 b c}{d}\right )}{d}-\frac {2 \,\operatorname {Ci}\left (2 b x +2 a +\frac {-2 a d +2 b c}{d}\right ) \sin \left (\frac {-2 a d +2 b c}{d}\right )}{d}\right )}{d}\right )}{4}}{b}\) | \(156\) |
default | \(\frac {-\frac {b^{2}}{2 \left (-a d +b c +d \left (b x +a \right )\right ) d}-\frac {b^{2} \left (-\frac {2 \cos \left (2 b x +2 a \right )}{\left (-a d +b c +d \left (b x +a \right )\right ) d}-\frac {2 \left (-\frac {2 \,\operatorname {Si}\left (-2 b x -2 a -\frac {2 \left (-a d +b c \right )}{d}\right ) \cos \left (\frac {-2 a d +2 b c}{d}\right )}{d}-\frac {2 \,\operatorname {Ci}\left (2 b x +2 a +\frac {-2 a d +2 b c}{d}\right ) \sin \left (\frac {-2 a d +2 b c}{d}\right )}{d}\right )}{d}\right )}{4}}{b}\) | \(156\) |
Input:
int(sin(b*x+a)^2/(d*x+c)^2,x,method=_RETURNVERBOSE)
Output:
-1/2*I*b/d^2*exp(-2*I*(a*d-b*c)/d)*Ei(1,2*I*b*x+2*I*a-2*I*(a*d-b*c)/d)+1/2 *I*b/d^2*exp(2*I*(a*d-b*c)/d)*Ei(1,-2*I*b*x-2*I*a-2*(-I*a*d+I*b*c)/d)-1/2/ d/(d*x+c)+1/4/d*(-2*b*d*x-2*b*c)/(-b*d*x-b*c)/(d*x+c)*cos(2*b*x+2*a)
Time = 0.08 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.26 \[ \int \frac {\sin ^2(a+b x)}{(c+d x)^2} \, dx=\frac {d \cos \left (b x + a\right )^{2} + {\left (b d x + b c\right )} \operatorname {Ci}\left (\frac {2 \, {\left (b d x + b c\right )}}{d}\right ) \sin \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) + {\left (b d x + b c\right )} \cos \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) \operatorname {Si}\left (\frac {2 \, {\left (b d x + b c\right )}}{d}\right ) - d}{d^{3} x + c d^{2}} \] Input:
integrate(sin(b*x+a)^2/(d*x+c)^2,x, algorithm="fricas")
Output:
(d*cos(b*x + a)^2 + (b*d*x + b*c)*cos_integral(2*(b*d*x + b*c)/d)*sin(-2*( b*c - a*d)/d) + (b*d*x + b*c)*cos(-2*(b*c - a*d)/d)*sin_integral(2*(b*d*x + b*c)/d) - d)/(d^3*x + c*d^2)
\[ \int \frac {\sin ^2(a+b x)}{(c+d x)^2} \, dx=\int \frac {\sin ^{2}{\left (a + b x \right )}}{\left (c + d x\right )^{2}}\, dx \] Input:
integrate(sin(b*x+a)**2/(d*x+c)**2,x)
Output:
Integral(sin(a + b*x)**2/(c + d*x)**2, x)
Result contains complex when optimal does not.
Time = 0.11 (sec) , antiderivative size = 171, normalized size of antiderivative = 2.11 \[ \int \frac {\sin ^2(a+b x)}{(c+d x)^2} \, dx=\frac {b^{2} {\left (E_{2}\left (\frac {2 \, {\left (-i \, b c - i \, {\left (b x + a\right )} d + i \, a d\right )}}{d}\right ) + E_{2}\left (-\frac {2 \, {\left (-i \, b c - i \, {\left (b x + a\right )} d + i \, a d\right )}}{d}\right )\right )} \cos \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) + b^{2} {\left (i \, E_{2}\left (\frac {2 \, {\left (-i \, b c - i \, {\left (b x + a\right )} d + i \, a d\right )}}{d}\right ) - i \, E_{2}\left (-\frac {2 \, {\left (-i \, b c - i \, {\left (b x + a\right )} d + i \, a d\right )}}{d}\right )\right )} \sin \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) - 2 \, b^{2}}{4 \, {\left (b c d + {\left (b x + a\right )} d^{2} - a d^{2}\right )} b} \] Input:
integrate(sin(b*x+a)^2/(d*x+c)^2,x, algorithm="maxima")
Output:
1/4*(b^2*(exp_integral_e(2, 2*(-I*b*c - I*(b*x + a)*d + I*a*d)/d) + exp_in tegral_e(2, -2*(-I*b*c - I*(b*x + a)*d + I*a*d)/d))*cos(-2*(b*c - a*d)/d) + b^2*(I*exp_integral_e(2, 2*(-I*b*c - I*(b*x + a)*d + I*a*d)/d) - I*exp_i ntegral_e(2, -2*(-I*b*c - I*(b*x + a)*d + I*a*d)/d))*sin(-2*(b*c - a*d)/d) - 2*b^2)/((b*c*d + (b*x + a)*d^2 - a*d^2)*b)
Leaf count of result is larger than twice the leaf count of optimal. 535 vs. \(2 (81) = 162\).
Time = 0.39 (sec) , antiderivative size = 535, normalized size of antiderivative = 6.60 \[ \int \frac {\sin ^2(a+b x)}{(c+d x)^2} \, dx=\frac {{\left (2 \, {\left (d x + c\right )} {\left (b - \frac {b c}{d x + c} + \frac {a d}{d x + c}\right )} b^{2} \operatorname {Ci}\left (\frac {2 \, {\left ({\left (d x + c\right )} {\left (b - \frac {b c}{d x + c} + \frac {a d}{d x + c}\right )} + b c - a d\right )}}{d}\right ) \sin \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) + 2 \, b^{3} c \operatorname {Ci}\left (\frac {2 \, {\left ({\left (d x + c\right )} {\left (b - \frac {b c}{d x + c} + \frac {a d}{d x + c}\right )} + b c - a d\right )}}{d}\right ) \sin \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) - 2 \, a b^{2} d \operatorname {Ci}\left (\frac {2 \, {\left ({\left (d x + c\right )} {\left (b - \frac {b c}{d x + c} + \frac {a d}{d x + c}\right )} + b c - a d\right )}}{d}\right ) \sin \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) - 2 \, {\left (d x + c\right )} {\left (b - \frac {b c}{d x + c} + \frac {a d}{d x + c}\right )} b^{2} \cos \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) \operatorname {Si}\left (-\frac {2 \, {\left ({\left (d x + c\right )} {\left (b - \frac {b c}{d x + c} + \frac {a d}{d x + c}\right )} + b c - a d\right )}}{d}\right ) - 2 \, b^{3} c \cos \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) \operatorname {Si}\left (-\frac {2 \, {\left ({\left (d x + c\right )} {\left (b - \frac {b c}{d x + c} + \frac {a d}{d x + c}\right )} + b c - a d\right )}}{d}\right ) + 2 \, a b^{2} d \cos \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) \operatorname {Si}\left (-\frac {2 \, {\left ({\left (d x + c\right )} {\left (b - \frac {b c}{d x + c} + \frac {a d}{d x + c}\right )} + b c - a d\right )}}{d}\right ) + b^{2} d \cos \left (-\frac {2 \, {\left (d x + c\right )} {\left (b - \frac {b c}{d x + c} + \frac {a d}{d x + c}\right )}}{d}\right ) - b^{2} d\right )} d^{2}}{2 \, {\left ({\left (d x + c\right )} {\left (b - \frac {b c}{d x + c} + \frac {a d}{d x + c}\right )} d^{4} + b c d^{4} - a d^{5}\right )} b} \] Input:
integrate(sin(b*x+a)^2/(d*x+c)^2,x, algorithm="giac")
Output:
1/2*(2*(d*x + c)*(b - b*c/(d*x + c) + a*d/(d*x + c))*b^2*cos_integral(2*(( d*x + c)*(b - b*c/(d*x + c) + a*d/(d*x + c)) + b*c - a*d)/d)*sin(-2*(b*c - a*d)/d) + 2*b^3*c*cos_integral(2*((d*x + c)*(b - b*c/(d*x + c) + a*d/(d*x + c)) + b*c - a*d)/d)*sin(-2*(b*c - a*d)/d) - 2*a*b^2*d*cos_integral(2*(( d*x + c)*(b - b*c/(d*x + c) + a*d/(d*x + c)) + b*c - a*d)/d)*sin(-2*(b*c - a*d)/d) - 2*(d*x + c)*(b - b*c/(d*x + c) + a*d/(d*x + c))*b^2*cos(-2*(b*c - a*d)/d)*sin_integral(-2*((d*x + c)*(b - b*c/(d*x + c) + a*d/(d*x + c)) + b*c - a*d)/d) - 2*b^3*c*cos(-2*(b*c - a*d)/d)*sin_integral(-2*((d*x + c) *(b - b*c/(d*x + c) + a*d/(d*x + c)) + b*c - a*d)/d) + 2*a*b^2*d*cos(-2*(b *c - a*d)/d)*sin_integral(-2*((d*x + c)*(b - b*c/(d*x + c) + a*d/(d*x + c) ) + b*c - a*d)/d) + b^2*d*cos(-2*(d*x + c)*(b - b*c/(d*x + c) + a*d/(d*x + c))/d) - b^2*d)*d^2/(((d*x + c)*(b - b*c/(d*x + c) + a*d/(d*x + c))*d^4 + b*c*d^4 - a*d^5)*b)
Timed out. \[ \int \frac {\sin ^2(a+b x)}{(c+d x)^2} \, dx=\int \frac {{\sin \left (a+b\,x\right )}^2}{{\left (c+d\,x\right )}^2} \,d x \] Input:
int(sin(a + b*x)^2/(c + d*x)^2,x)
Output:
int(sin(a + b*x)^2/(c + d*x)^2, x)
\[ \int \frac {\sin ^2(a+b x)}{(c+d x)^2} \, dx=\int \frac {\sin \left (b x +a \right )^{2}}{d^{2} x^{2}+2 c d x +c^{2}}d x \] Input:
int(sin(b*x+a)^2/(d*x+c)^2,x)
Output:
int(sin(a + b*x)**2/(c**2 + 2*c*d*x + d**2*x**2),x)