Integrand size = 23, antiderivative size = 104 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {1}{16} \left (8 a^2+4 a b+b^2\right ) x+\frac {\left (8 a^2+4 a b+b^2\right ) \cos (e+f x) \sin (e+f x)}{16 f}-\frac {b (12 a+7 b) \cos ^3(e+f x) \sin (e+f x)}{24 f}+\frac {b^2 \cos ^5(e+f x) \sin (e+f x)}{6 f} \] Output:
1/16*(8*a^2+4*a*b+b^2)*x+1/16*(8*a^2+4*a*b+b^2)*cos(f*x+e)*sin(f*x+e)/f-1/ 24*b*(12*a+7*b)*cos(f*x+e)^3*sin(f*x+e)/f+1/6*b^2*cos(f*x+e)^5*sin(f*x+e)/ f
Result contains complex when optimal does not.
Time = 2.47 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.76 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {12 ((2-2 i) a+b) ((2+2 i) a+b) (e+f x)+3 (4 a-b) (4 a+b) \sin (2 (e+f x))-3 b (4 a+b) \sin (4 (e+f x))+b^2 \sin (6 (e+f x))}{192 f} \] Input:
Integrate[Cos[e + f*x]^2*(a + b*Sin[e + f*x]^2)^2,x]
Output:
(12*((2 - 2*I)*a + b)*((2 + 2*I)*a + b)*(e + f*x) + 3*(4*a - b)*(4*a + b)* Sin[2*(e + f*x)] - 3*b*(4*a + b)*Sin[4*(e + f*x)] + b^2*Sin[6*(e + f*x)])/ (192*f)
Time = 0.31 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.23, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 3670, 315, 298, 215, 216}
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 \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cos (e+f x)^2 \left (a+b \sin (e+f x)^2\right )^2dx\) |
\(\Big \downarrow \) 3670 |
\(\displaystyle \frac {\int \frac {\left ((a+b) \tan ^2(e+f x)+a\right )^2}{\left (\tan ^2(e+f x)+1\right )^4}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 315 |
\(\displaystyle \frac {\frac {1}{6} \int \frac {3 (a+b) (2 a+b) \tan ^2(e+f x)+a (6 a+b)}{\left (\tan ^2(e+f x)+1\right )^3}d\tan (e+f x)-\frac {b \tan (e+f x) \left ((a+b) \tan ^2(e+f x)+a\right )}{6 \left (\tan ^2(e+f x)+1\right )^3}}{f}\) |
\(\Big \downarrow \) 298 |
\(\displaystyle \frac {\frac {1}{6} \left (\frac {3}{4} \left (8 a^2+4 a b+b^2\right ) \int \frac {1}{\left (\tan ^2(e+f x)+1\right )^2}d\tan (e+f x)-\frac {b (8 a+3 b) \tan (e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}\right )-\frac {b \tan (e+f x) \left ((a+b) \tan ^2(e+f x)+a\right )}{6 \left (\tan ^2(e+f x)+1\right )^3}}{f}\) |
\(\Big \downarrow \) 215 |
\(\displaystyle \frac {\frac {1}{6} \left (\frac {3}{4} \left (8 a^2+4 a b+b^2\right ) \left (\frac {1}{2} \int \frac {1}{\tan ^2(e+f x)+1}d\tan (e+f x)+\frac {\tan (e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}\right )-\frac {b (8 a+3 b) \tan (e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}\right )-\frac {b \tan (e+f x) \left ((a+b) \tan ^2(e+f x)+a\right )}{6 \left (\tan ^2(e+f x)+1\right )^3}}{f}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {\frac {1}{6} \left (\frac {3}{4} \left (8 a^2+4 a b+b^2\right ) \left (\frac {1}{2} \arctan (\tan (e+f x))+\frac {\tan (e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}\right )-\frac {b (8 a+3 b) \tan (e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}\right )-\frac {b \tan (e+f x) \left ((a+b) \tan ^2(e+f x)+a\right )}{6 \left (\tan ^2(e+f x)+1\right )^3}}{f}\) |
Input:
Int[Cos[e + f*x]^2*(a + b*Sin[e + f*x]^2)^2,x]
Output:
(-1/6*(b*Tan[e + f*x]*(a + (a + b)*Tan[e + f*x]^2))/(1 + Tan[e + f*x]^2)^3 + (-1/4*(b*(8*a + 3*b)*Tan[e + f*x])/(1 + Tan[e + f*x]^2)^2 + (3*(8*a^2 + 4*a*b + b^2)*(ArcTan[Tan[e + f*x]]/2 + Tan[e + f*x]/(2*(1 + Tan[e + f*x]^ 2))))/4)/6)/f
Int[((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^2)^(p + 1) /(2*a*(p + 1))), x] + Simp[(2*p + 3)/(2*a*(p + 1)) Int[(a + b*x^2)^(p + 1 ), x], x] /; FreeQ[{a, b}, x] && LtQ[p, -1] && (IntegerQ[4*p] || IntegerQ[6 *p])
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[(-( b*c - a*d))*x*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] - Simp[(a*d - b*c*( 2*p + 3))/(2*a*b*(p + 1)) Int[(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/2 + p, 0])
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Sim p[(a*d - c*b)*x*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q - 1)/(2*a*b*(p + 1))), x] - Simp[1/(2*a*b*(p + 1)) Int[(a + b*x^2)^(p + 1)*(c + d*x^2)^(q - 2)*S imp[c*(a*d - c*b*(2*p + 3)) + d*(a*d*(2*(q - 1) + 1) - b*c*(2*(p + q) + 1)) *x^2, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, - 1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, 2, p, q, x]
Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^( p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[ff/f Su bst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]
Time = 3.90 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.75
method | result | size |
parallelrisch | \(\frac {\left (48 a^{2}-3 b^{2}\right ) \sin \left (2 f x +2 e \right )+\left (-12 a b -3 b^{2}\right ) \sin \left (4 f x +4 e \right )+b^{2} \sin \left (6 f x +6 e \right )+96 f \left (a^{2}+\frac {1}{2} a b +\frac {1}{8} b^{2}\right ) x}{192 f}\) | \(78\) |
risch | \(\frac {a b x}{4}+\frac {b^{2} x}{16}+\frac {a^{2} x}{2}+\frac {b^{2} \sin \left (6 f x +6 e \right )}{192 f}-\frac {\sin \left (4 f x +4 e \right ) a b}{16 f}-\frac {\sin \left (4 f x +4 e \right ) b^{2}}{64 f}+\frac {\sin \left (2 f x +2 e \right ) a^{2}}{4 f}-\frac {\sin \left (2 f x +2 e \right ) b^{2}}{64 f}\) | \(103\) |
derivativedivides | \(\frac {a^{2} \left (\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+2 a b \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )^{3}}{4}+\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{8}+\frac {f x}{8}+\frac {e}{8}\right )+b^{2} \left (-\frac {\sin \left (f x +e \right )^{3} \cos \left (f x +e \right )^{3}}{6}-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )^{3}}{8}+\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{16}+\frac {f x}{16}+\frac {e}{16}\right )}{f}\) | \(134\) |
default | \(\frac {a^{2} \left (\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+2 a b \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )^{3}}{4}+\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{8}+\frac {f x}{8}+\frac {e}{8}\right )+b^{2} \left (-\frac {\sin \left (f x +e \right )^{3} \cos \left (f x +e \right )^{3}}{6}-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )^{3}}{8}+\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{16}+\frac {f x}{16}+\frac {e}{16}\right )}{f}\) | \(134\) |
norman | \(\frac {\left (\frac {1}{4} a b +\frac {1}{16} b^{2}+\frac {1}{2} a^{2}\right ) x +\left (5 a b +\frac {5}{4} b^{2}+10 a^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}+\left (\frac {1}{4} a b +\frac {1}{16} b^{2}+\frac {1}{2} a^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{12}+\left (\frac {3}{2} a b +\frac {3}{8} b^{2}+3 a^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+\left (\frac {3}{2} a b +\frac {3}{8} b^{2}+3 a^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{10}+\left (\frac {15}{4} a b +\frac {15}{16} b^{2}+\frac {15}{2} a^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}+\left (\frac {15}{4} a b +\frac {15}{16} b^{2}+\frac {15}{2} a^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}+\frac {\left (8 a^{2}-4 a b -b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{8 f}-\frac {\left (8 a^{2}-4 a b -b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{11}}{8 f}+\frac {\left (8 a^{2}+12 a b +19 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{4 f}-\frac {\left (8 a^{2}+12 a b +19 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{4 f}+\frac {\left (72 a^{2}+60 a b -17 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{24 f}-\frac {\left (72 a^{2}+60 a b -17 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{9}}{24 f}}{\left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{6}}\) | \(387\) |
orering | \(\text {Expression too large to display}\) | \(990\) |
Input:
int(cos(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
Output:
1/192*((48*a^2-3*b^2)*sin(2*f*x+2*e)+(-12*a*b-3*b^2)*sin(4*f*x+4*e)+b^2*si n(6*f*x+6*e)+96*f*(a^2+1/2*a*b+1/8*b^2)*x)/f
Time = 0.09 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.82 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {3 \, {\left (8 \, a^{2} + 4 \, a b + b^{2}\right )} f x + {\left (8 \, b^{2} \cos \left (f x + e\right )^{5} - 2 \, {\left (12 \, a b + 7 \, b^{2}\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (8 \, a^{2} + 4 \, a b + b^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{48 \, f} \] Input:
integrate(cos(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x, algorithm="fricas")
Output:
1/48*(3*(8*a^2 + 4*a*b + b^2)*f*x + (8*b^2*cos(f*x + e)^5 - 2*(12*a*b + 7* b^2)*cos(f*x + e)^3 + 3*(8*a^2 + 4*a*b + b^2)*cos(f*x + e))*sin(f*x + e))/ f
Leaf count of result is larger than twice the leaf count of optimal. 314 vs. \(2 (95) = 190\).
Time = 0.40 (sec) , antiderivative size = 314, normalized size of antiderivative = 3.02 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\begin {cases} \frac {a^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {a^{2} x \cos ^{2}{\left (e + f x \right )}}{2} + \frac {a^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} + \frac {a b x \sin ^{4}{\left (e + f x \right )}}{4} + \frac {a b x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{2} + \frac {a b x \cos ^{4}{\left (e + f x \right )}}{4} + \frac {a b \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{4 f} - \frac {a b \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{4 f} + \frac {b^{2} x \sin ^{6}{\left (e + f x \right )}}{16} + \frac {3 b^{2} x \sin ^{4}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{16} + \frac {3 b^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{4}{\left (e + f x \right )}}{16} + \frac {b^{2} x \cos ^{6}{\left (e + f x \right )}}{16} + \frac {b^{2} \sin ^{5}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{16 f} - \frac {b^{2} \sin ^{3}{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{6 f} - \frac {b^{2} \sin {\left (e + f x \right )} \cos ^{5}{\left (e + f x \right )}}{16 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin ^{2}{\left (e \right )}\right )^{2} \cos ^{2}{\left (e \right )} & \text {otherwise} \end {cases} \] Input:
integrate(cos(f*x+e)**2*(a+b*sin(f*x+e)**2)**2,x)
Output:
Piecewise((a**2*x*sin(e + f*x)**2/2 + a**2*x*cos(e + f*x)**2/2 + a**2*sin( e + f*x)*cos(e + f*x)/(2*f) + a*b*x*sin(e + f*x)**4/4 + a*b*x*sin(e + f*x) **2*cos(e + f*x)**2/2 + a*b*x*cos(e + f*x)**4/4 + a*b*sin(e + f*x)**3*cos( e + f*x)/(4*f) - a*b*sin(e + f*x)*cos(e + f*x)**3/(4*f) + b**2*x*sin(e + f *x)**6/16 + 3*b**2*x*sin(e + f*x)**4*cos(e + f*x)**2/16 + 3*b**2*x*sin(e + f*x)**2*cos(e + f*x)**4/16 + b**2*x*cos(e + f*x)**6/16 + b**2*sin(e + f*x )**5*cos(e + f*x)/(16*f) - b**2*sin(e + f*x)**3*cos(e + f*x)**3/(6*f) - b* *2*sin(e + f*x)*cos(e + f*x)**5/(16*f), Ne(f, 0)), (x*(a + b*sin(e)**2)**2 *cos(e)**2, True))
Time = 0.11 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.22 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {3 \, {\left (8 \, a^{2} + 4 \, a b + b^{2}\right )} {\left (f x + e\right )} + \frac {3 \, {\left (8 \, a^{2} + 4 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{5} + 8 \, {\left (6 \, a^{2} - b^{2}\right )} \tan \left (f x + e\right )^{3} + 3 \, {\left (8 \, a^{2} - 4 \, a b - b^{2}\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{6} + 3 \, \tan \left (f x + e\right )^{4} + 3 \, \tan \left (f x + e\right )^{2} + 1}}{48 \, f} \] Input:
integrate(cos(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x, algorithm="maxima")
Output:
1/48*(3*(8*a^2 + 4*a*b + b^2)*(f*x + e) + (3*(8*a^2 + 4*a*b + b^2)*tan(f*x + e)^5 + 8*(6*a^2 - b^2)*tan(f*x + e)^3 + 3*(8*a^2 - 4*a*b - b^2)*tan(f*x + e))/(tan(f*x + e)^6 + 3*tan(f*x + e)^4 + 3*tan(f*x + e)^2 + 1))/f
Time = 0.49 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.78 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {1}{16} \, {\left (8 \, a^{2} + 4 \, a b + b^{2}\right )} x + \frac {b^{2} \sin \left (6 \, f x + 6 \, e\right )}{192 \, f} - \frac {{\left (4 \, a b + b^{2}\right )} \sin \left (4 \, f x + 4 \, e\right )}{64 \, f} + \frac {{\left (16 \, a^{2} - b^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )}{64 \, f} \] Input:
integrate(cos(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x, algorithm="giac")
Output:
1/16*(8*a^2 + 4*a*b + b^2)*x + 1/192*b^2*sin(6*f*x + 6*e)/f - 1/64*(4*a*b + b^2)*sin(4*f*x + 4*e)/f + 1/64*(16*a^2 - b^2)*sin(2*f*x + 2*e)/f
Time = 37.55 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.15 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=x\,\left (\frac {a^2}{2}+\frac {a\,b}{4}+\frac {b^2}{16}\right )+\frac {\left (\frac {a^2}{2}+\frac {a\,b}{4}+\frac {b^2}{16}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^5+\left (a^2-\frac {b^2}{6}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (\frac {a^2}{2}-\frac {a\,b}{4}-\frac {b^2}{16}\right )\,\mathrm {tan}\left (e+f\,x\right )}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^6+3\,{\mathrm {tan}\left (e+f\,x\right )}^4+3\,{\mathrm {tan}\left (e+f\,x\right )}^2+1\right )} \] Input:
int(cos(e + f*x)^2*(a + b*sin(e + f*x)^2)^2,x)
Output:
x*((a*b)/4 + a^2/2 + b^2/16) + (tan(e + f*x)^3*(a^2 - b^2/6) - tan(e + f*x )*((a*b)/4 - a^2/2 + b^2/16) + tan(e + f*x)^5*((a*b)/4 + a^2/2 + b^2/16))/ (f*(3*tan(e + f*x)^2 + 3*tan(e + f*x)^4 + tan(e + f*x)^6 + 1))
Time = 0.17 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.27 \[ \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {8 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{5} b^{2}+24 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} a b -2 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} b^{2}+24 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a^{2}-12 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a b -3 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b^{2}+24 a^{2} f x +12 a b f x +3 b^{2} f x}{48 f} \] Input:
int(cos(f*x+e)^2*(a+b*sin(f*x+e)^2)^2,x)
Output:
(8*cos(e + f*x)*sin(e + f*x)**5*b**2 + 24*cos(e + f*x)*sin(e + f*x)**3*a*b - 2*cos(e + f*x)*sin(e + f*x)**3*b**2 + 24*cos(e + f*x)*sin(e + f*x)*a**2 - 12*cos(e + f*x)*sin(e + f*x)*a*b - 3*cos(e + f*x)*sin(e + f*x)*b**2 + 2 4*a**2*f*x + 12*a*b*f*x + 3*b**2*f*x)/(48*f)