Integrand size = 21, antiderivative size = 112 \[ \int \frac {(c+d x)^2}{a-a \sin (e+f x)} \, dx=-\frac {i (c+d x)^2}{a f}+\frac {4 d (c+d x) \log \left (1+i e^{i (e+f x)}\right )}{a f^2}-\frac {4 i d^2 \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{a f^3}+\frac {(c+d x)^2 \tan \left (\frac {e}{2}+\frac {\pi }{4}+\frac {f x}{2}\right )}{a f} \] Output:
-I*(d*x+c)^2/a/f+4*d*(d*x+c)*ln(1+I*exp(I*(f*x+e)))/a/f^2-4*I*d^2*polylog( 2,-I*exp(I*(f*x+e)))/a/f^3+(d*x+c)^2*tan(1/2*e+1/4*Pi+1/2*f*x)/a/f
Time = 0.81 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.82 \[ \int \frac {(c+d x)^2}{a-a \sin (e+f x)} \, dx=\frac {-4 i d^2 \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )+f (c+d x) \left (-i f (c+d x)+4 d \log \left (1+i e^{i (e+f x)}\right )+f (c+d x) \tan \left (\frac {1}{4} (2 e+\pi +2 f x)\right )\right )}{a f^3} \] Input:
Integrate[(c + d*x)^2/(a - a*Sin[e + f*x]),x]
Output:
((-4*I)*d^2*PolyLog[2, (-I)*E^(I*(e + f*x))] + f*(c + d*x)*((-I)*f*(c + d* x) + 4*d*Log[1 + I*E^(I*(e + f*x))] + f*(c + d*x)*Tan[(2*e + Pi + 2*f*x)/4 ]))/(a*f^3)
Time = 0.63 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.04, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.524, Rules used = {3042, 3799, 3042, 4672, 25, 3042, 4200, 26, 2620, 2715, 2838}
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 {(c+d x)^2}{a-a \sin (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(c+d x)^2}{a-a \sin (e+f x)}dx\) |
\(\Big \downarrow \) 3799 |
\(\displaystyle \frac {\int (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )dx}{2 a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int (c+d x)^2 \csc \left (\frac {e}{2}+\frac {f x}{2}+\frac {3 \pi }{4}\right )^2dx}{2 a}\) |
\(\Big \downarrow \) 4672 |
\(\displaystyle \frac {\frac {4 d \int -\left ((c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )\right )dx}{f}+\frac {2 (c+d x)^2 \tan \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )}{f}}{2 a}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\frac {2 (c+d x)^2 \tan \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )}{f}-\frac {4 d \int (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )dx}{f}}{2 a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {2 (c+d x)^2 \tan \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )}{f}-\frac {4 d \int (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )dx}{f}}{2 a}\) |
\(\Big \downarrow \) 4200 |
\(\displaystyle \frac {\frac {2 (c+d x)^2 \tan \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )}{f}-\frac {4 d \left (\frac {i (c+d x)^2}{2 d}-2 i \int \frac {i e^{i (e+f x)} (c+d x)}{1+i e^{i (e+f x)}}dx\right )}{f}}{2 a}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle \frac {\frac {2 (c+d x)^2 \tan \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )}{f}-\frac {4 d \left (2 \int \frac {e^{i (e+f x)} (c+d x)}{1+i e^{i (e+f x)}}dx+\frac {i (c+d x)^2}{2 d}\right )}{f}}{2 a}\) |
\(\Big \downarrow \) 2620 |
\(\displaystyle \frac {\frac {2 (c+d x)^2 \tan \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )}{f}-\frac {4 d \left (2 \left (\frac {d \int \log \left (1+i e^{i (e+f x)}\right )dx}{f}-\frac {(c+d x) \log \left (1+i e^{i (e+f x)}\right )}{f}\right )+\frac {i (c+d x)^2}{2 d}\right )}{f}}{2 a}\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle \frac {\frac {2 (c+d x)^2 \tan \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )}{f}-\frac {4 d \left (2 \left (-\frac {i d \int e^{-i (e+f x)} \log \left (1+i e^{i (e+f x)}\right )de^{i (e+f x)}}{f^2}-\frac {(c+d x) \log \left (1+i e^{i (e+f x)}\right )}{f}\right )+\frac {i (c+d x)^2}{2 d}\right )}{f}}{2 a}\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle \frac {\frac {2 (c+d x)^2 \tan \left (\frac {e}{2}+\frac {f x}{2}+\frac {\pi }{4}\right )}{f}-\frac {4 d \left (2 \left (\frac {i d \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{f^2}-\frac {(c+d x) \log \left (1+i e^{i (e+f x)}\right )}{f}\right )+\frac {i (c+d x)^2}{2 d}\right )}{f}}{2 a}\) |
Input:
Int[(c + d*x)^2/(a - a*Sin[e + f*x]),x]
Output:
((-4*d*(((I/2)*(c + d*x)^2)/d + 2*(-(((c + d*x)*Log[1 + I*E^(I*(e + f*x))] )/f) + (I*d*PolyLog[2, (-I)*E^(I*(e + f*x))])/f^2)))/f + (2*(c + d*x)^2*Ta n[e/2 + Pi/4 + (f*x)/2])/f)/(2*a)
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a]) I nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ ((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp [((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si mp[d*(m/(b*f*g*n*Log[F])) Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x )))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Simp[1/(d*e*n*Log[F]) Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) ))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 , (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.) , x_Symbol] :> Simp[(2*a)^n Int[(c + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2 - b^ 2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])
Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (f_.)*(x_)], x_Symbol ] :> Simp[I*((c + d*x)^(m + 1)/(d*(m + 1))), x] - Simp[2*I Int[(c + d*x)^ m*E^(2*I*k*Pi)*(E^(2*I*(e + f*x))/(1 + E^(2*I*k*Pi)*E^(2*I*(e + f*x)))), x] , x] /; FreeQ[{c, d, e, f}, x] && IntegerQ[4*k] && IGtQ[m, 0]
Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp [(-(c + d*x)^m)*(Cot[e + f*x]/f), x] + Simp[d*(m/f) Int[(c + d*x)^(m - 1) *Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 253 vs. \(2 (98 ) = 196\).
Time = 0.79 (sec) , antiderivative size = 254, normalized size of antiderivative = 2.27
method | result | size |
risch | \(\frac {2 x^{2} d^{2}+4 c d x +2 c^{2}}{f a \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}-\frac {4 \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right ) c d}{a \,f^{2}}+\frac {4 \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) c d}{a \,f^{2}}-\frac {2 i d^{2} x^{2}}{a f}-\frac {4 i d^{2} e x}{a \,f^{2}}-\frac {2 i d^{2} e^{2}}{a \,f^{3}}+\frac {4 d^{2} \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right ) x}{a \,f^{2}}+\frac {4 d^{2} \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right ) e}{a \,f^{3}}-\frac {4 i d^{2} \operatorname {polylog}\left (2, -i {\mathrm e}^{i \left (f x +e \right )}\right )}{a \,f^{3}}+\frac {4 e \,d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a \,f^{3}}-\frac {4 e \,d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{a \,f^{3}}\) | \(254\) |
Input:
int((d*x+c)^2/(a-a*sin(f*x+e)),x,method=_RETURNVERBOSE)
Output:
2*(d^2*x^2+2*c*d*x+c^2)/f/a/(exp(I*(f*x+e))-I)-4/a/f^2*ln(exp(I*(f*x+e)))* c*d+4/a/f^2*ln(exp(I*(f*x+e))-I)*c*d-2*I/a/f*d^2*x^2-4*I/a/f^2*d^2*e*x-2*I /a/f^3*d^2*e^2+4/a/f^2*d^2*ln(1+I*exp(I*(f*x+e)))*x+4/a/f^3*d^2*ln(1+I*exp (I*(f*x+e)))*e-4*I*d^2*polylog(2,-I*exp(I*(f*x+e)))/a/f^3+4/a/f^3*e*d^2*ln (exp(I*(f*x+e)))-4/a/f^3*e*d^2*ln(exp(I*(f*x+e))-I)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 496 vs. \(2 (93) = 186\).
Time = 0.09 (sec) , antiderivative size = 496, normalized size of antiderivative = 4.43 \[ \int \frac {(c+d x)^2}{a-a \sin (e+f x)} \, dx=\frac {d^{2} f^{2} x^{2} + 2 \, c d f^{2} x + c^{2} f^{2} + {\left (d^{2} f^{2} x^{2} + 2 \, c d f^{2} x + c^{2} f^{2}\right )} \cos \left (f x + e\right ) + 2 \, {\left (i \, d^{2} \cos \left (f x + e\right ) - i \, d^{2} \sin \left (f x + e\right ) + i \, d^{2}\right )} {\rm Li}_2\left (i \, \cos \left (f x + e\right ) + \sin \left (f x + e\right )\right ) + 2 \, {\left (-i \, d^{2} \cos \left (f x + e\right ) + i \, d^{2} \sin \left (f x + e\right ) - i \, d^{2}\right )} {\rm Li}_2\left (-i \, \cos \left (f x + e\right ) + \sin \left (f x + e\right )\right ) - 2 \, {\left (d^{2} e - c d f + {\left (d^{2} e - c d f\right )} \cos \left (f x + e\right ) - {\left (d^{2} e - c d f\right )} \sin \left (f x + e\right )\right )} \log \left (\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right ) + i\right ) + 2 \, {\left (d^{2} f x + d^{2} e + {\left (d^{2} f x + d^{2} e\right )} \cos \left (f x + e\right ) - {\left (d^{2} f x + d^{2} e\right )} \sin \left (f x + e\right )\right )} \log \left (i \, \cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (d^{2} f x + d^{2} e + {\left (d^{2} f x + d^{2} e\right )} \cos \left (f x + e\right ) - {\left (d^{2} f x + d^{2} e\right )} \sin \left (f x + e\right )\right )} \log \left (-i \, \cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right ) - 2 \, {\left (d^{2} e - c d f + {\left (d^{2} e - c d f\right )} \cos \left (f x + e\right ) - {\left (d^{2} e - c d f\right )} \sin \left (f x + e\right )\right )} \log \left (-\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right ) + i\right ) + {\left (d^{2} f^{2} x^{2} + 2 \, c d f^{2} x + c^{2} f^{2}\right )} \sin \left (f x + e\right )}{a f^{3} \cos \left (f x + e\right ) - a f^{3} \sin \left (f x + e\right ) + a f^{3}} \] Input:
integrate((d*x+c)^2/(a-a*sin(f*x+e)),x, algorithm="fricas")
Output:
(d^2*f^2*x^2 + 2*c*d*f^2*x + c^2*f^2 + (d^2*f^2*x^2 + 2*c*d*f^2*x + c^2*f^ 2)*cos(f*x + e) + 2*(I*d^2*cos(f*x + e) - I*d^2*sin(f*x + e) + I*d^2)*dilo g(I*cos(f*x + e) + sin(f*x + e)) + 2*(-I*d^2*cos(f*x + e) + I*d^2*sin(f*x + e) - I*d^2)*dilog(-I*cos(f*x + e) + sin(f*x + e)) - 2*(d^2*e - c*d*f + ( d^2*e - c*d*f)*cos(f*x + e) - (d^2*e - c*d*f)*sin(f*x + e))*log(cos(f*x + e) - I*sin(f*x + e) + I) + 2*(d^2*f*x + d^2*e + (d^2*f*x + d^2*e)*cos(f*x + e) - (d^2*f*x + d^2*e)*sin(f*x + e))*log(I*cos(f*x + e) - sin(f*x + e) + 1) + 2*(d^2*f*x + d^2*e + (d^2*f*x + d^2*e)*cos(f*x + e) - (d^2*f*x + d^2 *e)*sin(f*x + e))*log(-I*cos(f*x + e) - sin(f*x + e) + 1) - 2*(d^2*e - c*d *f + (d^2*e - c*d*f)*cos(f*x + e) - (d^2*e - c*d*f)*sin(f*x + e))*log(-cos (f*x + e) - I*sin(f*x + e) + I) + (d^2*f^2*x^2 + 2*c*d*f^2*x + c^2*f^2)*si n(f*x + e))/(a*f^3*cos(f*x + e) - a*f^3*sin(f*x + e) + a*f^3)
\[ \int \frac {(c+d x)^2}{a-a \sin (e+f x)} \, dx=- \frac {\int \frac {c^{2}}{\sin {\left (e + f x \right )} - 1}\, dx + \int \frac {d^{2} x^{2}}{\sin {\left (e + f x \right )} - 1}\, dx + \int \frac {2 c d x}{\sin {\left (e + f x \right )} - 1}\, dx}{a} \] Input:
integrate((d*x+c)**2/(a-a*sin(f*x+e)),x)
Output:
-(Integral(c**2/(sin(e + f*x) - 1), x) + Integral(d**2*x**2/(sin(e + f*x) - 1), x) + Integral(2*c*d*x/(sin(e + f*x) - 1), x))/a
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 311 vs. \(2 (93) = 186\).
Time = 0.13 (sec) , antiderivative size = 311, normalized size of antiderivative = 2.78 \[ \int \frac {(c+d x)^2}{a-a \sin (e+f x)} \, dx=-\frac {2 \, {\left (i \, c^{2} f^{2} - 2 \, {\left (c d f \cos \left (f x + e\right ) + i \, c d f \sin \left (f x + e\right ) - i \, c d f\right )} \arctan \left (\sin \left (f x + e\right ) - 1, \cos \left (f x + e\right )\right ) - 2 \, {\left (d^{2} f x \cos \left (f x + e\right ) + i \, d^{2} f x \sin \left (f x + e\right ) - i \, d^{2} f x\right )} \arctan \left (\cos \left (f x + e\right ), -\sin \left (f x + e\right ) + 1\right ) + {\left (d^{2} f^{2} x^{2} + 2 \, c d f^{2} x\right )} \cos \left (f x + e\right ) + 2 \, {\left (d^{2} \cos \left (f x + e\right ) + i \, d^{2} \sin \left (f x + e\right ) - i \, d^{2}\right )} {\rm Li}_2\left (-i \, e^{\left (i \, f x + i \, e\right )}\right ) + {\left (d^{2} f x + c d f + {\left (i \, d^{2} f x + i \, c d f\right )} \cos \left (f x + e\right ) - {\left (d^{2} f x + c d f\right )} \sin \left (f x + e\right )\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} - 2 \, \sin \left (f x + e\right ) + 1\right ) + {\left (i \, d^{2} f^{2} x^{2} + 2 i \, c d f^{2} x\right )} \sin \left (f x + e\right )\right )}}{-i \, a f^{3} \cos \left (f x + e\right ) + a f^{3} \sin \left (f x + e\right ) - a f^{3}} \] Input:
integrate((d*x+c)^2/(a-a*sin(f*x+e)),x, algorithm="maxima")
Output:
-2*(I*c^2*f^2 - 2*(c*d*f*cos(f*x + e) + I*c*d*f*sin(f*x + e) - I*c*d*f)*ar ctan2(sin(f*x + e) - 1, cos(f*x + e)) - 2*(d^2*f*x*cos(f*x + e) + I*d^2*f* x*sin(f*x + e) - I*d^2*f*x)*arctan2(cos(f*x + e), -sin(f*x + e) + 1) + (d^ 2*f^2*x^2 + 2*c*d*f^2*x)*cos(f*x + e) + 2*(d^2*cos(f*x + e) + I*d^2*sin(f* x + e) - I*d^2)*dilog(-I*e^(I*f*x + I*e)) + (d^2*f*x + c*d*f + (I*d^2*f*x + I*c*d*f)*cos(f*x + e) - (d^2*f*x + c*d*f)*sin(f*x + e))*log(cos(f*x + e) ^2 + sin(f*x + e)^2 - 2*sin(f*x + e) + 1) + (I*d^2*f^2*x^2 + 2*I*c*d*f^2*x )*sin(f*x + e))/(-I*a*f^3*cos(f*x + e) + a*f^3*sin(f*x + e) - a*f^3)
\[ \int \frac {(c+d x)^2}{a-a \sin (e+f x)} \, dx=\int { -\frac {{\left (d x + c\right )}^{2}}{a \sin \left (f x + e\right ) - a} \,d x } \] Input:
integrate((d*x+c)^2/(a-a*sin(f*x+e)),x, algorithm="giac")
Output:
integrate(-(d*x + c)^2/(a*sin(f*x + e) - a), x)
Timed out. \[ \int \frac {(c+d x)^2}{a-a \sin (e+f x)} \, dx=\int \frac {{\left (c+d\,x\right )}^2}{a-a\,\sin \left (e+f\,x\right )} \,d x \] Input:
int((c + d*x)^2/(a - a*sin(e + f*x)),x)
Output:
int((c + d*x)^2/(a - a*sin(e + f*x)), x)
\[ \int \frac {(c+d x)^2}{a-a \sin (e+f x)} \, dx=\frac {4 \left (\int \frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) x}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1}d x \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{2} f -4 \left (\int \frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) x}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1}d x \right ) d^{2} f -2 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c d +2 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+1\right ) c d +4 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c d -4 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) c d -2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c^{2} f -2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c d f x -2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{2} f \,x^{2}-2 c d f x}{a \,f^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )} \] Input:
int((d*x+c)^2/(a-a*sin(f*x+e)),x)
Output:
(2*(2*int((tan((e + f*x)/2)*x)/(tan((e + f*x)/2) - 1),x)*tan((e + f*x)/2)* d**2*f - 2*int((tan((e + f*x)/2)*x)/(tan((e + f*x)/2) - 1),x)*d**2*f - log (tan((e + f*x)/2)**2 + 1)*tan((e + f*x)/2)*c*d + log(tan((e + f*x)/2)**2 + 1)*c*d + 2*log(tan((e + f*x)/2) - 1)*tan((e + f*x)/2)*c*d - 2*log(tan((e + f*x)/2) - 1)*c*d - tan((e + f*x)/2)*c**2*f - tan((e + f*x)/2)*c*d*f*x - tan((e + f*x)/2)*d**2*f*x**2 - c*d*f*x))/(a*f**2*(tan((e + f*x)/2) - 1))