3.252 \(\int \frac {(e+f x)^2 \cos (c+d x)}{a+a \sin (c+d x)} \, dx\)

Optimal. Leaf size=114 \[ \frac {4 f^2 \text {Li}_3\left (i e^{i (c+d x)}\right )}{a d^3}-\frac {4 i f (e+f x) \text {Li}_2\left (i e^{i (c+d x)}\right )}{a d^2}+\frac {2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac {i (e+f x)^3}{3 a f} \]

[Out]

-1/3*I*(f*x+e)^3/a/f+2*(f*x+e)^2*ln(1-I*exp(I*(d*x+c)))/a/d-4*I*f*(f*x+e)*polylog(2,I*exp(I*(d*x+c)))/a/d^2+4*
f^2*polylog(3,I*exp(I*(d*x+c)))/a/d^3

________________________________________________________________________________________

Rubi [A]  time = 0.21, antiderivative size = 114, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {4517, 2190, 2531, 2282, 6589} \[ -\frac {4 i f (e+f x) \text {PolyLog}\left (2,i e^{i (c+d x)}\right )}{a d^2}+\frac {4 f^2 \text {PolyLog}\left (3,i e^{i (c+d x)}\right )}{a d^3}+\frac {2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac {i (e+f x)^3}{3 a f} \]

Antiderivative was successfully verified.

[In]

Int[((e + f*x)^2*Cos[c + d*x])/(a + a*Sin[c + d*x]),x]

[Out]

((-I/3)*(e + f*x)^3)/(a*f) + (2*(e + f*x)^2*Log[1 - I*E^(I*(c + d*x))])/(a*d) - ((4*I)*f*(e + f*x)*PolyLog[2,
I*E^(I*(c + d*x))])/(a*d^2) + (4*f^2*PolyLog[3, I*E^(I*(c + d*x))])/(a*d^3)

Rule 2190

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*Log[1 + (b*(F^(g*(e + f*x)))^n)/a])/(b*f*g*n*Log[F]), x]
 - Dist[(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]

Rule 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2531

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> -Simp[((
f + g*x)^m*PolyLog[2, -(e*(F^(c*(a + b*x)))^n)])/(b*c*n*Log[F]), x] + Dist[(g*m)/(b*c*n*Log[F]), Int[(f + g*x)
^(m - 1)*PolyLog[2, -(e*(F^(c*(a + b*x)))^n)], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 4517

Int[(Cos[(c_.) + (d_.)*(x_)]*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.)*Sin[(c_.) + (d_.)*(x_)]), x_Symbol] :>
-Simp[(I*(e + f*x)^(m + 1))/(b*f*(m + 1)), x] + Dist[2, Int[((e + f*x)^m*E^(I*(c + d*x)))/(a - I*b*E^(I*(c + d
*x))), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[m, 0] && EqQ[a^2 - b^2, 0]

Rule 6589

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps

\begin {align*} \int \frac {(e+f x)^2 \cos (c+d x)}{a+a \sin (c+d x)} \, dx &=-\frac {i (e+f x)^3}{3 a f}+2 \int \frac {e^{i (c+d x)} (e+f x)^2}{a-i a e^{i (c+d x)}} \, dx\\ &=-\frac {i (e+f x)^3}{3 a f}+\frac {2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac {(4 f) \int (e+f x) \log \left (1-i e^{i (c+d x)}\right ) \, dx}{a d}\\ &=-\frac {i (e+f x)^3}{3 a f}+\frac {2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac {4 i f (e+f x) \text {Li}_2\left (i e^{i (c+d x)}\right )}{a d^2}+\frac {\left (4 i f^2\right ) \int \text {Li}_2\left (i e^{i (c+d x)}\right ) \, dx}{a d^2}\\ &=-\frac {i (e+f x)^3}{3 a f}+\frac {2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac {4 i f (e+f x) \text {Li}_2\left (i e^{i (c+d x)}\right )}{a d^2}+\frac {\left (4 f^2\right ) \operatorname {Subst}\left (\int \frac {\text {Li}_2(i x)}{x} \, dx,x,e^{i (c+d x)}\right )}{a d^3}\\ &=-\frac {i (e+f x)^3}{3 a f}+\frac {2 (e+f x)^2 \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac {4 i f (e+f x) \text {Li}_2\left (i e^{i (c+d x)}\right )}{a d^2}+\frac {4 f^2 \text {Li}_3\left (i e^{i (c+d x)}\right )}{a d^3}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 1.05, size = 221, normalized size = 1.94 \[ \frac {x \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (3 e^2+3 e f x+f^2 x^2\right )}{3 a \left (\sin \left (\frac {c}{2}\right )+\cos \left (\frac {c}{2}\right )\right )}-\frac {2 (\cos (c)+i \sin (c)) \left (\frac {2 f (\cos (c)-i (\sin (c)+1)) (d (e+f x) \text {Li}_2(-i \cos (c+d x)-\sin (c+d x))-i f \text {Li}_3(-i \cos (c+d x)-\sin (c+d x)))}{d^3}-\frac {(\sin (c)+i \cos (c)+1) (e+f x)^2 \log (\sin (c+d x)+i \cos (c+d x)+1)}{d}+\frac {(\cos (c)-i \sin (c)) (e+f x)^3}{3 f}\right )}{a (\cos (c)+i (\sin (c)+1))} \]

Antiderivative was successfully verified.

[In]

Integrate[((e + f*x)^2*Cos[c + d*x])/(a + a*Sin[c + d*x]),x]

[Out]

(x*(3*e^2 + 3*e*f*x + f^2*x^2)*(Cos[c/2] - Sin[c/2]))/(3*a*(Cos[c/2] + Sin[c/2])) - (2*(Cos[c] + I*Sin[c])*(((
e + f*x)^3*(Cos[c] - I*Sin[c]))/(3*f) - ((e + f*x)^2*Log[1 + I*Cos[c + d*x] + Sin[c + d*x]]*(1 + I*Cos[c] + Si
n[c]))/d + (2*f*(d*(e + f*x)*PolyLog[2, (-I)*Cos[c + d*x] - Sin[c + d*x]] - I*f*PolyLog[3, (-I)*Cos[c + d*x] -
 Sin[c + d*x]])*(Cos[c] - I*(1 + Sin[c])))/d^3))/(a*(Cos[c] + I*(1 + Sin[c])))

________________________________________________________________________________________

fricas [C]  time = 0.46, size = 302, normalized size = 2.65 \[ \frac {2 \, f^{2} {\rm polylog}\left (3, i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) + 2 \, f^{2} {\rm polylog}\left (3, -i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) + {\left (-2 i \, d f^{2} x - 2 i \, d e f\right )} {\rm Li}_2\left (i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) + {\left (2 i \, d f^{2} x + 2 i \, d e f\right )} {\rm Li}_2\left (-i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) + {\left (d^{2} e^{2} - 2 \, c d e f + c^{2} f^{2}\right )} \log \left (\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + i\right ) + {\left (d^{2} f^{2} x^{2} + 2 \, d^{2} e f x + 2 \, c d e f - c^{2} f^{2}\right )} \log \left (i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right ) + 1\right ) + {\left (d^{2} f^{2} x^{2} + 2 \, d^{2} e f x + 2 \, c d e f - c^{2} f^{2}\right )} \log \left (-i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right ) + 1\right ) + {\left (d^{2} e^{2} - 2 \, c d e f + c^{2} f^{2}\right )} \log \left (-\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + i\right )}{a d^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*cos(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

(2*f^2*polylog(3, I*cos(d*x + c) - sin(d*x + c)) + 2*f^2*polylog(3, -I*cos(d*x + c) - sin(d*x + c)) + (-2*I*d*
f^2*x - 2*I*d*e*f)*dilog(I*cos(d*x + c) - sin(d*x + c)) + (2*I*d*f^2*x + 2*I*d*e*f)*dilog(-I*cos(d*x + c) - si
n(d*x + c)) + (d^2*e^2 - 2*c*d*e*f + c^2*f^2)*log(cos(d*x + c) + I*sin(d*x + c) + I) + (d^2*f^2*x^2 + 2*d^2*e*
f*x + 2*c*d*e*f - c^2*f^2)*log(I*cos(d*x + c) + sin(d*x + c) + 1) + (d^2*f^2*x^2 + 2*d^2*e*f*x + 2*c*d*e*f - c
^2*f^2)*log(-I*cos(d*x + c) + sin(d*x + c) + 1) + (d^2*e^2 - 2*c*d*e*f + c^2*f^2)*log(-cos(d*x + c) + I*sin(d*
x + c) + I))/(a*d^3)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (f x + e\right )}^{2} \cos \left (d x + c\right )}{a \sin \left (d x + c\right ) + a}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*cos(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

integrate((f*x + e)^2*cos(d*x + c)/(a*sin(d*x + c) + a), x)

________________________________________________________________________________________

maple [B]  time = 0.22, size = 421, normalized size = 3.69 \[ \frac {i e^{2} x}{a}+\frac {2 i f^{2} c^{2} x}{d^{2} a}-\frac {i f e \,x^{2}}{a}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) e^{2}}{d a}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right ) e^{2}}{d a}+\frac {4 f e \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) x}{d a}+\frac {4 f e \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) c}{d^{2} a}-\frac {4 f e c \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d^{2} a}-\frac {4 i f e \polylog \left (2, i {\mathrm e}^{i \left (d x +c \right )}\right )}{d^{2} a}+\frac {2 f^{2} \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) x^{2}}{d a}-\frac {2 f^{2} \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) c^{2}}{d^{3} a}+\frac {4 i f^{2} c^{3}}{3 d^{3} a}-\frac {4 i f^{2} \polylog \left (2, i {\mathrm e}^{i \left (d x +c \right )}\right ) x}{d^{2} a}-\frac {2 i e f \,c^{2}}{d^{2} a}+\frac {4 f e c \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{d^{2} a}-\frac {2 f^{2} c^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{d^{3} a}+\frac {2 f^{2} c^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d^{3} a}-\frac {i f^{2} x^{3}}{3 a}-\frac {4 i e f c x}{d a}+\frac {4 f^{2} \polylog \left (3, i {\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x+e)^2*cos(d*x+c)/(a+a*sin(d*x+c)),x)

[Out]

I/a*e^2*x+2*I/d^2/a*f^2*c^2*x-4*I/d^2/a*f*e*polylog(2,I*exp(I*(d*x+c)))+2/d/a*ln(exp(I*(d*x+c))+I)*e^2-2/d/a*l
n(exp(I*(d*x+c)))*e^2+4/d/a*f*e*ln(1-I*exp(I*(d*x+c)))*x+4/d^2/a*f*e*ln(1-I*exp(I*(d*x+c)))*c-4/d^2/a*f*e*c*ln
(exp(I*(d*x+c))+I)-I/a*f*e*x^2+2/d/a*f^2*ln(1-I*exp(I*(d*x+c)))*x^2-2/d^3/a*f^2*ln(1-I*exp(I*(d*x+c)))*c^2+4/3
*I/d^3/a*f^2*c^3-2*I/d^2/a*e*f*c^2-1/3*I/a*f^2*x^3+4/d^2/a*f*e*c*ln(exp(I*(d*x+c)))-2/d^3/a*f^2*c^2*ln(exp(I*(
d*x+c)))+2/d^3/a*f^2*c^2*ln(exp(I*(d*x+c))+I)-4*I/d^2/a*f^2*polylog(2,I*exp(I*(d*x+c)))*x-4*I/d/a*e*f*c*x+4*f^
2*polylog(3,I*exp(I*(d*x+c)))/a/d^3

________________________________________________________________________________________

maxima [B]  time = 0.87, size = 293, normalized size = 2.57 \[ -\frac {\frac {6 \, c e f \log \left (a d \sin \left (d x + c\right ) + a d\right )}{a d} - \frac {3 \, e^{2} \log \left (a \sin \left (d x + c\right ) + a\right )}{a} - \frac {-i \, {\left (d x + c\right )}^{3} f^{2} - 3 i \, {\left (d x + c\right )} c^{2} f^{2} + 6 i \, c^{2} f^{2} \arctan \left (\sin \left (d x + c\right ) + 1, \cos \left (d x + c\right )\right ) + {\left (-3 i \, d e f + 3 i \, c f^{2}\right )} {\left (d x + c\right )}^{2} + 12 \, f^{2} {\rm Li}_{3}(i \, e^{\left (i \, d x + i \, c\right )}) + {\left (-6 i \, {\left (d x + c\right )}^{2} f^{2} + {\left (-12 i \, d e f + 12 i \, c f^{2}\right )} {\left (d x + c\right )}\right )} \arctan \left (\cos \left (d x + c\right ), \sin \left (d x + c\right ) + 1\right ) + {\left (-12 i \, d e f - 12 i \, {\left (d x + c\right )} f^{2} + 12 i \, c f^{2}\right )} {\rm Li}_2\left (i \, e^{\left (i \, d x + i \, c\right )}\right ) + 3 \, {\left ({\left (d x + c\right )}^{2} f^{2} + c^{2} f^{2} + 2 \, {\left (d e f - c f^{2}\right )} {\left (d x + c\right )}\right )} \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right )}{a d^{2}}}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^2*cos(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

-1/3*(6*c*e*f*log(a*d*sin(d*x + c) + a*d)/(a*d) - 3*e^2*log(a*sin(d*x + c) + a)/a - (-I*(d*x + c)^3*f^2 - 3*I*
(d*x + c)*c^2*f^2 + 6*I*c^2*f^2*arctan2(sin(d*x + c) + 1, cos(d*x + c)) + (-3*I*d*e*f + 3*I*c*f^2)*(d*x + c)^2
 + 12*f^2*polylog(3, I*e^(I*d*x + I*c)) + (-6*I*(d*x + c)^2*f^2 + (-12*I*d*e*f + 12*I*c*f^2)*(d*x + c))*arctan
2(cos(d*x + c), sin(d*x + c) + 1) + (-12*I*d*e*f - 12*I*(d*x + c)*f^2 + 12*I*c*f^2)*dilog(I*e^(I*d*x + I*c)) +
 3*((d*x + c)^2*f^2 + c^2*f^2 + 2*(d*e*f - c*f^2)*(d*x + c))*log(cos(d*x + c)^2 + sin(d*x + c)^2 + 2*sin(d*x +
 c) + 1))/(a*d^2))/d

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {\cos \left (c+d\,x\right )\,{\left (e+f\,x\right )}^2}{a+a\,\sin \left (c+d\,x\right )} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cos(c + d*x)*(e + f*x)^2)/(a + a*sin(c + d*x)),x)

[Out]

int((cos(c + d*x)*(e + f*x)^2)/(a + a*sin(c + d*x)), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {e^{2} \cos {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx + \int \frac {f^{2} x^{2} \cos {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx + \int \frac {2 e f x \cos {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)**2*cos(d*x+c)/(a+a*sin(d*x+c)),x)

[Out]

(Integral(e**2*cos(c + d*x)/(sin(c + d*x) + 1), x) + Integral(f**2*x**2*cos(c + d*x)/(sin(c + d*x) + 1), x) +
Integral(2*e*f*x*cos(c + d*x)/(sin(c + d*x) + 1), x))/a

________________________________________________________________________________________