Integrand size = 21, antiderivative size = 75 \[ \int \sqrt {a \cos (c+d x)+b \sin (c+d x)} \, dx=\frac {2 E\left (\left .\frac {1}{2} \left (c+d x-\tan ^{-1}(a,b)\right )\right |2\right ) \sqrt {a \cos (c+d x)+b \sin (c+d x)}}{d \sqrt {\frac {a \cos (c+d x)+b \sin (c+d x)}{\sqrt {a^2+b^2}}}} \] Output:
2*EllipticE(sin(1/2*c+1/2*d*x-1/2*arctan(b,a)),2^(1/2))*(a*cos(d*x+c)+b*si n(d*x+c))^(1/2)/d/((a*cos(d*x+c)+b*sin(d*x+c))/(a^2+b^2)^(1/2))^(1/2)
Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.
Time = 0.95 (sec) , antiderivative size = 268, normalized size of antiderivative = 3.57 \[ \int \sqrt {a \cos (c+d x)+b \sin (c+d x)} \, dx=\frac {\cos \left (c+d x-\arctan \left (\frac {b}{a}\right )\right ) \left (-b \left (a^2+b^2\right ) \, _2F_1\left (-\frac {1}{2},-\frac {1}{4};\frac {3}{4};\cos ^2\left (c+d x-\arctan \left (\frac {b}{a}\right )\right )\right ) \sin \left (c+d x-\arctan \left (\frac {b}{a}\right )\right )+\sqrt {\sin ^2\left (c+d x-\arctan \left (\frac {b}{a}\right )\right )} \left (-2 a \left (a^2+b^2\right ) \cos \left (c+d x-\arctan \left (\frac {b}{a}\right )\right )+2 a^2 \sqrt {1+\frac {b^2}{a^2}} \sqrt {a \sqrt {1+\frac {b^2}{a^2}} \cos \left (c+d x-\arctan \left (\frac {b}{a}\right )\right )} \sqrt {a \cos (c+d x)+b \sin (c+d x)}+b \left (a^2+b^2\right ) \sin \left (c+d x-\arctan \left (\frac {b}{a}\right )\right )\right )\right )}{b d \left (a \sqrt {1+\frac {b^2}{a^2}} \cos \left (c+d x-\arctan \left (\frac {b}{a}\right )\right )\right )^{3/2} \sqrt {\sin ^2\left (c+d x-\arctan \left (\frac {b}{a}\right )\right )}} \] Input:
Integrate[Sqrt[a*Cos[c + d*x] + b*Sin[c + d*x]],x]
Output:
(Cos[c + d*x - ArcTan[b/a]]*(-(b*(a^2 + b^2)*HypergeometricPFQ[{-1/2, -1/4 }, {3/4}, Cos[c + d*x - ArcTan[b/a]]^2]*Sin[c + d*x - ArcTan[b/a]]) + Sqrt [Sin[c + d*x - ArcTan[b/a]]^2]*(-2*a*(a^2 + b^2)*Cos[c + d*x - ArcTan[b/a] ] + 2*a^2*Sqrt[1 + b^2/a^2]*Sqrt[a*Sqrt[1 + b^2/a^2]*Cos[c + d*x - ArcTan[ b/a]]]*Sqrt[a*Cos[c + d*x] + b*Sin[c + d*x]] + b*(a^2 + b^2)*Sin[c + d*x - ArcTan[b/a]])))/(b*d*(a*Sqrt[1 + b^2/a^2]*Cos[c + d*x - ArcTan[b/a]])^(3/ 2)*Sqrt[Sin[c + d*x - ArcTan[b/a]]^2])
Time = 0.28 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 3557, 3042, 3119}
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 {a \cos (c+d x)+b \sin (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sqrt {a \cos (c+d x)+b \sin (c+d x)}dx\) |
\(\Big \downarrow \) 3557 |
\(\displaystyle \frac {\sqrt {a \cos (c+d x)+b \sin (c+d x)} \int \sqrt {\cos \left (c+d x-\tan ^{-1}(a,b)\right )}dx}{\sqrt {\frac {a \cos (c+d x)+b \sin (c+d x)}{\sqrt {a^2+b^2}}}}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\sqrt {a \cos (c+d x)+b \sin (c+d x)} \int \sqrt {\sin \left (c+d x-\tan ^{-1}(a,b)+\frac {\pi }{2}\right )}dx}{\sqrt {\frac {a \cos (c+d x)+b \sin (c+d x)}{\sqrt {a^2+b^2}}}}\) |
\(\Big \downarrow \) 3119 |
\(\displaystyle \frac {2 \sqrt {a \cos (c+d x)+b \sin (c+d x)} E\left (\left .\frac {1}{2} \left (c+d x-\tan ^{-1}(a,b)\right )\right |2\right )}{d \sqrt {\frac {a \cos (c+d x)+b \sin (c+d x)}{\sqrt {a^2+b^2}}}}\) |
Input:
Int[Sqrt[a*Cos[c + d*x] + b*Sin[c + d*x]],x]
Output:
(2*EllipticE[(c + d*x - ArcTan[a, b])/2, 2]*Sqrt[a*Cos[c + d*x] + b*Sin[c + d*x]])/(d*Sqrt[(a*Cos[c + d*x] + b*Sin[c + d*x])/Sqrt[a^2 + b^2]])
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[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x _Symbol] :> Simp[(a*Cos[c + d*x] + b*Sin[c + d*x])^n/((a*Cos[c + d*x] + b*S in[c + d*x])/Sqrt[a^2 + b^2])^n Int[Cos[c + d*x - ArcTan[a, b]]^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && !(GeQ[n, 1] || LeQ[n, -1]) && !(GtQ[a^2 + b^2, 0] || EqQ[a^2 + b^2, 0])
Leaf count of result is larger than twice the leaf count of optimal. \(162\) vs. \(2(71)=142\).
Time = 0.87 (sec) , antiderivative size = 163, normalized size of antiderivative = 2.17
method | result | size |
default | \(-\frac {\sqrt {a^{2}+b^{2}}\, \sqrt {-\sin \left (d x +c -\arctan \left (-a , b\right )\right )+1}\, \sqrt {2 \sin \left (d x +c -\arctan \left (-a , b\right )\right )+2}\, \sqrt {\sin \left (d x +c -\arctan \left (-a , b\right )\right )}\, \left (2 \operatorname {EllipticE}\left (\sqrt {-\sin \left (d x +c -\arctan \left (-a , b\right )\right )+1}, \frac {\sqrt {2}}{2}\right )-\operatorname {EllipticF}\left (\sqrt {-\sin \left (d x +c -\arctan \left (-a , b\right )\right )+1}, \frac {\sqrt {2}}{2}\right )\right )}{\cos \left (d x +c -\arctan \left (-a , b\right )\right ) \sqrt {\sin \left (d x +c -\arctan \left (-a , b\right )\right ) \sqrt {a^{2}+b^{2}}}\, d}\) | \(163\) |
risch | \(\text {Expression too large to display}\) | \(1175\) |
Input:
int((cos(d*x+c)*a+b*sin(d*x+c))^(1/2),x,method=_RETURNVERBOSE)
Output:
-(a^2+b^2)^(1/2)*(-sin(d*x+c-arctan(-a,b))+1)^(1/2)*(2*sin(d*x+c-arctan(-a ,b))+2)^(1/2)*sin(d*x+c-arctan(-a,b))^(1/2)*(2*EllipticE((-sin(d*x+c-arcta n(-a,b))+1)^(1/2),1/2*2^(1/2))-EllipticF((-sin(d*x+c-arctan(-a,b))+1)^(1/2 ),1/2*2^(1/2)))/cos(d*x+c-arctan(-a,b))/(sin(d*x+c-arctan(-a,b))*(a^2+b^2) ^(1/2))^(1/2)/d
Result contains complex when optimal does not.
Time = 0.08 (sec) , antiderivative size = 162, normalized size of antiderivative = 2.16 \[ \int \sqrt {a \cos (c+d x)+b \sin (c+d x)} \, dx=-\frac {2 \, {\left (-i \, \sqrt {\frac {1}{2} \, a - \frac {1}{2} i \, b} {\rm weierstrassZeta}\left (-\frac {4 \, {\left (a^{2} + 2 i \, a b - b^{2}\right )}}{a^{2} + b^{2}}, 0, {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (a^{2} + 2 i \, a b - b^{2}\right )}}{a^{2} + b^{2}}, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) + i \, \sqrt {\frac {1}{2} \, a + \frac {1}{2} i \, b} {\rm weierstrassZeta}\left (-\frac {4 \, {\left (a^{2} - 2 i \, a b - b^{2}\right )}}{a^{2} + b^{2}}, 0, {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (a^{2} - 2 i \, a b - b^{2}\right )}}{a^{2} + b^{2}}, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right )\right )}}{d} \] Input:
integrate((a*cos(d*x+c)+b*sin(d*x+c))^(1/2),x, algorithm="fricas")
Output:
-2*(-I*sqrt(1/2*a - 1/2*I*b)*weierstrassZeta(-4*(a^2 + 2*I*a*b - b^2)/(a^2 + b^2), 0, weierstrassPInverse(-4*(a^2 + 2*I*a*b - b^2)/(a^2 + b^2), 0, c os(d*x + c) + I*sin(d*x + c))) + I*sqrt(1/2*a + 1/2*I*b)*weierstrassZeta(- 4*(a^2 - 2*I*a*b - b^2)/(a^2 + b^2), 0, weierstrassPInverse(-4*(a^2 - 2*I* a*b - b^2)/(a^2 + b^2), 0, cos(d*x + c) - I*sin(d*x + c))))/d
\[ \int \sqrt {a \cos (c+d x)+b \sin (c+d x)} \, dx=\int \sqrt {a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}}\, dx \] Input:
integrate((a*cos(d*x+c)+b*sin(d*x+c))**(1/2),x)
Output:
Integral(sqrt(a*cos(c + d*x) + b*sin(c + d*x)), x)
\[ \int \sqrt {a \cos (c+d x)+b \sin (c+d x)} \, dx=\int { \sqrt {a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )} \,d x } \] Input:
integrate((a*cos(d*x+c)+b*sin(d*x+c))^(1/2),x, algorithm="maxima")
Output:
integrate(sqrt(a*cos(d*x + c) + b*sin(d*x + c)), x)
\[ \int \sqrt {a \cos (c+d x)+b \sin (c+d x)} \, dx=\int { \sqrt {a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )} \,d x } \] Input:
integrate((a*cos(d*x+c)+b*sin(d*x+c))^(1/2),x, algorithm="giac")
Output:
integrate(sqrt(a*cos(d*x + c) + b*sin(d*x + c)), x)
Timed out. \[ \int \sqrt {a \cos (c+d x)+b \sin (c+d x)} \, dx=\int \sqrt {a\,\cos \left (c+d\,x\right )+b\,\sin \left (c+d\,x\right )} \,d x \] Input:
int((a*cos(c + d*x) + b*sin(c + d*x))^(1/2),x)
Output:
int((a*cos(c + d*x) + b*sin(c + d*x))^(1/2), x)
\[ \int \sqrt {a \cos (c+d x)+b \sin (c+d x)} \, dx=\frac {-2 \sqrt {\cos \left (d x +c \right ) a +\sin \left (d x +c \right ) b}\, b +\left (\int \frac {\sqrt {\cos \left (d x +c \right ) a +\sin \left (d x +c \right ) b}\, \cos \left (d x +c \right )}{\cos \left (d x +c \right ) a +\sin \left (d x +c \right ) b}d x \right ) a^{2} d +\left (\int \frac {\sqrt {\cos \left (d x +c \right ) a +\sin \left (d x +c \right ) b}\, \cos \left (d x +c \right )}{\cos \left (d x +c \right ) a +\sin \left (d x +c \right ) b}d x \right ) b^{2} d}{a d} \] Input:
int((a*cos(d*x+c)+b*sin(d*x+c))^(1/2),x)
Output:
( - 2*sqrt(cos(c + d*x)*a + sin(c + d*x)*b)*b + int((sqrt(cos(c + d*x)*a + sin(c + d*x)*b)*cos(c + d*x))/(cos(c + d*x)*a + sin(c + d*x)*b),x)*a**2*d + int((sqrt(cos(c + d*x)*a + sin(c + d*x)*b)*cos(c + d*x))/(cos(c + d*x)* a + sin(c + d*x)*b),x)*b**2*d)/(a*d)