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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [B] (verification not implemented)
Maxima [B] (verification not implemented)
Giac [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 28, antiderivative size = 75 \[ \int \frac {(e+f x)^2 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {(e+f x)^3}{3 a f}-\frac {2 f^2 \cos (c+d x)}{a d^3}+\frac {(e+f x)^2 \cos (c+d x)}{a d}-\frac {2 f (e+f x) \sin (c+d x)}{a d^2} \] Output:

1/3*(f*x+e)^3/a/f-2*f^2*cos(d*x+c)/a/d^3+(f*x+e)^2*cos(d*x+c)/a/d-2*f*(f*x 
+e)*sin(d*x+c)/a/d^2
 

Mathematica [A] (verified)

Time = 1.24 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.99 \[ \int \frac {(e+f x)^2 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {d^3 x \left (3 e^2+3 e f x+f^2 x^2\right )+3 \left (-2 f^2+d^2 (e+f x)^2\right ) \cos (c+d x)-6 d f (e+f x) \sin (c+d x)}{3 a d^3} \] Input:

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

Output:

(d^3*x*(3*e^2 + 3*e*f*x + f^2*x^2) + 3*(-2*f^2 + d^2*(e + f*x)^2)*Cos[c + 
d*x] - 6*d*f*(e + f*x)*Sin[c + d*x])/(3*a*d^3)
 

Rubi [A] (verified)

Time = 0.45 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.321, Rules used = {5034, 17, 3042, 3777, 3042, 3777, 25, 3042, 3118}

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 {(e+f x)^2 \cos ^2(c+d x)}{a \sin (c+d x)+a} \, dx\)

\(\Big \downarrow \) 5034

\(\displaystyle \frac {\int (e+f x)^2dx}{a}-\frac {\int (e+f x)^2 \sin (c+d x)dx}{a}\)

\(\Big \downarrow \) 17

\(\displaystyle \frac {(e+f x)^3}{3 a f}-\frac {\int (e+f x)^2 \sin (c+d x)dx}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {(e+f x)^3}{3 a f}-\frac {\int (e+f x)^2 \sin (c+d x)dx}{a}\)

\(\Big \downarrow \) 3777

\(\displaystyle \frac {(e+f x)^3}{3 a f}-\frac {\frac {2 f \int (e+f x) \cos (c+d x)dx}{d}-\frac {(e+f x)^2 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {(e+f x)^3}{3 a f}-\frac {\frac {2 f \int (e+f x) \sin \left (c+d x+\frac {\pi }{2}\right )dx}{d}-\frac {(e+f x)^2 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 3777

\(\displaystyle \frac {(e+f x)^3}{3 a f}-\frac {\frac {2 f \left (\frac {f \int -\sin (c+d x)dx}{d}+\frac {(e+f x) \sin (c+d x)}{d}\right )}{d}-\frac {(e+f x)^2 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {(e+f x)^3}{3 a f}-\frac {\frac {2 f \left (\frac {(e+f x) \sin (c+d x)}{d}-\frac {f \int \sin (c+d x)dx}{d}\right )}{d}-\frac {(e+f x)^2 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {(e+f x)^3}{3 a f}-\frac {\frac {2 f \left (\frac {(e+f x) \sin (c+d x)}{d}-\frac {f \int \sin (c+d x)dx}{d}\right )}{d}-\frac {(e+f x)^2 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 3118

\(\displaystyle \frac {(e+f x)^3}{3 a f}-\frac {\frac {2 f \left (\frac {f \cos (c+d x)}{d^2}+\frac {(e+f x) \sin (c+d x)}{d}\right )}{d}-\frac {(e+f x)^2 \cos (c+d x)}{d}}{a}\)

Input:

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

Output:

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

Defintions of rubi rules used

rule 17
Int[(c_.)*((a_.) + (b_.)*(x_))^(m_.), x_Symbol] :> Simp[c*((a + b*x)^(m + 1 
)/(b*(m + 1))), x] /; FreeQ[{a, b, c, m}, x] && NeQ[m, -1]
 

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3118
Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ 
[{c, d}, x]
 

rule 3777
Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[( 
-(c + d*x)^m)*(Cos[e + f*x]/f), x] + Simp[d*(m/f)   Int[(c + d*x)^(m - 1)*C 
os[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
 

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

Time = 0.85 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.17

method result size
parallelrisch \(\frac {\left (3 \left (f x +e \right )^{2} d^{2}-6 f^{2}\right ) \cos \left (d x +c \right )-6 d f \left (f x +e \right ) \sin \left (d x +c \right )+\left (f^{2} x^{3}+3 x^{2} e f +3 x \,e^{2}\right ) d^{3}+3 d^{2} e^{2}-6 f^{2}}{3 a \,d^{3}}\) \(88\)
risch \(\frac {f^{2} x^{3}}{3 a}+\frac {f e \,x^{2}}{a}+\frac {e^{2} x}{a}+\frac {e^{3}}{3 a f}+\frac {\left (d^{2} x^{2} f^{2}+2 e f x \,d^{2}+d^{2} e^{2}-2 f^{2}\right ) \cos \left (d x +c \right )}{a \,d^{3}}-\frac {2 f \left (f x +e \right ) \sin \left (d x +c \right )}{a \,d^{2}}\) \(105\)
derivativedivides \(-\frac {-\cos \left (d x +c \right ) c^{2} f^{2}+2 \cos \left (d x +c \right ) c d e f -2 c \,f^{2} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )-\cos \left (d x +c \right ) d^{2} e^{2}+2 d e f \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )+f^{2} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )-c^{2} f^{2} \left (d x +c \right )+2 c d e f \left (d x +c \right )+c \,f^{2} \left (d x +c \right )^{2}-d^{2} e^{2} \left (d x +c \right )-d e f \left (d x +c \right )^{2}-\frac {f^{2} \left (d x +c \right )^{3}}{3}}{d^{3} a}\) \(215\)
default \(-\frac {-\cos \left (d x +c \right ) c^{2} f^{2}+2 \cos \left (d x +c \right ) c d e f -2 c \,f^{2} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )-\cos \left (d x +c \right ) d^{2} e^{2}+2 d e f \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )+f^{2} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )-c^{2} f^{2} \left (d x +c \right )+2 c d e f \left (d x +c \right )+c \,f^{2} \left (d x +c \right )^{2}-d^{2} e^{2} \left (d x +c \right )-d e f \left (d x +c \right )^{2}-\frac {f^{2} \left (d x +c \right )^{3}}{3}}{d^{3} a}\) \(215\)
norman \(\frac {\frac {2 d^{2} e^{2}+4 d e f -4 f^{2}}{a \,d^{3}}+\frac {4 e f \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d^{2} a}+\frac {\left (2 d^{2} e^{2}-4 f^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a \,d^{3}}+\frac {e \left (d e +2 f \right ) x}{d a}+\frac {f \left (d e +f \right ) x^{2}}{a d}+\frac {\left (d^{2} e^{2}-2 d e f -4 f^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d^{2} a}+\frac {\left (d^{2} e^{2}+2 d e f -4 f^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d^{2} a}+\frac {e \left (d e -2 f \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d a}+\frac {f \left (d e -f \right ) x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{a d}+\frac {f \left (d e -f \right ) x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{a d}+\frac {f \left (d e +f \right ) x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}+\frac {f^{2} x^{3}}{3 a}+\frac {f^{2} x^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{3 a}+\frac {2 f^{2} x^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{3 a}+\frac {2 f^{2} x^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 a}+\frac {f^{2} x^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{3 a}+\frac {f^{2} x^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{3 a}+\frac {2 \left (d^{2} e^{2}+2 d e f -2 f^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a \,d^{3}}+\frac {2 \left (d^{2} e^{2}+2 d e f -2 f^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{a \,d^{3}}+\frac {2 f e \,x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a}+\frac {2 f e \,x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{a}+\frac {2 \left (d^{2} e^{2}-2 f^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d^{2} a}+\frac {2 \left (d^{2} e^{2}-2 f^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d^{2} a}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}\) \(623\)

Input:

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

Output:

1/3*((3*(f*x+e)^2*d^2-6*f^2)*cos(d*x+c)-6*d*f*(f*x+e)*sin(d*x+c)+(f^2*x^3+ 
3*e*f*x^2+3*e^2*x)*d^3+3*d^2*e^2-6*f^2)/a/d^3
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.28 \[ \int \frac {(e+f x)^2 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {d^{3} f^{2} x^{3} + 3 \, d^{3} e f x^{2} + 3 \, d^{3} e^{2} x + 3 \, {\left (d^{2} f^{2} x^{2} + 2 \, d^{2} e f x + d^{2} e^{2} - 2 \, f^{2}\right )} \cos \left (d x + c\right ) - 6 \, {\left (d f^{2} x + d e f\right )} \sin \left (d x + c\right )}{3 \, a d^{3}} \] Input:

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

Output:

1/3*(d^3*f^2*x^3 + 3*d^3*e*f*x^2 + 3*d^3*e^2*x + 3*(d^2*f^2*x^2 + 2*d^2*e* 
f*x + d^2*e^2 - 2*f^2)*cos(d*x + c) - 6*(d*f^2*x + d*e*f)*sin(d*x + c))/(a 
*d^3)
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 605 vs. \(2 (65) = 130\).

Time = 1.74 (sec) , antiderivative size = 605, normalized size of antiderivative = 8.07 \[ \int \frac {(e+f x)^2 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\begin {cases} \frac {3 d^{3} e^{2} x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} + \frac {3 d^{3} e^{2} x}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} + \frac {3 d^{3} e f x^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} + \frac {3 d^{3} e f x^{2}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} + \frac {d^{3} f^{2} x^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} + \frac {d^{3} f^{2} x^{3}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} + \frac {6 d^{2} e^{2}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} - \frac {6 d^{2} e f x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} + \frac {6 d^{2} e f x}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} - \frac {3 d^{2} f^{2} x^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} + \frac {3 d^{2} f^{2} x^{2}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} - \frac {12 d e f \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} - \frac {12 d f^{2} x \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} - \frac {12 f^{2}}{3 a d^{3} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 3 a d^{3}} & \text {for}\: d \neq 0 \\\frac {\left (e^{2} x + e f x^{2} + \frac {f^{2} x^{3}}{3}\right ) \cos ^{2}{\left (c \right )}}{a \sin {\left (c \right )} + a} & \text {otherwise} \end {cases} \] Input:

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

Output:

Piecewise((3*d**3*e**2*x*tan(c/2 + d*x/2)**2/(3*a*d**3*tan(c/2 + d*x/2)**2 
 + 3*a*d**3) + 3*d**3*e**2*x/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + 3 
*d**3*e*f*x**2*tan(c/2 + d*x/2)**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d** 
3) + 3*d**3*e*f*x**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + d**3*f**2 
*x**3*tan(c/2 + d*x/2)**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + d**3 
*f**2*x**3/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + 6*d**2*e**2/(3*a*d* 
*3*tan(c/2 + d*x/2)**2 + 3*a*d**3) - 6*d**2*e*f*x*tan(c/2 + d*x/2)**2/(3*a 
*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3) + 6*d**2*e*f*x/(3*a*d**3*tan(c/2 + d 
*x/2)**2 + 3*a*d**3) - 3*d**2*f**2*x**2*tan(c/2 + d*x/2)**2/(3*a*d**3*tan( 
c/2 + d*x/2)**2 + 3*a*d**3) + 3*d**2*f**2*x**2/(3*a*d**3*tan(c/2 + d*x/2)* 
*2 + 3*a*d**3) - 12*d*e*f*tan(c/2 + d*x/2)/(3*a*d**3*tan(c/2 + d*x/2)**2 + 
 3*a*d**3) - 12*d*f**2*x*tan(c/2 + d*x/2)/(3*a*d**3*tan(c/2 + d*x/2)**2 + 
3*a*d**3) - 12*f**2/(3*a*d**3*tan(c/2 + d*x/2)**2 + 3*a*d**3), Ne(d, 0)), 
((e**2*x + e*f*x**2 + f**2*x**3/3)*cos(c)**2/(a*sin(c) + a), True))
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 309 vs. \(2 (73) = 146\).

Time = 0.12 (sec) , antiderivative size = 309, normalized size of antiderivative = 4.12 \[ \int \frac {(e+f x)^2 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {6 \, c^{2} f^{2} {\left (\frac {1}{a d^{2} + \frac {a d^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} + \frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a d^{2}}\right )} - 12 \, c e f {\left (\frac {1}{a d + \frac {a d \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} + \frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a d}\right )} + 6 \, e^{2} {\left (\frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {1}{a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}\right )} + \frac {3 \, {\left ({\left (d x + c\right )}^{2} + 2 \, {\left (d x + c\right )} \cos \left (d x + c\right ) - 2 \, \sin \left (d x + c\right )\right )} e f}{a d} - \frac {3 \, {\left ({\left (d x + c\right )}^{2} + 2 \, {\left (d x + c\right )} \cos \left (d x + c\right ) - 2 \, \sin \left (d x + c\right )\right )} c f^{2}}{a d^{2}} + \frac {{\left ({\left (d x + c\right )}^{3} + 3 \, {\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 6 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} f^{2}}{a d^{2}}}{3 \, d} \] Input:

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

Output:

1/3*(6*c^2*f^2*(1/(a*d^2 + a*d^2*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) + ar 
ctan(sin(d*x + c)/(cos(d*x + c) + 1))/(a*d^2)) - 12*c*e*f*(1/(a*d + a*d*si 
n(d*x + c)^2/(cos(d*x + c) + 1)^2) + arctan(sin(d*x + c)/(cos(d*x + c) + 1 
))/(a*d)) + 6*e^2*(arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a + 1/(a + a*si 
n(d*x + c)^2/(cos(d*x + c) + 1)^2)) + 3*((d*x + c)^2 + 2*(d*x + c)*cos(d*x 
 + c) - 2*sin(d*x + c))*e*f/(a*d) - 3*((d*x + c)^2 + 2*(d*x + c)*cos(d*x + 
 c) - 2*sin(d*x + c))*c*f^2/(a*d^2) + ((d*x + c)^3 + 3*((d*x + c)^2 - 2)*c 
os(d*x + c) - 6*(d*x + c)*sin(d*x + c))*f^2/(a*d^2))/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 656 vs. \(2 (73) = 146\).

Time = 0.13 (sec) , antiderivative size = 656, normalized size of antiderivative = 8.75 \[ \int \frac {(e+f x)^2 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx =\text {Too large to display} \] Input:

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

Output:

1/3*(d^3*f^2*x^3*tan(1/2*d*x)^2*tan(1/2*c)^2 + 3*d^3*e*f*x^2*tan(1/2*d*x)^ 
2*tan(1/2*c)^2 + d^3*f^2*x^3*tan(1/2*d*x)^2 + d^3*f^2*x^3*tan(1/2*c)^2 + 3 
*d^3*e^2*x*tan(1/2*d*x)^2*tan(1/2*c)^2 + 3*d^2*f^2*x^2*tan(1/2*d*x)^2*tan( 
1/2*c)^2 + 3*d^3*e*f*x^2*tan(1/2*d*x)^2 + 3*d^3*e*f*x^2*tan(1/2*c)^2 + 6*d 
^2*e*f*x*tan(1/2*d*x)^2*tan(1/2*c)^2 + d^3*f^2*x^3 + 3*d^3*e^2*x*tan(1/2*d 
*x)^2 - 3*d^2*f^2*x^2*tan(1/2*d*x)^2 - 12*d^2*f^2*x^2*tan(1/2*d*x)*tan(1/2 
*c) + 3*d^3*e^2*x*tan(1/2*c)^2 - 3*d^2*f^2*x^2*tan(1/2*c)^2 + 3*d^2*e^2*ta 
n(1/2*d*x)^2*tan(1/2*c)^2 + 3*d^3*e*f*x^2 - 6*d^2*e*f*x*tan(1/2*d*x)^2 - 2 
4*d^2*e*f*x*tan(1/2*d*x)*tan(1/2*c) + 12*d*f^2*x*tan(1/2*d*x)^2*tan(1/2*c) 
 - 6*d^2*e*f*x*tan(1/2*c)^2 + 12*d*f^2*x*tan(1/2*d*x)*tan(1/2*c)^2 + 3*d^3 
*e^2*x + 3*d^2*f^2*x^2 - 3*d^2*e^2*tan(1/2*d*x)^2 - 12*d^2*e^2*tan(1/2*d*x 
)*tan(1/2*c) + 12*d*e*f*tan(1/2*d*x)^2*tan(1/2*c) - 3*d^2*e^2*tan(1/2*c)^2 
 + 12*d*e*f*tan(1/2*d*x)*tan(1/2*c)^2 - 6*f^2*tan(1/2*d*x)^2*tan(1/2*c)^2 
+ 6*d^2*e*f*x - 12*d*f^2*x*tan(1/2*d*x) - 12*d*f^2*x*tan(1/2*c) + 3*d^2*e^ 
2 - 12*d*e*f*tan(1/2*d*x) + 6*f^2*tan(1/2*d*x)^2 - 12*d*e*f*tan(1/2*c) + 2 
4*f^2*tan(1/2*d*x)*tan(1/2*c) + 6*f^2*tan(1/2*c)^2 - 6*f^2)/(a*d^3*tan(1/2 
*d*x)^2*tan(1/2*c)^2 + a*d^3*tan(1/2*d*x)^2 + a*d^3*tan(1/2*c)^2 + a*d^3)
 

Mupad [B] (verification not implemented)

Time = 39.22 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.47 \[ \int \frac {(e+f x)^2 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {e^2\,x+e\,f\,x^2+\frac {f^2\,x^3}{3}}{a}-\frac {2\,f^2\,\cos \left (c+d\,x\right )-d^2\,\left (e^2\,\cos \left (c+d\,x\right )+f^2\,x^2\,\cos \left (c+d\,x\right )+2\,e\,f\,x\,\cos \left (c+d\,x\right )\right )+d\,\left (2\,x\,\sin \left (c+d\,x\right )\,f^2+2\,e\,\sin \left (c+d\,x\right )\,f\right )}{a\,d^3} \] Input:

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

Output:

(e^2*x + (f^2*x^3)/3 + e*f*x^2)/a - (2*f^2*cos(c + d*x) - d^2*(e^2*cos(c + 
 d*x) + f^2*x^2*cos(c + d*x) + 2*e*f*x*cos(c + d*x)) + d*(2*f^2*x*sin(c + 
d*x) + 2*e*f*sin(c + d*x)))/(a*d^3)
 

Reduce [B] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.75 \[ \int \frac {(e+f x)^2 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {3 \cos \left (d x +c \right ) d^{2} e^{2}+6 \cos \left (d x +c \right ) d^{2} e f x +3 \cos \left (d x +c \right ) d^{2} f^{2} x^{2}-6 \cos \left (d x +c \right ) f^{2}-6 \sin \left (d x +c \right ) d e f -6 \sin \left (d x +c \right ) d \,f^{2} x +3 d^{3} e^{2} x +3 d^{3} e f \,x^{2}+d^{3} f^{2} x^{3}-3 d^{2} e^{2}+6 f^{2}}{3 a \,d^{3}} \] Input:

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

Output:

(3*cos(c + d*x)*d**2*e**2 + 6*cos(c + d*x)*d**2*e*f*x + 3*cos(c + d*x)*d** 
2*f**2*x**2 - 6*cos(c + d*x)*f**2 - 6*sin(c + d*x)*d*e*f - 6*sin(c + d*x)* 
d*f**2*x + 3*d**3*e**2*x + 3*d**3*e*f*x**2 + d**3*f**2*x**3 - 3*d**2*e**2 
+ 6*f**2)/(3*a*d**3)