Integrand size = 42, antiderivative size = 182 \[ \int \frac {(a+b \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx=\frac {2 \left (5 a^2 B+3 b^2 B+6 a b C\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (5 b^2 C+7 a (2 b B+a C)\right ) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{21 d}+\frac {2 \left (5 b^2 C+7 a (2 b B+a C)\right ) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 b (7 b B+9 a C) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{35 d}+\frac {2 b C \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{7 d} \] Output:
2/5*(5*B*a^2+3*B*b^2+6*C*a*b)*EllipticE(sin(1/2*d*x+1/2*c),2^(1/2))/d+2/21 *(5*C*b^2+7*a*(2*B*b+C*a))*InverseJacobiAM(1/2*d*x+1/2*c,2^(1/2))/d+2/21*( 5*C*b^2+7*a*(2*B*b+C*a))*cos(d*x+c)^(1/2)*sin(d*x+c)/d+2/35*b*(7*B*b+9*C*a )*cos(d*x+c)^(3/2)*sin(d*x+c)/d+2/7*b*C*cos(d*x+c)^(3/2)*(a+b*cos(d*x+c))* sin(d*x+c)/d
Time = 2.30 (sec) , antiderivative size = 139, normalized size of antiderivative = 0.76 \[ \int \frac {(a+b \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx=\frac {42 \left (5 a^2 B+3 b^2 B+6 a b C\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+10 \left (14 a b B+7 a^2 C+5 b^2 C\right ) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )+\sqrt {\cos (c+d x)} \left (42 b (b B+2 a C) \cos (c+d x)+5 \left (28 a b B+14 a^2 C+13 b^2 C+3 b^2 C \cos (2 (c+d x))\right )\right ) \sin (c+d x)}{105 d} \] Input:
Integrate[((a + b*Cos[c + d*x])^2*(B*Cos[c + d*x] + C*Cos[c + d*x]^2))/Sqr t[Cos[c + d*x]],x]
Output:
(42*(5*a^2*B + 3*b^2*B + 6*a*b*C)*EllipticE[(c + d*x)/2, 2] + 10*(14*a*b*B + 7*a^2*C + 5*b^2*C)*EllipticF[(c + d*x)/2, 2] + Sqrt[Cos[c + d*x]]*(42*b *(b*B + 2*a*C)*Cos[c + d*x] + 5*(28*a*b*B + 14*a^2*C + 13*b^2*C + 3*b^2*C* Cos[2*(c + d*x)]))*Sin[c + d*x])/(105*d)
Time = 1.02 (sec) , antiderivative size = 175, normalized size of antiderivative = 0.96, number of steps used = 15, number of rules used = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3042, 3508, 3042, 3469, 27, 3042, 3502, 27, 3042, 3227, 3042, 3115, 3042, 3119, 3120}
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 {(a+b \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^2 \left (B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}}dx\) |
\(\Big \downarrow \) 3508 |
\(\displaystyle \int \sqrt {\cos (c+d x)} (a+b \cos (c+d x))^2 (B+C \cos (c+d x))dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )} \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^2 \left (B+C \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx\) |
\(\Big \downarrow \) 3469 |
\(\displaystyle \frac {2}{7} \int \frac {1}{2} \sqrt {\cos (c+d x)} \left (b (7 b B+9 a C) \cos ^2(c+d x)+\left (5 C b^2+7 a (2 b B+a C)\right ) \cos (c+d x)+a (7 a B+3 b C)\right )dx+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{7} \int \sqrt {\cos (c+d x)} \left (b (7 b B+9 a C) \cos ^2(c+d x)+\left (5 C b^2+7 a (2 b B+a C)\right ) \cos (c+d x)+a (7 a B+3 b C)\right )dx+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{7} \int \sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )} \left (b (7 b B+9 a C) \sin \left (c+d x+\frac {\pi }{2}\right )^2+\left (5 C b^2+7 a (2 b B+a C)\right ) \sin \left (c+d x+\frac {\pi }{2}\right )+a (7 a B+3 b C)\right )dx+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \frac {1}{7} \left (\frac {2}{5} \int \frac {1}{2} \sqrt {\cos (c+d x)} \left (7 \left (5 B a^2+6 b C a+3 b^2 B\right )+5 \left (5 C b^2+7 a (2 b B+a C)\right ) \cos (c+d x)\right )dx+\frac {2 b (9 a C+7 b B) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \int \sqrt {\cos (c+d x)} \left (7 \left (5 B a^2+6 b C a+3 b^2 B\right )+5 \left (5 C b^2+7 a (2 b B+a C)\right ) \cos (c+d x)\right )dx+\frac {2 b (9 a C+7 b B) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \int \sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )} \left (7 \left (5 B a^2+6 b C a+3 b^2 B\right )+5 \left (5 C b^2+7 a (2 b B+a C)\right ) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {2 b (9 a C+7 b B) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (7 \left (5 a^2 B+6 a b C+3 b^2 B\right ) \int \sqrt {\cos (c+d x)}dx+5 \left (7 a (a C+2 b B)+5 b^2 C\right ) \int \cos ^{\frac {3}{2}}(c+d x)dx\right )+\frac {2 b (9 a C+7 b B) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (7 \left (5 a^2 B+6 a b C+3 b^2 B\right ) \int \sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}dx+5 \left (7 a (a C+2 b B)+5 b^2 C\right ) \int \sin \left (c+d x+\frac {\pi }{2}\right )^{3/2}dx\right )+\frac {2 b (9 a C+7 b B) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (7 \left (5 a^2 B+6 a b C+3 b^2 B\right ) \int \sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}dx+5 \left (7 a (a C+2 b B)+5 b^2 C\right ) \left (\frac {1}{3} \int \frac {1}{\sqrt {\cos (c+d x)}}dx+\frac {2 \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d}\right )\right )+\frac {2 b (9 a C+7 b B) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (7 \left (5 a^2 B+6 a b C+3 b^2 B\right ) \int \sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}dx+5 \left (7 a (a C+2 b B)+5 b^2 C\right ) \left (\frac {1}{3} \int \frac {1}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}}dx+\frac {2 \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d}\right )\right )+\frac {2 b (9 a C+7 b B) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
\(\Big \downarrow \) 3119 |
\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (5 \left (7 a (a C+2 b B)+5 b^2 C\right ) \left (\frac {1}{3} \int \frac {1}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}}dx+\frac {2 \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d}\right )+\frac {14 \left (5 a^2 B+6 a b C+3 b^2 B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}\right )+\frac {2 b (9 a C+7 b B) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
\(\Big \downarrow \) 3120 |
\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (\frac {14 \left (5 a^2 B+6 a b C+3 b^2 B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+5 \left (7 a (a C+2 b B)+5 b^2 C\right ) \left (\frac {2 \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{3 d}+\frac {2 \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d}\right )\right )+\frac {2 b (9 a C+7 b B) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d}\) |
Input:
Int[((a + b*Cos[c + d*x])^2*(B*Cos[c + d*x] + C*Cos[c + d*x]^2))/Sqrt[Cos[ c + d*x]],x]
Output:
(2*b*C*Cos[c + d*x]^(3/2)*(a + b*Cos[c + d*x])*Sin[c + d*x])/(7*d) + ((2*b *(7*b*B + 9*a*C)*Cos[c + d*x]^(3/2)*Sin[c + d*x])/(5*d) + ((14*(5*a^2*B + 3*b^2*B + 6*a*b*C)*EllipticE[(c + d*x)/2, 2])/d + 5*(5*b^2*C + 7*a*(2*b*B + a*C))*((2*EllipticF[(c + d*x)/2, 2])/(3*d) + (2*Sqrt[Cos[c + d*x]]*Sin[c + d*x])/(3*d)))/5)/7
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n) Int[(b*Sin [c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 2*n]
Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)* (c - Pi/2 + d*x), 2], x] /; FreeQ[{c, d}, x]
Int[1/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticF[(1/2 )*(c - Pi/2 + d*x), 2], x] /; FreeQ[{c, d}, x]
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b Int [(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si mp[(-b)*B*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m - 1)*((c + d*Sin[e + f*x])^( n + 1)/(d*f*(m + n + 1))), x] + Simp[1/(d*(m + n + 1)) Int[(a + b*Sin[e + f*x])^(m - 2)*(c + d*Sin[e + f*x])^n*Simp[a^2*A*d*(m + n + 1) + b*B*(b*c*( m - 1) + a*d*(n + 1)) + (a*d*(2*A*b + a*B)*(m + n + 1) - b*B*(a*c - b*d*(m + n)))*Sin[e + f*x] + b*(A*b*d*(m + n + 1) - B*(b*c*m - a*d*(2*m + n)))*Sin [e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 1] && !(IGt Q[n, 1] && ( !IntegerQ[m] || (EqQ[a, 0] && NeQ[c, 0])))
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_ .) + (f_.)*(x_)]^2), x_Symbol] :> Simp[1/b^2 Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*(b*B - a*C + b*C*Sin[e + f*x]), x], x] /; FreeQ [{a, b, c, d, e, f, A, B, C, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(547\) vs. \(2(169)=338\).
Time = 17.37 (sec) , antiderivative size = 548, normalized size of antiderivative = 3.01
method | result | size |
default | \(-\frac {2 \sqrt {\left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \left (240 C \,b^{2} \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (-168 B \,b^{2}-336 a b C -360 C \,b^{2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{6} \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (280 B a b +168 B \,b^{2}+140 a^{2} C +336 a b C +280 C \,b^{2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-140 B a b -42 B \,b^{2}-70 a^{2} C -84 a b C -80 C \,b^{2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+70 B a b \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-105 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a^{2}-63 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) b^{2}+35 a^{2} C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )+25 C \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-126 C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a b \right )}{105 \sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, d}\) | \(548\) |
parts | \(\text {Expression too large to display}\) | \(741\) |
Input:
int((a+b*cos(d*x+c))^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)/cos(d*x+c)^(1/2),x,me thod=_RETURNVERBOSE)
Output:
-2/105*((2*cos(1/2*d*x+1/2*c)^2-1)*sin(1/2*d*x+1/2*c)^2)^(1/2)*(240*C*b^2* cos(1/2*d*x+1/2*c)*sin(1/2*d*x+1/2*c)^8+(-168*B*b^2-336*C*a*b-360*C*b^2)*s in(1/2*d*x+1/2*c)^6*cos(1/2*d*x+1/2*c)+(280*B*a*b+168*B*b^2+140*C*a^2+336* C*a*b+280*C*b^2)*sin(1/2*d*x+1/2*c)^4*cos(1/2*d*x+1/2*c)+(-140*B*a*b-42*B* b^2-70*C*a^2-84*C*a*b-80*C*b^2)*sin(1/2*d*x+1/2*c)^2*cos(1/2*d*x+1/2*c)+70 *B*a*b*(sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*Ellip ticF(cos(1/2*d*x+1/2*c),2^(1/2))-105*B*(sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*sin (1/2*d*x+1/2*c)^2-1)^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))*a^2-63*B* (sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*EllipticE(co s(1/2*d*x+1/2*c),2^(1/2))*b^2+35*a^2*C*(sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*sin (1/2*d*x+1/2*c)^2-1)^(1/2)*EllipticF(cos(1/2*d*x+1/2*c),2^(1/2))+25*C*b^2* (sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*EllipticF(co s(1/2*d*x+1/2*c),2^(1/2))-126*C*(sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*sin(1/2*d* x+1/2*c)^2-1)^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))*a*b)/(-2*sin(1/2 *d*x+1/2*c)^4+sin(1/2*d*x+1/2*c)^2)^(1/2)/sin(1/2*d*x+1/2*c)/(2*cos(1/2*d* x+1/2*c)^2-1)^(1/2)/d
Result contains complex when optimal does not.
Time = 0.10 (sec) , antiderivative size = 243, normalized size of antiderivative = 1.34 \[ \int \frac {(a+b \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx=\frac {2 \, {\left (15 \, C b^{2} \cos \left (d x + c\right )^{2} + 35 \, C a^{2} + 70 \, B a b + 25 \, C b^{2} + 21 \, {\left (2 \, C a b + B b^{2}\right )} \cos \left (d x + c\right )\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) - 5 \, \sqrt {2} {\left (7 i \, C a^{2} + 14 i \, B a b + 5 i \, C b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) - 5 \, \sqrt {2} {\left (-7 i \, C a^{2} - 14 i \, B a b - 5 i \, C b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) - 21 \, \sqrt {2} {\left (-5 i \, B a^{2} - 6 i \, C a b - 3 i \, B b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 21 \, \sqrt {2} {\left (5 i \, B a^{2} + 6 i \, C a b + 3 i \, B b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right )}{105 \, d} \] Input:
integrate((a+b*cos(d*x+c))^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)/cos(d*x+c)^(1/2 ),x, algorithm="fricas")
Output:
1/105*(2*(15*C*b^2*cos(d*x + c)^2 + 35*C*a^2 + 70*B*a*b + 25*C*b^2 + 21*(2 *C*a*b + B*b^2)*cos(d*x + c))*sqrt(cos(d*x + c))*sin(d*x + c) - 5*sqrt(2)* (7*I*C*a^2 + 14*I*B*a*b + 5*I*C*b^2)*weierstrassPInverse(-4, 0, cos(d*x + c) + I*sin(d*x + c)) - 5*sqrt(2)*(-7*I*C*a^2 - 14*I*B*a*b - 5*I*C*b^2)*wei erstrassPInverse(-4, 0, cos(d*x + c) - I*sin(d*x + c)) - 21*sqrt(2)*(-5*I* B*a^2 - 6*I*C*a*b - 3*I*B*b^2)*weierstrassZeta(-4, 0, weierstrassPInverse( -4, 0, cos(d*x + c) + I*sin(d*x + c))) - 21*sqrt(2)*(5*I*B*a^2 + 6*I*C*a*b + 3*I*B*b^2)*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(d*x + c) - I*sin(d*x + c))))/d
Timed out. \[ \int \frac {(a+b \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx=\text {Timed out} \] Input:
integrate((a+b*cos(d*x+c))**2*(B*cos(d*x+c)+C*cos(d*x+c)**2)/cos(d*x+c)**( 1/2),x)
Output:
Timed out
\[ \int \frac {(a+b \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx=\int { \frac {{\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )\right )} {\left (b \cos \left (d x + c\right ) + a\right )}^{2}}{\sqrt {\cos \left (d x + c\right )}} \,d x } \] Input:
integrate((a+b*cos(d*x+c))^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)/cos(d*x+c)^(1/2 ),x, algorithm="maxima")
Output:
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c))*(b*cos(d*x + c) + a)^2/sqrt( cos(d*x + c)), x)
\[ \int \frac {(a+b \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx=\int { \frac {{\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )\right )} {\left (b \cos \left (d x + c\right ) + a\right )}^{2}}{\sqrt {\cos \left (d x + c\right )}} \,d x } \] Input:
integrate((a+b*cos(d*x+c))^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)/cos(d*x+c)^(1/2 ),x, algorithm="giac")
Output:
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c))*(b*cos(d*x + c) + a)^2/sqrt( cos(d*x + c)), x)
Time = 1.13 (sec) , antiderivative size = 229, normalized size of antiderivative = 1.26 \[ \int \frac {(a+b \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx=\frac {2\,C\,a^2\,\left (\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )+\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )\right )}{3\,d}+\frac {2\,B\,a^2\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,B\,a\,b\,\left (\frac {2\,\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )}{3}+\frac {2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{3}\right )}{d}-\frac {2\,B\,b^2\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {2\,C\,b^2\,{\cos \left (c+d\,x\right )}^{9/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {9}{4};\ \frac {13}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{9\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {4\,C\,a\,b\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}} \] Input:
int(((B*cos(c + d*x) + C*cos(c + d*x)^2)*(a + b*cos(c + d*x))^2)/cos(c + d *x)^(1/2),x)
Output:
(2*C*a^2*(cos(c + d*x)^(1/2)*sin(c + d*x) + ellipticF(c/2 + (d*x)/2, 2)))/ (3*d) + (2*B*a^2*ellipticE(c/2 + (d*x)/2, 2))/d + (2*B*a*b*((2*cos(c + d*x )^(1/2)*sin(c + d*x))/3 + (2*ellipticF(c/2 + (d*x)/2, 2))/3))/d - (2*B*b^2 *cos(c + d*x)^(7/2)*sin(c + d*x)*hypergeom([1/2, 7/4], 11/4, cos(c + d*x)^ 2))/(7*d*(sin(c + d*x)^2)^(1/2)) - (2*C*b^2*cos(c + d*x)^(9/2)*sin(c + d*x )*hypergeom([1/2, 9/4], 13/4, cos(c + d*x)^2))/(9*d*(sin(c + d*x)^2)^(1/2) ) - (4*C*a*b*cos(c + d*x)^(7/2)*sin(c + d*x)*hypergeom([1/2, 7/4], 11/4, c os(c + d*x)^2))/(7*d*(sin(c + d*x)^2)^(1/2))
\[ \int \frac {(a+b \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx=\left (\int \sqrt {\cos \left (d x +c \right )}d x \right ) a^{2} b +\left (\int \sqrt {\cos \left (d x +c \right )}\, \cos \left (d x +c \right )d x \right ) a^{2} c +2 \left (\int \sqrt {\cos \left (d x +c \right )}\, \cos \left (d x +c \right )d x \right ) a \,b^{2}+\left (\int \sqrt {\cos \left (d x +c \right )}\, \cos \left (d x +c \right )^{3}d x \right ) b^{2} c +2 \left (\int \sqrt {\cos \left (d x +c \right )}\, \cos \left (d x +c \right )^{2}d x \right ) a b c +\left (\int \sqrt {\cos \left (d x +c \right )}\, \cos \left (d x +c \right )^{2}d x \right ) b^{3} \] Input:
int((a+b*cos(d*x+c))^2*(B*cos(d*x+c)+C*cos(d*x+c)^2)/cos(d*x+c)^(1/2),x)
Output:
int(sqrt(cos(c + d*x)),x)*a**2*b + int(sqrt(cos(c + d*x))*cos(c + d*x),x)* a**2*c + 2*int(sqrt(cos(c + d*x))*cos(c + d*x),x)*a*b**2 + int(sqrt(cos(c + d*x))*cos(c + d*x)**3,x)*b**2*c + 2*int(sqrt(cos(c + d*x))*cos(c + d*x)* *2,x)*a*b*c + int(sqrt(cos(c + d*x))*cos(c + d*x)**2,x)*b**3