Integrand size = 23, antiderivative size = 89 \[ \int \cot ^2(e+f x) \sqrt {a+a \sin (e+f x)} \, dx=-\frac {\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{f}+\frac {3 a \cos (e+f x)}{f \sqrt {a+a \sin (e+f x)}}-\frac {\cot (e+f x) \sqrt {a+a \sin (e+f x)}}{f} \] Output:
-a^(1/2)*arctanh(a^(1/2)*cos(f*x+e)/(a+a*sin(f*x+e))^(1/2))/f+3*a*cos(f*x+ e)/f/(a+a*sin(f*x+e))^(1/2)-cot(f*x+e)*(a+a*sin(f*x+e))^(1/2)/f
Leaf count is larger than twice the leaf count of optimal. \(206\) vs. \(2(89)=178\).
Time = 1.47 (sec) , antiderivative size = 206, normalized size of antiderivative = 2.31 \[ \int \cot ^2(e+f x) \sqrt {a+a \sin (e+f x)} \, dx=\frac {\csc ^4\left (\frac {1}{2} (e+f x)\right ) \sqrt {a (1+\sin (e+f x))} \left (-4 \cos \left (\frac {1}{2} (e+f x)\right )+2 \cos \left (\frac {3}{2} (e+f x)\right )+4 \sin \left (\frac {1}{2} (e+f x)\right )-\log \left (1+\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sin (e+f x)+\log \left (1-\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sin (e+f x)+2 \sin \left (\frac {3}{2} (e+f x)\right )\right )}{f \left (1+\cot \left (\frac {1}{2} (e+f x)\right )\right ) \left (\csc \left (\frac {1}{4} (e+f x)\right )-\sec \left (\frac {1}{4} (e+f x)\right )\right ) \left (\csc \left (\frac {1}{4} (e+f x)\right )+\sec \left (\frac {1}{4} (e+f x)\right )\right )} \] Input:
Integrate[Cot[e + f*x]^2*Sqrt[a + a*Sin[e + f*x]],x]
Output:
(Csc[(e + f*x)/2]^4*Sqrt[a*(1 + Sin[e + f*x])]*(-4*Cos[(e + f*x)/2] + 2*Co s[(3*(e + f*x))/2] + 4*Sin[(e + f*x)/2] - Log[1 + Cos[(e + f*x)/2] - Sin[( e + f*x)/2]]*Sin[e + f*x] + Log[1 - Cos[(e + f*x)/2] + Sin[(e + f*x)/2]]*S in[e + f*x] + 2*Sin[(3*(e + f*x))/2]))/(f*(1 + Cot[(e + f*x)/2])*(Csc[(e + f*x)/4] - Sec[(e + f*x)/4])*(Csc[(e + f*x)/4] + Sec[(e + f*x)/4]))
Time = 0.54 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.11, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {3042, 3195, 27, 3042, 3460, 3042, 3252, 219}
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 \cot ^2(e+f x) \sqrt {a \sin (e+f x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sqrt {a \sin (e+f x)+a}}{\tan (e+f x)^2}dx\) |
\(\Big \downarrow \) 3195 |
\(\displaystyle \frac {\int \frac {1}{2} \csc (e+f x) (a-3 a \sin (e+f x)) \sqrt {\sin (e+f x) a+a}dx}{a}-\frac {\cot (e+f x) \sqrt {a \sin (e+f x)+a}}{f}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\int \csc (e+f x) (a-3 a \sin (e+f x)) \sqrt {\sin (e+f x) a+a}dx}{2 a}-\frac {\cot (e+f x) \sqrt {a \sin (e+f x)+a}}{f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {(a-3 a \sin (e+f x)) \sqrt {\sin (e+f x) a+a}}{\sin (e+f x)}dx}{2 a}-\frac {\cot (e+f x) \sqrt {a \sin (e+f x)+a}}{f}\) |
\(\Big \downarrow \) 3460 |
\(\displaystyle \frac {a \int \csc (e+f x) \sqrt {\sin (e+f x) a+a}dx+\frac {6 a^2 \cos (e+f x)}{f \sqrt {a \sin (e+f x)+a}}}{2 a}-\frac {\cot (e+f x) \sqrt {a \sin (e+f x)+a}}{f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \int \frac {\sqrt {\sin (e+f x) a+a}}{\sin (e+f x)}dx+\frac {6 a^2 \cos (e+f x)}{f \sqrt {a \sin (e+f x)+a}}}{2 a}-\frac {\cot (e+f x) \sqrt {a \sin (e+f x)+a}}{f}\) |
\(\Big \downarrow \) 3252 |
\(\displaystyle \frac {\frac {6 a^2 \cos (e+f x)}{f \sqrt {a \sin (e+f x)+a}}-\frac {2 a^2 \int \frac {1}{a-\frac {a^2 \cos ^2(e+f x)}{\sin (e+f x) a+a}}d\frac {a \cos (e+f x)}{\sqrt {\sin (e+f x) a+a}}}{f}}{2 a}-\frac {\cot (e+f x) \sqrt {a \sin (e+f x)+a}}{f}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\frac {6 a^2 \cos (e+f x)}{f \sqrt {a \sin (e+f x)+a}}-\frac {2 a^{3/2} \text {arctanh}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a \sin (e+f x)+a}}\right )}{f}}{2 a}-\frac {\cot (e+f x) \sqrt {a \sin (e+f x)+a}}{f}\) |
Input:
Int[Cot[e + f*x]^2*Sqrt[a + a*Sin[e + f*x]],x]
Output:
-((Cot[e + f*x]*Sqrt[a + a*Sin[e + f*x]])/f) + ((-2*a^(3/2)*ArcTanh[(Sqrt[ a]*Cos[e + f*x])/Sqrt[a + a*Sin[e + f*x]]])/f + (6*a^2*Cos[e + f*x])/(f*Sq rt[a + a*Sin[e + f*x]]))/(2*a)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)/tan[(e_.) + (f_.)*(x_)]^2, x_Symbol] :> Simp[-(a + b*Sin[e + f*x])^m/(f*Tan[e + f*x]), x] + Simp[1/a Int[(a + b*Sin[e + f*x])^m*((b*m - a*(m + 1)*Sin[e + f*x])/Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f, m}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m - 1 /2] && !LtQ[m, -1]
Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/((c_.) + (d_.)*sin[(e_.) + ( f_.)*(x_)]), x_Symbol] :> Simp[-2*(b/f) Subst[Int[1/(b*c + a*d - d*x^2), x], x, b*(Cos[e + f*x]/Sqrt[a + b*Sin[e + f*x]])], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*((A_.) + (B_.)*sin[(e_.) + ( f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp [-2*b*B*Cos[e + f*x]*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(2*n + 3)*Sqrt[a + b*Sin[e + f*x]])), x] + Simp[(A*b*d*(2*n + 3) - B*(b*c - 2*a*d*(n + 1)))/(b *d*(2*n + 3)) Int[Sqrt[a + b*Sin[e + f*x]]*(c + d*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && !LtQ[n, -1]
Time = 0.32 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.45
method | result | size |
default | \(\frac {\left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (-1+\sin \left (f x +e \right )\right )}\, \left (2 \sqrt {a -\sin \left (f x +e \right ) a}\, \sin \left (f x +e \right ) a^{\frac {3}{2}}-\sqrt {a -\sin \left (f x +e \right ) a}\, a^{\frac {3}{2}}-\operatorname {arctanh}\left (\frac {\sqrt {a -\sin \left (f x +e \right ) a}}{\sqrt {a}}\right ) \sin \left (f x +e \right ) a^{2}\right )}{\sin \left (f x +e \right ) a^{\frac {3}{2}} \cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}\) | \(129\) |
Input:
int(cot(f*x+e)^2*(a+sin(f*x+e)*a)^(1/2),x,method=_RETURNVERBOSE)
Output:
(1+sin(f*x+e))*(-a*(-1+sin(f*x+e)))^(1/2)*(2*(a-sin(f*x+e)*a)^(1/2)*sin(f* x+e)*a^(3/2)-(a-sin(f*x+e)*a)^(1/2)*a^(3/2)-arctanh((a-sin(f*x+e)*a)^(1/2) /a^(1/2))*sin(f*x+e)*a^2)/sin(f*x+e)/a^(3/2)/cos(f*x+e)/(a+sin(f*x+e)*a)^( 1/2)/f
Leaf count of result is larger than twice the leaf count of optimal. 279 vs. \(2 (79) = 158\).
Time = 0.12 (sec) , antiderivative size = 279, normalized size of antiderivative = 3.13 \[ \int \cot ^2(e+f x) \sqrt {a+a \sin (e+f x)} \, dx=\frac {{\left (\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 1\right )} \sin \left (f x + e\right ) - 1\right )} \sqrt {a} \log \left (\frac {a \cos \left (f x + e\right )^{3} - 7 \, a \cos \left (f x + e\right )^{2} - 4 \, {\left (\cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right ) + 3\right )} \sin \left (f x + e\right ) - 2 \, \cos \left (f x + e\right ) - 3\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {a} - 9 \, a \cos \left (f x + e\right ) + {\left (a \cos \left (f x + e\right )^{2} + 8 \, a \cos \left (f x + e\right ) - a\right )} \sin \left (f x + e\right ) - a}{\cos \left (f x + e\right )^{3} + \cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right )^{2} - 1\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 1}\right ) - 4 \, {\left (2 \, \cos \left (f x + e\right )^{2} + {\left (2 \, \cos \left (f x + e\right ) + 3\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 3\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{4 \, {\left (f \cos \left (f x + e\right )^{2} - {\left (f \cos \left (f x + e\right ) + f\right )} \sin \left (f x + e\right ) - f\right )}} \] Input:
integrate(cot(f*x+e)^2*(a+a*sin(f*x+e))^(1/2),x, algorithm="fricas")
Output:
1/4*((cos(f*x + e)^2 - (cos(f*x + e) + 1)*sin(f*x + e) - 1)*sqrt(a)*log((a *cos(f*x + e)^3 - 7*a*cos(f*x + e)^2 - 4*(cos(f*x + e)^2 + (cos(f*x + e) + 3)*sin(f*x + e) - 2*cos(f*x + e) - 3)*sqrt(a*sin(f*x + e) + a)*sqrt(a) - 9*a*cos(f*x + e) + (a*cos(f*x + e)^2 + 8*a*cos(f*x + e) - a)*sin(f*x + e) - a)/(cos(f*x + e)^3 + cos(f*x + e)^2 + (cos(f*x + e)^2 - 1)*sin(f*x + e) - cos(f*x + e) - 1)) - 4*(2*cos(f*x + e)^2 + (2*cos(f*x + e) + 3)*sin(f*x + e) - cos(f*x + e) - 3)*sqrt(a*sin(f*x + e) + a))/(f*cos(f*x + e)^2 - (f* cos(f*x + e) + f)*sin(f*x + e) - f)
\[ \int \cot ^2(e+f x) \sqrt {a+a \sin (e+f x)} \, dx=\int \sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )} \cot ^{2}{\left (e + f x \right )}\, dx \] Input:
integrate(cot(f*x+e)**2*(a+a*sin(f*x+e))**(1/2),x)
Output:
Integral(sqrt(a*(sin(e + f*x) + 1))*cot(e + f*x)**2, x)
\[ \int \cot ^2(e+f x) \sqrt {a+a \sin (e+f x)} \, dx=\int { \sqrt {a \sin \left (f x + e\right ) + a} \cot \left (f x + e\right )^{2} \,d x } \] Input:
integrate(cot(f*x+e)^2*(a+a*sin(f*x+e))^(1/2),x, algorithm="maxima")
Output:
integrate(sqrt(a*sin(f*x + e) + a)*cot(f*x + e)^2, x)
Time = 0.16 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.67 \[ \int \cot ^2(e+f x) \sqrt {a+a \sin (e+f x)} \, dx=-\frac {\sqrt {2} {\left (\sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}}{{\left | 2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}}\right ) \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) + 8 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + \frac {4 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{2 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1}\right )} \sqrt {a}}{4 \, f} \] Input:
integrate(cot(f*x+e)^2*(a+a*sin(f*x+e))^(1/2),x, algorithm="giac")
Output:
-1/4*sqrt(2)*(sqrt(2)*log(abs(-2*sqrt(2) + 4*sin(-1/4*pi + 1/2*f*x + 1/2*e ))/abs(2*sqrt(2) + 4*sin(-1/4*pi + 1/2*f*x + 1/2*e)))*sgn(cos(-1/4*pi + 1/ 2*f*x + 1/2*e)) + 8*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e))*sin(-1/4*pi + 1/2* f*x + 1/2*e) + 4*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e))*sin(-1/4*pi + 1/2*f*x + 1/2*e)/(2*sin(-1/4*pi + 1/2*f*x + 1/2*e)^2 - 1))*sqrt(a)/f
Timed out. \[ \int \cot ^2(e+f x) \sqrt {a+a \sin (e+f x)} \, dx=\int {\mathrm {cot}\left (e+f\,x\right )}^2\,\sqrt {a+a\,\sin \left (e+f\,x\right )} \,d x \] Input:
int(cot(e + f*x)^2*(a + a*sin(e + f*x))^(1/2),x)
Output:
int(cot(e + f*x)^2*(a + a*sin(e + f*x))^(1/2), x)
\[ \int \cot ^2(e+f x) \sqrt {a+a \sin (e+f x)} \, dx=\sqrt {a}\, \left (\int \sqrt {\sin \left (f x +e \right )+1}\, \cot \left (f x +e \right )^{2}d x \right ) \] Input:
int(cot(f*x+e)^2*(a+a*sin(f*x+e))^(1/2),x)
Output:
sqrt(a)*int(sqrt(sin(e + f*x) + 1)*cot(e + f*x)**2,x)