Integrand size = 27, antiderivative size = 123 \[ \int \frac {(c+d \sin (e+f x))^2}{\sqrt {a+a \sin (e+f x)}} \, dx=-\frac {\sqrt {2} (c-d)^2 \text {arctanh}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} f}-\frac {4 (3 c-d) d \cos (e+f x)}{3 f \sqrt {a+a \sin (e+f x)}}-\frac {2 d^2 \cos (e+f x) \sqrt {a+a \sin (e+f x)}}{3 a f} \] Output:
-2^(1/2)*(c-d)^2*arctanh(1/2*a^(1/2)*cos(f*x+e)*2^(1/2)/(a+a*sin(f*x+e))^( 1/2))/a^(1/2)/f-4/3*(3*c-d)*d*cos(f*x+e)/f/(a+a*sin(f*x+e))^(1/2)-2/3*d^2* cos(f*x+e)*(a+a*sin(f*x+e))^(1/2)/a/f
Result contains complex when optimal does not.
Time = 1.32 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.02 \[ \int \frac {(c+d \sin (e+f x))^2}{\sqrt {a+a \sin (e+f x)}} \, dx=-\frac {2 \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left ((-3-3 i) (-1)^{3/4} (c-d)^2 \text {arctanh}\left (\left (\frac {1}{2}+\frac {i}{2}\right ) (-1)^{3/4} \left (-1+\tan \left (\frac {1}{4} (e+f x)\right )\right )\right )+d \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) (6 c-d+d \sin (e+f x))\right )}{3 f \sqrt {a (1+\sin (e+f x))}} \] Input:
Integrate[(c + d*Sin[e + f*x])^2/Sqrt[a + a*Sin[e + f*x]],x]
Output:
(-2*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*((-3 - 3*I)*(-1)^(3/4)*(c - d)^2 *ArcTanh[(1/2 + I/2)*(-1)^(3/4)*(-1 + Tan[(e + f*x)/4])] + d*(Cos[(e + f*x )/2] - Sin[(e + f*x)/2])*(6*c - d + d*Sin[e + f*x])))/(3*f*Sqrt[a*(1 + Sin [e + f*x])])
Time = 0.53 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.06, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.296, Rules used = {3042, 3240, 27, 3042, 3230, 3042, 3128, 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 \frac {(c+d \sin (e+f x))^2}{\sqrt {a \sin (e+f x)+a}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(c+d \sin (e+f x))^2}{\sqrt {a \sin (e+f x)+a}}dx\) |
\(\Big \downarrow \) 3240 |
\(\displaystyle \frac {2 \int \frac {a \left (3 c^2+d^2\right )+2 a (3 c-d) d \sin (e+f x)}{2 \sqrt {\sin (e+f x) a+a}}dx}{3 a}-\frac {2 d^2 \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 a f}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\int \frac {a \left (3 c^2+d^2\right )+2 a (3 c-d) d \sin (e+f x)}{\sqrt {\sin (e+f x) a+a}}dx}{3 a}-\frac {2 d^2 \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 a f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a \left (3 c^2+d^2\right )+2 a (3 c-d) d \sin (e+f x)}{\sqrt {\sin (e+f x) a+a}}dx}{3 a}-\frac {2 d^2 \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 a f}\) |
\(\Big \downarrow \) 3230 |
\(\displaystyle \frac {3 a (c-d)^2 \int \frac {1}{\sqrt {\sin (e+f x) a+a}}dx-\frac {4 a d (3 c-d) \cos (e+f x)}{f \sqrt {a \sin (e+f x)+a}}}{3 a}-\frac {2 d^2 \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 a f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {3 a (c-d)^2 \int \frac {1}{\sqrt {\sin (e+f x) a+a}}dx-\frac {4 a d (3 c-d) \cos (e+f x)}{f \sqrt {a \sin (e+f x)+a}}}{3 a}-\frac {2 d^2 \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 a f}\) |
\(\Big \downarrow \) 3128 |
\(\displaystyle \frac {-\frac {6 a (c-d)^2 \int \frac {1}{2 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}-\frac {4 a d (3 c-d) \cos (e+f x)}{f \sqrt {a \sin (e+f x)+a}}}{3 a}-\frac {2 d^2 \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 a f}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {-\frac {3 \sqrt {2} \sqrt {a} (c-d)^2 \text {arctanh}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a \sin (e+f x)+a}}\right )}{f}-\frac {4 a d (3 c-d) \cos (e+f x)}{f \sqrt {a \sin (e+f x)+a}}}{3 a}-\frac {2 d^2 \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 a f}\) |
Input:
Int[(c + d*Sin[e + f*x])^2/Sqrt[a + a*Sin[e + f*x]],x]
Output:
(-2*d^2*Cos[e + f*x]*Sqrt[a + a*Sin[e + f*x]])/(3*a*f) + ((-3*Sqrt[2]*Sqrt [a]*(c - d)^2*ArcTanh[(Sqrt[a]*Cos[e + f*x])/(Sqrt[2]*Sqrt[a + a*Sin[e + f *x]])])/f - (4*a*(3*c - d)*d*Cos[e + f*x])/(f*Sqrt[a + a*Sin[e + f*x]]))/( 3*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[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[-2/d Subst[Int[1/(2*a - x^2), x], x, b*(Cos[c + d*x]/Sqrt[a + b*Sin[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/( f*(m + 1))), x] + Simp[(a*d*m + b*c*(m + 1))/(b*(m + 1)) Int[(a + b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && !LtQ[m, -2^(-1)]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + ( f_.)*(x_)])^2, x_Symbol] :> Simp[(-d^2)*Cos[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[b*(d^2*(m + 1) + c^2*(m + 2)) - d*(a*d - 2*b*c*(m + 2))*Sin[e + f*x] , x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ [a^2 - b^2, 0] && !LtQ[m, -1]
Time = 1.88 (sec) , antiderivative size = 185, normalized size of antiderivative = 1.50
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 (3 \sqrt {2}\, a^{\frac {3}{2}} \operatorname {arctanh}\left (\frac {\sqrt {a -\sin \left (f x +e \right ) a}\, \sqrt {2}}{2 \sqrt {a}}\right ) c^{2}-6 \sqrt {2}\, a^{\frac {3}{2}} \operatorname {arctanh}\left (\frac {\sqrt {a -\sin \left (f x +e \right ) a}\, \sqrt {2}}{2 \sqrt {a}}\right ) c d +3 \sqrt {2}\, a^{\frac {3}{2}} \operatorname {arctanh}\left (\frac {\sqrt {a -\sin \left (f x +e \right ) a}\, \sqrt {2}}{2 \sqrt {a}}\right ) d^{2}-2 \left (a -\sin \left (f x +e \right ) a \right )^{\frac {3}{2}} d^{2}+12 a c d \sqrt {a -\sin \left (f x +e \right ) a}\right )}{3 a^{2} \cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}\) | \(185\) |
parts | \(-\frac {c^{2} \left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (-1+\sin \left (f x +e \right )\right )}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {-a \left (-1+\sin \left (f x +e \right )\right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{\sqrt {a}\, \cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}-\frac {d^{2} \left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (-1+\sin \left (f x +e \right )\right )}\, \left (3 a^{\frac {3}{2}} \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a -\sin \left (f x +e \right ) a}\, \sqrt {2}}{2 \sqrt {a}}\right )-2 \left (a -\sin \left (f x +e \right ) a \right )^{\frac {3}{2}}\right )}{3 a^{2} \cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}+\frac {2 c d \left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (-1+\sin \left (f x +e \right )\right )}\, \left (\sqrt {a}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a -\sin \left (f x +e \right ) a}\, \sqrt {2}}{2 \sqrt {a}}\right )-2 \sqrt {a -\sin \left (f x +e \right ) a}\right )}{a \cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}\) | \(273\) |
Input:
int((c+d*sin(f*x+e))^2/(a+sin(f*x+e)*a)^(1/2),x,method=_RETURNVERBOSE)
Output:
-1/3*(1+sin(f*x+e))*(-a*(-1+sin(f*x+e)))^(1/2)*(3*2^(1/2)*a^(3/2)*arctanh( 1/2*(a-sin(f*x+e)*a)^(1/2)*2^(1/2)/a^(1/2))*c^2-6*2^(1/2)*a^(3/2)*arctanh( 1/2*(a-sin(f*x+e)*a)^(1/2)*2^(1/2)/a^(1/2))*c*d+3*2^(1/2)*a^(3/2)*arctanh( 1/2*(a-sin(f*x+e)*a)^(1/2)*2^(1/2)/a^(1/2))*d^2-2*(a-sin(f*x+e)*a)^(3/2)*d ^2+12*a*c*d*(a-sin(f*x+e)*a)^(1/2))/a^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. 286 vs. \(2 (106) = 212\).
Time = 0.10 (sec) , antiderivative size = 286, normalized size of antiderivative = 2.33 \[ \int \frac {(c+d \sin (e+f x))^2}{\sqrt {a+a \sin (e+f x)}} \, dx=\frac {\frac {3 \, \sqrt {2} {\left (a c^{2} - 2 \, a c d + a d^{2} + {\left (a c^{2} - 2 \, a c d + a d^{2}\right )} \cos \left (f x + e\right ) + {\left (a c^{2} - 2 \, a c d + a d^{2}\right )} \sin \left (f x + e\right )\right )} \log \left (-\frac {\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) - 2\right )} \sin \left (f x + e\right ) - \frac {2 \, \sqrt {2} \sqrt {a \sin \left (f x + e\right ) + a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )}}{\sqrt {a}} + 3 \, \cos \left (f x + e\right ) + 2}{\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right )}{\sqrt {a}} - 4 \, {\left (d^{2} \cos \left (f x + e\right )^{2} + 6 \, c d - 2 \, d^{2} + {\left (6 \, c d - d^{2}\right )} \cos \left (f x + e\right ) + {\left (d^{2} \cos \left (f x + e\right ) - 6 \, c d + 2 \, d^{2}\right )} \sin \left (f x + e\right )\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{6 \, {\left (a f \cos \left (f x + e\right ) + a f \sin \left (f x + e\right ) + a f\right )}} \] Input:
integrate((c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="fricas")
Output:
1/6*(3*sqrt(2)*(a*c^2 - 2*a*c*d + a*d^2 + (a*c^2 - 2*a*c*d + a*d^2)*cos(f* x + e) + (a*c^2 - 2*a*c*d + a*d^2)*sin(f*x + e))*log(-(cos(f*x + e)^2 - (c os(f*x + e) - 2)*sin(f*x + e) - 2*sqrt(2)*sqrt(a*sin(f*x + e) + a)*(cos(f* x + e) - sin(f*x + e) + 1)/sqrt(a) + 3*cos(f*x + e) + 2)/(cos(f*x + e)^2 - (cos(f*x + e) + 2)*sin(f*x + e) - cos(f*x + e) - 2))/sqrt(a) - 4*(d^2*cos (f*x + e)^2 + 6*c*d - 2*d^2 + (6*c*d - d^2)*cos(f*x + e) + (d^2*cos(f*x + e) - 6*c*d + 2*d^2)*sin(f*x + e))*sqrt(a*sin(f*x + e) + a))/(a*f*cos(f*x + e) + a*f*sin(f*x + e) + a*f)
\[ \int \frac {(c+d \sin (e+f x))^2}{\sqrt {a+a \sin (e+f x)}} \, dx=\int \frac {\left (c + d \sin {\left (e + f x \right )}\right )^{2}}{\sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )}}\, dx \] Input:
integrate((c+d*sin(f*x+e))**2/(a+a*sin(f*x+e))**(1/2),x)
Output:
Integral((c + d*sin(e + f*x))**2/sqrt(a*(sin(e + f*x) + 1)), x)
\[ \int \frac {(c+d \sin (e+f x))^2}{\sqrt {a+a \sin (e+f x)}} \, dx=\int { \frac {{\left (d \sin \left (f x + e\right ) + c\right )}^{2}}{\sqrt {a \sin \left (f x + e\right ) + a}} \,d x } \] Input:
integrate((c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="maxima")
Output:
integrate((d*sin(f*x + e) + c)^2/sqrt(a*sin(f*x + e) + a), x)
Exception generated. \[ \int \frac {(c+d \sin (e+f x))^2}{\sqrt {a+a \sin (e+f x)}} \, dx=\text {Exception raised: TypeError} \] Input:
integrate((c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="giac")
Output:
Exception raised: TypeError >> an error occurred running a Giac command:IN PUT:sage2:=int(sage0,sageVARx):;OUTPUT:sym2poly/r2sym(const gen & e,const index_m & i,const vecteur & l) Error: Bad Argument Value
Timed out. \[ \int \frac {(c+d \sin (e+f x))^2}{\sqrt {a+a \sin (e+f x)}} \, dx=\int \frac {{\left (c+d\,\sin \left (e+f\,x\right )\right )}^2}{\sqrt {a+a\,\sin \left (e+f\,x\right )}} \,d x \] Input:
int((c + d*sin(e + f*x))^2/(a + a*sin(e + f*x))^(1/2),x)
Output:
int((c + d*sin(e + f*x))^2/(a + a*sin(e + f*x))^(1/2), x)
\[ \int \frac {(c+d \sin (e+f x))^2}{\sqrt {a+a \sin (e+f x)}} \, dx=\frac {\sqrt {a}\, \left (\left (\int \frac {\sqrt {\sin \left (f x +e \right )+1}}{\sin \left (f x +e \right )+1}d x \right ) c^{2}+\left (\int \frac {\sqrt {\sin \left (f x +e \right )+1}\, \sin \left (f x +e \right )^{2}}{\sin \left (f x +e \right )+1}d x \right ) d^{2}+2 \left (\int \frac {\sqrt {\sin \left (f x +e \right )+1}\, \sin \left (f x +e \right )}{\sin \left (f x +e \right )+1}d x \right ) c d \right )}{a} \] Input:
int((c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x)
Output:
(sqrt(a)*(int(sqrt(sin(e + f*x) + 1)/(sin(e + f*x) + 1),x)*c**2 + int((sqr t(sin(e + f*x) + 1)*sin(e + f*x)**2)/(sin(e + f*x) + 1),x)*d**2 + 2*int((s qrt(sin(e + f*x) + 1)*sin(e + f*x))/(sin(e + f*x) + 1),x)*c*d))/a