Integrand size = 41, antiderivative size = 156 \[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\frac {2 (5 A b+5 a B+3 b C) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 (b B+a (3 A+C)) \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {2 b C \sin (c+d x)}{5 d \sec ^{\frac {3}{2}}(c+d x)}+\frac {2 (b B+a C) \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}} \] Output:
2/5*(5*A*b+5*B*a+3*C*b)*cos(d*x+c)^(1/2)*EllipticE(sin(1/2*d*x+1/2*c),2^(1 /2))*sec(d*x+c)^(1/2)/d+2/3*(B*b+a*(3*A+C))*cos(d*x+c)^(1/2)*InverseJacobi AM(1/2*d*x+1/2*c,2^(1/2))*sec(d*x+c)^(1/2)/d+2/5*b*C*sin(d*x+c)/d/sec(d*x+ c)^(3/2)+2/3*(B*b+C*a)*sin(d*x+c)/d/sec(d*x+c)^(1/2)
Time = 1.77 (sec) , antiderivative size = 116, normalized size of antiderivative = 0.74 \[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\frac {\sqrt {\sec (c+d x)} \left (6 (5 A b+5 a B+3 b C) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+10 (3 a A+b B+a C) \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )+(5 b B+5 a C+3 b C \cos (c+d x)) \sin (2 (c+d x))\right )}{15 d} \] Input:
Integrate[(a + b*Cos[c + d*x])*(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sqr t[Sec[c + d*x]],x]
Output:
(Sqrt[Sec[c + d*x]]*(6*(5*A*b + 5*a*B + 3*b*C)*Sqrt[Cos[c + d*x]]*Elliptic E[(c + d*x)/2, 2] + 10*(3*a*A + b*B + a*C)*Sqrt[Cos[c + d*x]]*EllipticF[(c + d*x)/2, 2] + (5*b*B + 5*a*C + 3*b*C*Cos[c + d*x])*Sin[2*(c + d*x)]))/(1 5*d)
Time = 0.86 (sec) , antiderivative size = 143, normalized size of antiderivative = 0.92, number of steps used = 13, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.317, Rules used = {3042, 4709, 3042, 3512, 27, 3042, 3502, 27, 3042, 3227, 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 \sqrt {\sec (c+d x)} (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sqrt {\sec (c+d x)} (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos (c+d x)^2\right )dx\) |
\(\Big \downarrow \) 4709 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \int \frac {(a+b \cos (c+d x)) \left (C \cos ^2(c+d x)+B \cos (c+d x)+A\right )}{\sqrt {\cos (c+d x)}}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \int \frac {\left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (C \sin \left (c+d x+\frac {\pi }{2}\right )^2+B \sin \left (c+d x+\frac {\pi }{2}\right )+A\right )}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}}dx\) |
\(\Big \downarrow \) 3512 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \left (\frac {2}{5} \int \frac {5 (b B+a C) \cos ^2(c+d x)+(5 A b+3 C b+5 a B) \cos (c+d x)+5 a A}{2 \sqrt {\cos (c+d x)}}dx+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \left (\frac {1}{5} \int \frac {5 (b B+a C) \cos ^2(c+d x)+(5 A b+3 C b+5 a B) \cos (c+d x)+5 a A}{\sqrt {\cos (c+d x)}}dx+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \left (\frac {1}{5} \int \frac {5 (b B+a C) \sin \left (c+d x+\frac {\pi }{2}\right )^2+(5 A b+3 C b+5 a B) \sin \left (c+d x+\frac {\pi }{2}\right )+5 a A}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}}dx+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \left (\frac {1}{5} \left (\frac {2}{3} \int \frac {5 (b B+a (3 A+C))+3 (5 A b+3 C b+5 a B) \cos (c+d x)}{2 \sqrt {\cos (c+d x)}}dx+\frac {10 (a C+b B) \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \left (\frac {1}{5} \left (\frac {1}{3} \int \frac {5 (b B+a (3 A+C))+3 (5 A b+3 C b+5 a B) \cos (c+d x)}{\sqrt {\cos (c+d x)}}dx+\frac {10 (a C+b B) \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \left (\frac {1}{5} \left (\frac {1}{3} \int \frac {5 (b B+a (3 A+C))+3 (5 A b+3 C b+5 a B) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}}dx+\frac {10 (a C+b B) \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \left (\frac {1}{5} \left (\frac {1}{3} \left (5 (a (3 A+C)+b B) \int \frac {1}{\sqrt {\cos (c+d x)}}dx+3 (5 a B+5 A b+3 b C) \int \sqrt {\cos (c+d x)}dx\right )+\frac {10 (a C+b B) \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \left (\frac {1}{5} \left (\frac {1}{3} \left (5 (a (3 A+C)+b B) \int \frac {1}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}}dx+3 (5 a B+5 A b+3 b C) \int \sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}dx\right )+\frac {10 (a C+b B) \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )\) |
\(\Big \downarrow \) 3119 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \left (\frac {1}{5} \left (\frac {1}{3} \left (5 (a (3 A+C)+b B) \int \frac {1}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )}}dx+\frac {6 E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) (5 a B+5 A b+3 b C)}{d}\right )+\frac {10 (a C+b B) \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )\) |
\(\Big \downarrow \) 3120 |
\(\displaystyle \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \left (\frac {1}{5} \left (\frac {1}{3} \left (\frac {10 \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) (a (3 A+C)+b B)}{d}+\frac {6 E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) (5 a B+5 A b+3 b C)}{d}\right )+\frac {10 (a C+b B) \sin (c+d x) \sqrt {\cos (c+d x)}}{3 d}\right )+\frac {2 b C \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{5 d}\right )\) |
Input:
Int[(a + b*Cos[c + d*x])*(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sqrt[Sec[ c + d*x]],x]
Output:
Sqrt[Cos[c + d*x]]*Sqrt[Sec[c + d*x]]*((2*b*C*Cos[c + d*x]^(3/2)*Sin[c + d *x])/(5*d) + (((6*(5*A*b + 5*a*B + 3*b*C)*EllipticE[(c + d*x)/2, 2])/d + ( 10*(b*B + a*(3*A + C))*EllipticF[(c + d*x)/2, 2])/d)/3 + (10*(b*B + a*C)*S qrt[Cos[c + d*x]]*Sin[c + d*x])/(3*d))/5)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
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_.)*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_)])*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f _.)*(x_)]^2), x_Symbol] :> Simp[(-C)*d*Cos[e + f*x]*Sin[e + f*x]*((a + b*Si n[e + f*x])^(m + 1)/(b*f*(m + 3))), x] + Simp[1/(b*(m + 3)) Int[(a + b*Si n[e + f*x])^m*Simp[a*C*d + A*b*c*(m + 3) + b*(B*c*(m + 3) + d*(C*(m + 2) + A*(m + 3)))*Sin[e + f*x] - (2*a*C*d - b*(c*C + B*d)*(m + 3))*Sin[e + f*x]^2 , x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && !LtQ[m, -1]
Int[(u_)*((c_.)*sec[(a_.) + (b_.)*(x_)])^(m_.), x_Symbol] :> Simp[(c*Sec[a + b*x])^m*(c*Cos[a + b*x])^m Int[ActivateTrig[u]/(c*Cos[a + b*x])^m, x], x] /; FreeQ[{a, b, c, m}, x] && !IntegerQ[m] && KnownSineIntegrandQ[u, x]
Leaf count of result is larger than twice the leaf count of optimal. \(464\) vs. \(2(139)=278\).
Time = 6.57 (sec) , antiderivative size = 465, normalized size of antiderivative = 2.98
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 (-24 C b \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (20 B b +20 C a +24 C b \right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-10 B b -10 C a -6 C b \right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+15 A \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a -15 A \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) b +5 B 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 )-15 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 +5 C \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a -9 C \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) b \right )}{15 \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}\) | \(465\) |
parts | \(-\frac {2 a A \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}}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \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 )}{\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}+\frac {2 \left (A b +B a \right ) \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}}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \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 )}{\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}-\frac {2 \left (B b +C a \right ) \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 (4 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\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 )\right )}{3 \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}-\frac {2 C b \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 (-8 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{6} \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+8 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-3 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\right )}{5 \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}\) | \(663\) |
Input:
int((a+b*cos(d*x+c))*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^(1/2),x,me thod=_RETURNVERBOSE)
Output:
-2/15*((2*cos(1/2*d*x+1/2*c)^2-1)*sin(1/2*d*x+1/2*c)^2)^(1/2)*(-24*C*b*cos (1/2*d*x+1/2*c)*sin(1/2*d*x+1/2*c)^6+(20*B*b+20*C*a+24*C*b)*sin(1/2*d*x+1/ 2*c)^4*cos(1/2*d*x+1/2*c)+(-10*B*b-10*C*a-6*C*b)*sin(1/2*d*x+1/2*c)^2*cos( 1/2*d*x+1/2*c)+15*A*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*(sin(1/2*d*x+1/2*c)^2 )^(1/2)*EllipticF(cos(1/2*d*x+1/2*c),2^(1/2))*a-15*A*(2*sin(1/2*d*x+1/2*c) ^2-1)^(1/2)*(sin(1/2*d*x+1/2*c)^2)^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),2^(1 /2))*b+5*B*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) *EllipticF(cos(1/2*d*x+1/2*c),2^(1/2))-15*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+5* C*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*(sin(1/2*d*x+1/2*c)^2)^(1/2)*EllipticF( cos(1/2*d*x+1/2*c),2^(1/2))*a-9*C*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*(sin(1/ 2*d*x+1/2*c)^2)^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))*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.11 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.31 \[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=-\frac {5 \, \sqrt {2} {\left (i \, {\left (3 \, A + C\right )} a + i \, B b\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + 5 \, \sqrt {2} {\left (-i \, {\left (3 \, A + C\right )} a - i \, B b\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + 3 \, \sqrt {2} {\left (-5 i \, B a - i \, {\left (5 \, A + 3 \, C\right )} b\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 ) + 3 \, \sqrt {2} {\left (5 i \, B a + i \, {\left (5 \, A + 3 \, C\right )} b\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 ) - \frac {2 \, {\left (3 \, C b \cos \left (d x + c\right )^{2} + 5 \, {\left (C a + B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}}}{15 \, d} \] Input:
integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^(1/2 ),x, algorithm="fricas")
Output:
-1/15*(5*sqrt(2)*(I*(3*A + C)*a + I*B*b)*weierstrassPInverse(-4, 0, cos(d* x + c) + I*sin(d*x + c)) + 5*sqrt(2)*(-I*(3*A + C)*a - I*B*b)*weierstrassP Inverse(-4, 0, cos(d*x + c) - I*sin(d*x + c)) + 3*sqrt(2)*(-5*I*B*a - I*(5 *A + 3*C)*b)*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(d*x + c ) + I*sin(d*x + c))) + 3*sqrt(2)*(5*I*B*a + I*(5*A + 3*C)*b)*weierstrassZe ta(-4, 0, weierstrassPInverse(-4, 0, cos(d*x + c) - I*sin(d*x + c))) - 2*( 3*C*b*cos(d*x + c)^2 + 5*(C*a + B*b)*cos(d*x + c))*sin(d*x + c)/sqrt(cos(d *x + c)))/d
\[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\int \left (a + b \cos {\left (c + d x \right )}\right ) \left (A + B \cos {\left (c + d x \right )} + C \cos ^{2}{\left (c + d x \right )}\right ) \sqrt {\sec {\left (c + d x \right )}}\, dx \] Input:
integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)**(1 /2),x)
Output:
Integral((a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*cos(c + d*x)**2)*sqr t(sec(c + d*x)), x)
\[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} {\left (b \cos \left (d x + c\right ) + a\right )} \sqrt {\sec \left (d x + c\right )} \,d x } \] Input:
integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^(1/2 ),x, algorithm="maxima")
Output:
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c) + A)*(b*cos(d*x + c) + a)*sqr t(sec(d*x + c)), x)
\[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} {\left (b \cos \left (d x + c\right ) + a\right )} \sqrt {\sec \left (d x + c\right )} \,d x } \] Input:
integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^(1/2 ),x, algorithm="giac")
Output:
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c) + A)*(b*cos(d*x + c) + a)*sqr t(sec(d*x + c)), x)
Timed out. \[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\int \sqrt {\frac {1}{\cos \left (c+d\,x\right )}}\,\left (a+b\,\cos \left (c+d\,x\right )\right )\,\left (C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )+A\right ) \,d x \] Input:
int((1/cos(c + d*x))^(1/2)*(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*co s(c + d*x)^2),x)
Output:
int((1/cos(c + d*x))^(1/2)*(a + b*cos(c + d*x))*(A + B*cos(c + d*x) + C*co s(c + d*x)^2), x)
\[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx=\left (\int \sqrt {\sec \left (d x +c \right )}d x \right ) a^{2}+2 \left (\int \sqrt {\sec \left (d x +c \right )}\, \cos \left (d x +c \right )d x \right ) a b +\left (\int \sqrt {\sec \left (d x +c \right )}\, \cos \left (d x +c \right )^{3}d x \right ) b c +\left (\int \sqrt {\sec \left (d x +c \right )}\, \cos \left (d x +c \right )^{2}d x \right ) a c +\left (\int \sqrt {\sec \left (d x +c \right )}\, \cos \left (d x +c \right )^{2}d x \right ) b^{2} \] Input:
int((a+b*cos(d*x+c))*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^(1/2),x)
Output:
int(sqrt(sec(c + d*x)),x)*a**2 + 2*int(sqrt(sec(c + d*x))*cos(c + d*x),x)* a*b + int(sqrt(sec(c + d*x))*cos(c + d*x)**3,x)*b*c + int(sqrt(sec(c + d*x ))*cos(c + d*x)**2,x)*a*c + int(sqrt(sec(c + d*x))*cos(c + d*x)**2,x)*b**2