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

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

Optimal result

Integrand size = 25, antiderivative size = 120 \[ \int \frac {(c+d \sin (e+f x))^3}{(a+a \sin (e+f x))^2} \, dx=\frac {(3 c-2 d) d^2 x}{a^2}+\frac {(c-4 d) d^2 \cos (e+f x)}{3 a^2 f}-\frac {(c-d)^2 (c+6 d) \cos (e+f x)}{3 a^2 f (1+\sin (e+f x))}-\frac {(c-d) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a+a \sin (e+f x))^2} \] Output:

(3*c-2*d)*d^2*x/a^2+1/3*(c-4*d)*d^2*cos(f*x+e)/a^2/f-1/3*(c-d)^2*(c+6*d)*c 
os(f*x+e)/a^2/f/(1+sin(f*x+e))-1/3*(c-d)*cos(f*x+e)*(c+d*sin(f*x+e))^2/f/( 
a+a*sin(f*x+e))^2
 

Mathematica [A] (verified)

Time = 0.41 (sec) , antiderivative size = 212, normalized size of antiderivative = 1.77 \[ \int \frac {(c+d \sin (e+f x))^3}{(a+a \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 ) \left (2 (c-d)^3 \sin \left (\frac {1}{2} (e+f x)\right )-(c-d)^3 \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )+2 (c-d)^2 (c+8 d) \sin \left (\frac {1}{2} (e+f x)\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2+3 (3 c-2 d) d^2 (e+f x) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^3-3 d^3 \cos (e+f x) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^3\right )}{3 a^2 f (1+\sin (e+f x))^2} \] Input:

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

Output:

((Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(2*(c - d)^3*Sin[(e + f*x)/2] - (c 
- d)^3*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2]) + 2*(c - d)^2*(c + 8*d)*Sin[( 
e + f*x)/2]*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^2 + 3*(3*c - 2*d)*d^2*(e 
 + f*x)*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^3 - 3*d^3*Cos[e + f*x]*(Cos[ 
(e + f*x)/2] + Sin[(e + f*x)/2])^3))/(3*a^2*f*(1 + Sin[e + f*x])^2)
 

Rubi [A] (verified)

Time = 0.90 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.05, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.440, Rules used = {3042, 3244, 25, 3042, 3447, 3042, 3502, 3042, 3214, 3042, 3127}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3244

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3447

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3502

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3214

\(\displaystyle \frac {\frac {a^2 (c+6 d) (c-d)^2 \int \frac {1}{\sin (e+f x) a+a}dx+3 a d^2 x (3 c-2 d)}{a}+\frac {d^2 (c-4 d) \cos (e+f x)}{f}}{3 a^2}-\frac {(c-d) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a \sin (e+f x)+a)^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {a^2 (c+6 d) (c-d)^2 \int \frac {1}{\sin (e+f x) a+a}dx+3 a d^2 x (3 c-2 d)}{a}+\frac {d^2 (c-4 d) \cos (e+f x)}{f}}{3 a^2}-\frac {(c-d) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a \sin (e+f x)+a)^2}\)

\(\Big \downarrow \) 3127

\(\displaystyle \frac {\frac {3 a d^2 x (3 c-2 d)-\frac {a^2 (c-d)^2 (c+6 d) \cos (e+f x)}{f (a \sin (e+f x)+a)}}{a}+\frac {d^2 (c-4 d) \cos (e+f x)}{f}}{3 a^2}-\frac {(c-d) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a \sin (e+f x)+a)^2}\)

Input:

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

Output:

-1/3*((c - d)*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(f*(a + a*Sin[e + f*x]) 
^2) + (((c - 4*d)*d^2*Cos[e + f*x])/f + (3*a*(3*c - 2*d)*d^2*x - (a^2*(c - 
 d)^2*(c + 6*d)*Cos[e + f*x])/(f*(a + a*Sin[e + f*x])))/a)/(3*a^2)
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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

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

rule 3214
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. 
)*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(b*c - a*d)/d   Int[1/(c + d 
*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
 

rule 3244
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
(f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*c - a*d)*Cos[e + f*x]*(a + b*Sin[e 
+ f*x])^m*((c + d*Sin[e + f*x])^(n - 1)/(a*f*(2*m + 1))), x] + Simp[1/(a*b* 
(2*m + 1))   Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^(n - 2)* 
Simp[b*(c^2*(m + 1) + d^2*(n - 1)) + a*c*d*(m - n + 1) + d*(a*d*(m - n + 1) 
 + b*c*(m + n))*Sin[e + f*x], x], 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] && LtQ[m, -1] 
&& GtQ[n, 1] && (IntegersQ[2*m, 2*n] || (IntegerQ[m] && EqQ[c, 0]))
 

rule 3447
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) 
+ (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a 
 + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x]^2), 
 x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]
 

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

Time = 1.91 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.31

method result size
derivativedivides \(\frac {-\frac {2 \left (c^{3}-3 c \,d^{2}+2 d^{3}\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}-\frac {-2 c^{3}+6 c^{2} d -6 c \,d^{2}+2 d^{3}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}-\frac {2 \left (2 c^{3}-6 c^{2} d +6 c \,d^{2}-2 d^{3}\right )}{3 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+2 d^{2} \left (-\frac {d}{1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}+\left (3 c -2 d \right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{a^{2} f}\) \(157\)
default \(\frac {-\frac {2 \left (c^{3}-3 c \,d^{2}+2 d^{3}\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}-\frac {-2 c^{3}+6 c^{2} d -6 c \,d^{2}+2 d^{3}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}-\frac {2 \left (2 c^{3}-6 c^{2} d +6 c \,d^{2}-2 d^{3}\right )}{3 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+2 d^{2} \left (-\frac {d}{1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}+\left (3 c -2 d \right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{a^{2} f}\) \(157\)
risch \(\frac {3 d^{2} x c}{a^{2}}-\frac {2 d^{3} x}{a^{2}}-\frac {d^{3} {\mathrm e}^{i \left (f x +e \right )}}{2 a^{2} f}-\frac {d^{3} {\mathrm e}^{-i \left (f x +e \right )}}{2 a^{2} f}-\frac {2 i \left (-9 i c^{2} d \,{\mathrm e}^{2 i \left (f x +e \right )}+18 i c \,d^{2} {\mathrm e}^{2 i \left (f x +e \right )}-9 i d^{3} {\mathrm e}^{2 i \left (f x +e \right )}+i c^{3}+6 i c^{2} d -15 i d^{2} c +8 i d^{3}+3 c^{3} {\mathrm e}^{i \left (f x +e \right )}+9 c^{2} d \,{\mathrm e}^{i \left (f x +e \right )}-27 c \,d^{2} {\mathrm e}^{i \left (f x +e \right )}+15 d^{3} {\mathrm e}^{i \left (f x +e \right )}\right )}{3 f \,a^{2} \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )^{3}}\) \(216\)
parallelrisch \(\frac {\left (\left (-36 f x -78\right ) d^{3}+\left (54 f x +90\right ) c \,d^{2}-18 c^{2} d -18 c^{3}\right ) \cos \left (\frac {f x}{2}+\frac {e}{2}\right )+\left (\left (12 f x -5\right ) d^{3}+\left (-18 f x +6\right ) c \,d^{2}-6 c^{2} d +2 c^{3}\right ) \cos \left (\frac {3 f x}{2}+\frac {3 e}{2}\right )+\left (\left (-36 f x -42\right ) d^{3}+\left (54 f x +54\right ) c \,d^{2}-18 c^{2} d -6 c^{3}\right ) \sin \left (\frac {f x}{2}+\frac {e}{2}\right )+\left (\left (-12 f x -45\right ) d^{3}+\left (18 f x +54\right ) c \,d^{2}-18 c^{2} d -6 c^{3}\right ) \sin \left (\frac {3 f x}{2}+\frac {3 e}{2}\right )-3 d^{3} \left (\sin \left (\frac {5 f x}{2}+\frac {5 e}{2}\right )-\cos \left (\frac {5 f x}{2}+\frac {5 e}{2}\right )\right )}{6 f \,a^{2} \left (3 \cos \left (\frac {f x}{2}+\frac {e}{2}\right )-\cos \left (\frac {3 f x}{2}+\frac {3 e}{2}\right )+\sin \left (\frac {3 f x}{2}+\frac {3 e}{2}\right )+3 \sin \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}\) \(253\)
norman \(\frac {\frac {d^{2} \left (3 c -2 d \right ) x}{a}+\frac {\left (-2 c^{3}+6 c \,d^{2}-4 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}}{a f}+\frac {\left (-2 c^{3}-6 c^{2} d +18 c \,d^{2}-16 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}+\frac {d^{2} \left (3 c -2 d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{9}}{a}+\frac {-4 c^{3}-6 c^{2} d +24 c \,d^{2}-20 d^{3}}{3 a f}+\frac {2 \left (-3 c^{3}-3 c^{2} d +15 c \,d^{2}-14 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{a f}+\frac {2 \left (-c^{3}-3 c^{2} d +9 c \,d^{2}-6 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{a f}+\frac {2 \left (-3 c^{3}-9 c^{2} d +27 c \,d^{2}-22 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{a f}+\frac {2 \left (-5 c^{3}-3 c^{2} d +21 c \,d^{2}-20 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{a f}+\frac {2 \left (-3 c^{3}-9 c^{2} d +27 c \,d^{2}-20 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{a f}+\frac {2 \left (-11 c^{3}-3 c^{2} d +39 c \,d^{2}-34 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{3 a f}+\frac {3 d^{2} \left (3 c -2 d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a}+\frac {6 d^{2} \left (3 c -2 d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{a}+\frac {10 d^{2} \left (3 c -2 d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{a}+\frac {12 d^{2} \left (3 c -2 d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{a}+\frac {12 d^{2} \left (3 c -2 d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{a}+\frac {10 d^{2} \left (3 c -2 d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{a}+\frac {6 d^{2} \left (3 c -2 d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{a}+\frac {3 d^{2} \left (3 c -2 d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}}{a}}{\left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{3} a \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}\) \(646\)

Input:

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

Output:

2/f/a^2*(-(c^3-3*c*d^2+2*d^3)/(tan(1/2*f*x+1/2*e)+1)-1/2*(-2*c^3+6*c^2*d-6 
*c*d^2+2*d^3)/(tan(1/2*f*x+1/2*e)+1)^2-1/3*(2*c^3-6*c^2*d+6*c*d^2-2*d^3)/( 
tan(1/2*f*x+1/2*e)+1)^3+d^2*(-d/(1+tan(1/2*f*x+1/2*e)^2)+(3*c-2*d)*arctan( 
tan(1/2*f*x+1/2*e))))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 308 vs. \(2 (114) = 228\).

Time = 0.09 (sec) , antiderivative size = 308, normalized size of antiderivative = 2.57 \[ \int \frac {(c+d \sin (e+f x))^3}{(a+a \sin (e+f x))^2} \, dx=-\frac {3 \, d^{3} \cos \left (f x + e\right )^{3} - c^{3} + 3 \, c^{2} d - 3 \, c d^{2} + d^{3} + 6 \, {\left (3 \, c d^{2} - 2 \, d^{3}\right )} f x - {\left (c^{3} + 6 \, c^{2} d - 15 \, c d^{2} + 11 \, d^{3} + 3 \, {\left (3 \, c d^{2} - 2 \, d^{3}\right )} f x\right )} \cos \left (f x + e\right )^{2} - {\left (2 \, c^{3} + 3 \, c^{2} d - 12 \, c d^{2} + 13 \, d^{3} - 3 \, {\left (3 \, c d^{2} - 2 \, d^{3}\right )} f x\right )} \cos \left (f x + e\right ) - {\left (3 \, d^{3} \cos \left (f x + e\right )^{2} - c^{3} + 3 \, c^{2} d - 3 \, c d^{2} + d^{3} - 6 \, {\left (3 \, c d^{2} - 2 \, d^{3}\right )} f x + {\left (c^{3} + 6 \, c^{2} d - 15 \, c d^{2} + 14 \, d^{3} - 3 \, {\left (3 \, c d^{2} - 2 \, d^{3}\right )} f x\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{3 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} - a^{2} f \cos \left (f x + e\right ) - 2 \, a^{2} f - {\left (a^{2} f \cos \left (f x + e\right ) + 2 \, a^{2} f\right )} \sin \left (f x + e\right )\right )}} \] Input:

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

Output:

-1/3*(3*d^3*cos(f*x + e)^3 - c^3 + 3*c^2*d - 3*c*d^2 + d^3 + 6*(3*c*d^2 - 
2*d^3)*f*x - (c^3 + 6*c^2*d - 15*c*d^2 + 11*d^3 + 3*(3*c*d^2 - 2*d^3)*f*x) 
*cos(f*x + e)^2 - (2*c^3 + 3*c^2*d - 12*c*d^2 + 13*d^3 - 3*(3*c*d^2 - 2*d^ 
3)*f*x)*cos(f*x + e) - (3*d^3*cos(f*x + e)^2 - c^3 + 3*c^2*d - 3*c*d^2 + d 
^3 - 6*(3*c*d^2 - 2*d^3)*f*x + (c^3 + 6*c^2*d - 15*c*d^2 + 14*d^3 - 3*(3*c 
*d^2 - 2*d^3)*f*x)*cos(f*x + e))*sin(f*x + e))/(a^2*f*cos(f*x + e)^2 - a^2 
*f*cos(f*x + e) - 2*a^2*f - (a^2*f*cos(f*x + e) + 2*a^2*f)*sin(f*x + e))
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 3585 vs. \(2 (109) = 218\).

Time = 4.39 (sec) , antiderivative size = 3585, normalized size of antiderivative = 29.88 \[ \int \frac {(c+d \sin (e+f x))^3}{(a+a \sin (e+f x))^2} \, dx=\text {Too large to display} \] Input:

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

Output:

Piecewise((-6*c**3*tan(e/2 + f*x/2)**4/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a 
**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan( 
e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 6*c**3*tan(e/2 + 
 f*x/2)**3/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 
12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*t 
an(e/2 + f*x/2) + 3*a**2*f) - 10*c**3*tan(e/2 + f*x/2)**2/(3*a**2*f*tan(e/ 
2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)* 
*3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) 
 - 6*c**3*tan(e/2 + f*x/2)/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/ 
2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2) 
**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 4*c**3/(3*a**2*f*tan(e/2 + f 
*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 
12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 18 
*c**2*d*tan(e/2 + f*x/2)**3/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e 
/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2 
)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 6*c**2*d*tan(e/2 + f*x/2)** 
2/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f 
*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + 
f*x/2) + 3*a**2*f) - 18*c**2*d*tan(e/2 + f*x/2)/(3*a**2*f*tan(e/2 + f*x/2) 
**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12...
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 591 vs. \(2 (114) = 228\).

Time = 0.12 (sec) , antiderivative size = 591, normalized size of antiderivative = 4.92 \[ \int \frac {(c+d \sin (e+f x))^3}{(a+a \sin (e+f x))^2} \, dx =\text {Too large to display} \] Input:

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

Output:

-2/3*(2*d^3*((12*sin(f*x + e)/(cos(f*x + e) + 1) + 11*sin(f*x + e)^2/(cos( 
f*x + e) + 1)^2 + 9*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 + 3*sin(f*x + e)^4 
/(cos(f*x + e) + 1)^4 + 5)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e) + 1) + 
4*a^2*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 4*a^2*sin(f*x + e)^3/(cos(f*x 
+ e) + 1)^3 + 3*a^2*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + a^2*sin(f*x + e) 
^5/(cos(f*x + e) + 1)^5) + 3*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a^2) 
- 3*c*d^2*((9*sin(f*x + e)/(cos(f*x + e) + 1) + 3*sin(f*x + e)^2/(cos(f*x 
+ e) + 1)^2 + 4)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e) + 1) + 3*a^2*sin( 
f*x + e)^2/(cos(f*x + e) + 1)^2 + a^2*sin(f*x + e)^3/(cos(f*x + e) + 1)^3) 
 + 3*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a^2) + c^3*(3*sin(f*x + e)/(c 
os(f*x + e) + 1) + 3*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 2)/(a^2 + 3*a^2 
*sin(f*x + e)/(cos(f*x + e) + 1) + 3*a^2*sin(f*x + e)^2/(cos(f*x + e) + 1) 
^2 + a^2*sin(f*x + e)^3/(cos(f*x + e) + 1)^3) + 3*c^2*d*(3*sin(f*x + e)/(c 
os(f*x + e) + 1) + 1)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e) + 1) + 3*a^2 
*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + a^2*sin(f*x + e)^3/(cos(f*x + e) + 
1)^3))/f
 

Giac [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 199, normalized size of antiderivative = 1.66 \[ \int \frac {(c+d \sin (e+f x))^3}{(a+a \sin (e+f x))^2} \, dx=\frac {\frac {3 \, {\left (3 \, c d^{2} - 2 \, d^{3}\right )} {\left (f x + e\right )}}{a^{2}} - \frac {6 \, d^{3}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1\right )} a^{2}} - \frac {2 \, {\left (3 \, c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 9 \, c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 6 \, d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 9 \, c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 27 \, c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 15 \, d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 2 \, c^{3} + 3 \, c^{2} d - 12 \, c d^{2} + 7 \, d^{3}\right )}}{a^{2} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}^{3}}}{3 \, f} \] Input:

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

Output:

1/3*(3*(3*c*d^2 - 2*d^3)*(f*x + e)/a^2 - 6*d^3/((tan(1/2*f*x + 1/2*e)^2 + 
1)*a^2) - 2*(3*c^3*tan(1/2*f*x + 1/2*e)^2 - 9*c*d^2*tan(1/2*f*x + 1/2*e)^2 
 + 6*d^3*tan(1/2*f*x + 1/2*e)^2 + 3*c^3*tan(1/2*f*x + 1/2*e) + 9*c^2*d*tan 
(1/2*f*x + 1/2*e) - 27*c*d^2*tan(1/2*f*x + 1/2*e) + 15*d^3*tan(1/2*f*x + 1 
/2*e) + 2*c^3 + 3*c^2*d - 12*c*d^2 + 7*d^3)/(a^2*(tan(1/2*f*x + 1/2*e) + 1 
)^3))/f
 

Mupad [B] (verification not implemented)

Time = 17.32 (sec) , antiderivative size = 298, normalized size of antiderivative = 2.48 \[ \int \frac {(c+d \sin (e+f x))^3}{(a+a \sin (e+f x))^2} \, dx=\frac {2\,d^2\,\mathrm {atan}\left (\frac {2\,d^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (3\,c-2\,d\right )}{6\,c\,d^2-4\,d^3}\right )\,\left (3\,c-2\,d\right )}{a^2\,f}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (2\,c^3+6\,c^2\,d-18\,c\,d^2+12\,d^3\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {10\,c^3}{3}+2\,c^2\,d-14\,c\,d^2+\frac {44\,d^3}{3}\right )-8\,c\,d^2+2\,c^2\,d+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (2\,c^3-6\,c\,d^2+4\,d^3\right )+\frac {4\,c^3}{3}+\frac {20\,d^3}{3}+\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (2\,c^3+6\,c^2\,d-18\,c\,d^2+16\,d^3\right )}{f\,\left (a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+3\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+4\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+4\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+3\,a^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+a^2\right )} \] Input:

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

Output:

(2*d^2*atan((2*d^2*tan(e/2 + (f*x)/2)*(3*c - 2*d))/(6*c*d^2 - 4*d^3))*(3*c 
 - 2*d))/(a^2*f) - (tan(e/2 + (f*x)/2)^3*(6*c^2*d - 18*c*d^2 + 2*c^3 + 12* 
d^3) + tan(e/2 + (f*x)/2)^2*(2*c^2*d - 14*c*d^2 + (10*c^3)/3 + (44*d^3)/3) 
 - 8*c*d^2 + 2*c^2*d + tan(e/2 + (f*x)/2)^4*(2*c^3 - 6*c*d^2 + 4*d^3) + (4 
*c^3)/3 + (20*d^3)/3 + tan(e/2 + (f*x)/2)*(6*c^2*d - 18*c*d^2 + 2*c^3 + 16 
*d^3))/(f*(4*a^2*tan(e/2 + (f*x)/2)^2 + 4*a^2*tan(e/2 + (f*x)/2)^3 + 3*a^2 
*tan(e/2 + (f*x)/2)^4 + a^2*tan(e/2 + (f*x)/2)^5 + a^2 + 3*a^2*tan(e/2 + ( 
f*x)/2)))
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 438, normalized size of antiderivative = 3.65 \[ \int \frac {(c+d \sin (e+f x))^3}{(a+a \sin (e+f x))^2} \, dx=\frac {2 \cos \left (f x +e \right ) c^{3}+4 \cos \left (f x +e \right ) d^{3}+\cos \left (f x +e \right ) \sin \left (f x +e \right ) c^{3}-6 \cos \left (f x +e \right ) d^{3} f x -4 d^{3}-21 \sin \left (f x +e \right )^{2} c \,d^{2}+3 \cos \left (f x +e \right ) \sin \left (f x +e \right ) c^{2} d -9 \cos \left (f x +e \right ) \sin \left (f x +e \right ) c \,d^{2}-9 c \,d^{2} f x -2 c^{3}+3 \sin \left (f x +e \right )^{3} d^{3}+8 \sin \left (f x +e \right ) d^{3}-6 \cos \left (f x +e \right ) \sin \left (f x +e \right ) d^{3} f x -9 \sin \left (f x +e \right )^{2} c \,d^{2} f x +3 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} d^{3}+8 \cos \left (f x +e \right ) \sin \left (f x +e \right ) d^{3}-6 \cos \left (f x +e \right ) c \,d^{2}+6 d^{3} f x +6 \sin \left (f x +e \right )^{2} d^{3} f x +12 \sin \left (f x +e \right ) d^{3} f x +3 \sin \left (f x +e \right ) c^{2} d +\sin \left (f x +e \right )^{2} c^{3}+\sin \left (f x +e \right ) c^{3}+9 \cos \left (f x +e \right ) c \,d^{2} f x +9 \cos \left (f x +e \right ) \sin \left (f x +e \right ) c \,d^{2} f x -18 \sin \left (f x +e \right ) c \,d^{2} f x +9 \sin \left (f x +e \right )^{2} c^{2} d +6 c \,d^{2}-9 \sin \left (f x +e \right ) c \,d^{2}+17 \sin \left (f x +e \right )^{2} d^{3}}{3 a^{2} f \left (\cos \left (f x +e \right ) \sin \left (f x +e \right )+\cos \left (f x +e \right )-\sin \left (f x +e \right )^{2}-2 \sin \left (f x +e \right )-1\right )} \] Input:

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

Output:

(3*cos(e + f*x)*sin(e + f*x)**2*d**3 + cos(e + f*x)*sin(e + f*x)*c**3 + 3* 
cos(e + f*x)*sin(e + f*x)*c**2*d + 9*cos(e + f*x)*sin(e + f*x)*c*d**2*f*x 
- 9*cos(e + f*x)*sin(e + f*x)*c*d**2 - 6*cos(e + f*x)*sin(e + f*x)*d**3*f* 
x + 8*cos(e + f*x)*sin(e + f*x)*d**3 + 2*cos(e + f*x)*c**3 + 9*cos(e + f*x 
)*c*d**2*f*x - 6*cos(e + f*x)*c*d**2 - 6*cos(e + f*x)*d**3*f*x + 4*cos(e + 
 f*x)*d**3 + 3*sin(e + f*x)**3*d**3 + sin(e + f*x)**2*c**3 + 9*sin(e + f*x 
)**2*c**2*d - 9*sin(e + f*x)**2*c*d**2*f*x - 21*sin(e + f*x)**2*c*d**2 + 6 
*sin(e + f*x)**2*d**3*f*x + 17*sin(e + f*x)**2*d**3 + sin(e + f*x)*c**3 + 
3*sin(e + f*x)*c**2*d - 18*sin(e + f*x)*c*d**2*f*x - 9*sin(e + f*x)*c*d**2 
 + 12*sin(e + f*x)*d**3*f*x + 8*sin(e + f*x)*d**3 - 2*c**3 - 9*c*d**2*f*x 
+ 6*c*d**2 + 6*d**3*f*x - 4*d**3)/(3*a**2*f*(cos(e + f*x)*sin(e + f*x) + c 
os(e + f*x) - sin(e + f*x)**2 - 2*sin(e + f*x) - 1))