\(\int \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2 \, dx\) [531]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F]
Maxima [F]
Giac [A] (verification not implemented)
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 27, antiderivative size = 112 \[ \int \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2 \, dx=-\frac {2 a \left (15 c^2+10 c d+7 d^2\right ) \cos (e+f x)}{15 f \sqrt {a+a \sin (e+f x)}}-\frac {4 (5 c-d) d \cos (e+f x) \sqrt {a+a \sin (e+f x)}}{15 f}-\frac {2 d^2 \cos (e+f x) (a+a \sin (e+f x))^{3/2}}{5 a f} \] Output:

-2/15*a*(15*c^2+10*c*d+7*d^2)*cos(f*x+e)/f/(a+a*sin(f*x+e))^(1/2)-4/15*(5* 
c-d)*d*cos(f*x+e)*(a+a*sin(f*x+e))^(1/2)/f-2/5*d^2*cos(f*x+e)*(a+a*sin(f*x 
+e))^(3/2)/a/f
 

Mathematica [A] (verified)

Time = 0.37 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.99 \[ \int \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2 \, dx=-\frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sqrt {a (1+\sin (e+f x))} \left (30 c^2+40 c d+19 d^2-3 d^2 \cos (2 (e+f x))+4 d (5 c+2 d) \sin (e+f x)\right )}{15 f \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )} \] Input:

Integrate[Sqrt[a + a*Sin[e + f*x]]*(c + d*Sin[e + f*x])^2,x]
 

Output:

-1/15*((Cos[(e + f*x)/2] - Sin[(e + f*x)/2])*Sqrt[a*(1 + Sin[e + f*x])]*(3 
0*c^2 + 40*c*d + 19*d^2 - 3*d^2*Cos[2*(e + f*x)] + 4*d*(5*c + 2*d)*Sin[e + 
 f*x]))/(f*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2]))
 

Rubi [A] (verified)

Time = 0.54 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.10, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.259, Rules used = {3042, 3240, 27, 3042, 3230, 3042, 3125}

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 \sin (e+f x)+a} (c+d \sin (e+f x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sqrt {a \sin (e+f x)+a} (c+d \sin (e+f x))^2dx\)

\(\Big \downarrow \) 3240

\(\displaystyle \frac {2 \int \frac {1}{2} \sqrt {\sin (e+f x) a+a} \left (a \left (5 c^2+3 d^2\right )+2 a (5 c-d) d \sin (e+f x)\right )dx}{5 a}-\frac {2 d^2 \cos (e+f x) (a \sin (e+f x)+a)^{3/2}}{5 a f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\int \sqrt {\sin (e+f x) a+a} \left (a \left (5 c^2+3 d^2\right )+2 a (5 c-d) d \sin (e+f x)\right )dx}{5 a}-\frac {2 d^2 \cos (e+f x) (a \sin (e+f x)+a)^{3/2}}{5 a f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \sqrt {\sin (e+f x) a+a} \left (a \left (5 c^2+3 d^2\right )+2 a (5 c-d) d \sin (e+f x)\right )dx}{5 a}-\frac {2 d^2 \cos (e+f x) (a \sin (e+f x)+a)^{3/2}}{5 a f}\)

\(\Big \downarrow \) 3230

\(\displaystyle \frac {\frac {1}{3} a \left (15 c^2+10 c d+7 d^2\right ) \int \sqrt {\sin (e+f x) a+a}dx-\frac {4 a d (5 c-d) \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 f}}{5 a}-\frac {2 d^2 \cos (e+f x) (a \sin (e+f x)+a)^{3/2}}{5 a f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {1}{3} a \left (15 c^2+10 c d+7 d^2\right ) \int \sqrt {\sin (e+f x) a+a}dx-\frac {4 a d (5 c-d) \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 f}}{5 a}-\frac {2 d^2 \cos (e+f x) (a \sin (e+f x)+a)^{3/2}}{5 a f}\)

\(\Big \downarrow \) 3125

\(\displaystyle \frac {-\frac {2 a^2 \left (15 c^2+10 c d+7 d^2\right ) \cos (e+f x)}{3 f \sqrt {a \sin (e+f x)+a}}-\frac {4 a d (5 c-d) \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 f}}{5 a}-\frac {2 d^2 \cos (e+f x) (a \sin (e+f x)+a)^{3/2}}{5 a f}\)

Input:

Int[Sqrt[a + a*Sin[e + f*x]]*(c + d*Sin[e + f*x])^2,x]
 

Output:

(-2*d^2*Cos[e + f*x]*(a + a*Sin[e + f*x])^(3/2))/(5*a*f) + ((-2*a^2*(15*c^ 
2 + 10*c*d + 7*d^2)*Cos[e + f*x])/(3*f*Sqrt[a + a*Sin[e + f*x]]) - (4*a*(5 
*c - d)*d*Cos[e + f*x]*Sqrt[a + a*Sin[e + f*x]])/(3*f))/(5*a)
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3125
Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[-2*b*(Cos 
[c + d*x]/(d*Sqrt[a + b*Sin[c + d*x]])), x] /; FreeQ[{a, b, c, d}, x] && Eq 
Q[a^2 - b^2, 0]
 

rule 3230
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)]
 

rule 3240
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]
 
Maple [A] (verified)

Time = 0.99 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.82

method result size
default \(\frac {2 \left (1+\sin \left (f x +e \right )\right ) a \left (-1+\sin \left (f x +e \right )\right ) \left (3 \sin \left (f x +e \right )^{2} d^{2}+10 d \sin \left (f x +e \right ) c +4 d^{2} \sin \left (f x +e \right )+15 c^{2}+20 c d +8 d^{2}\right )}{15 \cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}\) \(92\)
parts \(\frac {2 c^{2} \left (1+\sin \left (f x +e \right )\right ) \left (-1+\sin \left (f x +e \right )\right ) a}{\cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}+\frac {2 d^{2} \left (1+\sin \left (f x +e \right )\right ) a \left (-1+\sin \left (f x +e \right )\right ) \left (3 \sin \left (f x +e \right )^{2}+4 \sin \left (f x +e \right )+8\right )}{15 \cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}+\frac {4 c d \left (1+\sin \left (f x +e \right )\right ) a \left (-1+\sin \left (f x +e \right )\right ) \left (\sin \left (f x +e \right )+2\right )}{3 \cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}\) \(164\)

Input:

int((a+sin(f*x+e)*a)^(1/2)*(c+d*sin(f*x+e))^2,x,method=_RETURNVERBOSE)
 

Output:

2/15*(1+sin(f*x+e))*a*(-1+sin(f*x+e))*(3*sin(f*x+e)^2*d^2+10*d*sin(f*x+e)* 
c+4*d^2*sin(f*x+e)+15*c^2+20*c*d+8*d^2)/cos(f*x+e)/(a+sin(f*x+e)*a)^(1/2)/ 
f
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.40 \[ \int \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2 \, dx=\frac {2 \, {\left (3 \, d^{2} \cos \left (f x + e\right )^{3} - {\left (10 \, c d + d^{2}\right )} \cos \left (f x + e\right )^{2} - 15 \, c^{2} - 10 \, c d - 7 \, d^{2} - {\left (15 \, c^{2} + 20 \, c d + 11 \, d^{2}\right )} \cos \left (f x + e\right ) - {\left (3 \, d^{2} \cos \left (f x + e\right )^{2} - 15 \, c^{2} - 10 \, c d - 7 \, d^{2} + 2 \, {\left (5 \, c d + 2 \, d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{15 \, {\left (f \cos \left (f x + e\right ) + f \sin \left (f x + e\right ) + f\right )}} \] Input:

integrate((a+a*sin(f*x+e))^(1/2)*(c+d*sin(f*x+e))^2,x, algorithm="fricas")
 

Output:

2/15*(3*d^2*cos(f*x + e)^3 - (10*c*d + d^2)*cos(f*x + e)^2 - 15*c^2 - 10*c 
*d - 7*d^2 - (15*c^2 + 20*c*d + 11*d^2)*cos(f*x + e) - (3*d^2*cos(f*x + e) 
^2 - 15*c^2 - 10*c*d - 7*d^2 + 2*(5*c*d + 2*d^2)*cos(f*x + e))*sin(f*x + e 
))*sqrt(a*sin(f*x + e) + a)/(f*cos(f*x + e) + f*sin(f*x + e) + f)
 

Sympy [F]

\[ \int \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2 \, dx=\int \sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )} \left (c + d \sin {\left (e + f x \right )}\right )^{2}\, dx \] Input:

integrate((a+a*sin(f*x+e))**(1/2)*(c+d*sin(f*x+e))**2,x)
 

Output:

Integral(sqrt(a*(sin(e + f*x) + 1))*(c + d*sin(e + f*x))**2, x)
 

Maxima [F]

\[ \int \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2 \, dx=\int { \sqrt {a \sin \left (f x + e\right ) + a} {\left (d \sin \left (f x + e\right ) + c\right )}^{2} \,d x } \] Input:

integrate((a+a*sin(f*x+e))^(1/2)*(c+d*sin(f*x+e))^2,x, algorithm="maxima")
 

Output:

integrate(sqrt(a*sin(f*x + e) + a)*(d*sin(f*x + e) + c)^2, x)
 

Giac [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.41 \[ \int \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2 \, dx=\frac {\sqrt {2} {\left (3 \, d^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \sin \left (-\frac {5}{4} \, \pi + \frac {5}{2} \, f x + \frac {5}{2} \, e\right ) + 30 \, {\left (2 \, c^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) + 2 \, c d \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) + d^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )\right )} \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 5 \, {\left (4 \, c d \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) + d^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )\right )} \sin \left (-\frac {3}{4} \, \pi + \frac {3}{2} \, f x + \frac {3}{2} \, e\right )\right )} \sqrt {a}}{30 \, f} \] Input:

integrate((a+a*sin(f*x+e))^(1/2)*(c+d*sin(f*x+e))^2,x, algorithm="giac")
 

Output:

1/30*sqrt(2)*(3*d^2*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e))*sin(-5/4*pi + 5/2* 
f*x + 5/2*e) + 30*(2*c^2*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e)) + 2*c*d*sgn(c 
os(-1/4*pi + 1/2*f*x + 1/2*e)) + d^2*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e)))* 
sin(-1/4*pi + 1/2*f*x + 1/2*e) + 5*(4*c*d*sgn(cos(-1/4*pi + 1/2*f*x + 1/2* 
e)) + d^2*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e)))*sin(-3/4*pi + 3/2*f*x + 3/2 
*e))*sqrt(a)/f
 

Mupad [F(-1)]

Timed out. \[ \int \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2 \, dx=\int \sqrt {a+a\,\sin \left (e+f\,x\right )}\,{\left (c+d\,\sin \left (e+f\,x\right )\right )}^2 \,d x \] Input:

int((a + a*sin(e + f*x))^(1/2)*(c + d*sin(e + f*x))^2,x)
 

Output:

int((a + a*sin(e + f*x))^(1/2)*(c + d*sin(e + f*x))^2, x)
 

Reduce [F]

\[ \int \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2 \, dx=\sqrt {a}\, \left (\left (\int \sqrt {\sin \left (f x +e \right )+1}d x \right ) c^{2}+\left (\int \sqrt {\sin \left (f x +e \right )+1}\, \sin \left (f x +e \right )^{2}d x \right ) d^{2}+2 \left (\int \sqrt {\sin \left (f x +e \right )+1}\, \sin \left (f x +e \right )d x \right ) c d \right ) \] Input:

int((a+a*sin(f*x+e))^(1/2)*(c+d*sin(f*x+e))^2,x)
 

Output:

sqrt(a)*(int(sqrt(sin(e + f*x) + 1),x)*c**2 + int(sqrt(sin(e + f*x) + 1)*s 
in(e + f*x)**2,x)*d**2 + 2*int(sqrt(sin(e + f*x) + 1)*sin(e + f*x),x)*c*d)