Integrand size = 35, antiderivative size = 132 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(a+a \sin (e+f x))^2} \, dx=\frac {d (2 B (c-d)+A d) x}{a^2}+\frac {(A-4 B) d^2 \cos (e+f x)}{3 a^2 f}-\frac {(c-d) (2 B (c-3 d)+A (c+3 d)) \cos (e+f x)}{3 a^2 f (1+\sin (e+f x))}-\frac {(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a+a \sin (e+f x))^2} \] Output:
d*(2*B*(c-d)+A*d)*x/a^2+1/3*(A-4*B)*d^2*cos(f*x+e)/a^2/f-1/3*(c-d)*(2*B*(c -3*d)+A*(c+3*d))*cos(f*x+e)/a^2/f/(1+sin(f*x+e))-1/3*(A-B)*cos(f*x+e)*(c+d *sin(f*x+e))^2/f/(a+a*sin(f*x+e))^2
Leaf count is larger than twice the leaf count of optimal. \(338\) vs. \(2(132)=264\).
Time = 2.38 (sec) , antiderivative size = 338, normalized size of antiderivative = 2.56 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(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 (6 \left (A d (4 c+d (-4+3 e+3 f x))+B \left (2 c^2+d^2 (5-6 e-6 f x)+2 c d (-4+3 e+3 f x)\right )\right ) \cos \left (\frac {1}{2} (e+f x)\right )-\left (B \left (8 c^2+d^2 (41-12 e-12 f x)+4 c d (-10+3 e+3 f x)\right )+2 A \left (2 c^2+8 c d+d^2 (-10+3 e+3 f x)\right )\right ) \cos \left (\frac {3}{2} (e+f x)\right )+3 B d^2 \cos \left (\frac {5}{2} (e+f x)\right )+6 \left (2 A c^2+2 B c^2+4 A c d-12 B c d-6 A d^2+9 B d^2+8 B c d e+4 A d^2 e-8 B d^2 e+8 B c d f x+4 A d^2 f x-8 B d^2 f x-2 d (-2 B c (e+f x)-A d (e+f x)+2 B d (1+e+f x)) \cos (e+f x)-B d^2 \cos (2 (e+f x))\right ) \sin \left (\frac {1}{2} (e+f x)\right )\right )}{12 a^2 f (1+\sin (e+f x))^2} \] Input:
Integrate[((A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2)/(a + a*Sin[e + f*x ])^2,x]
Output:
((Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(6*(A*d*(4*c + d*(-4 + 3*e + 3*f*x) ) + B*(2*c^2 + d^2*(5 - 6*e - 6*f*x) + 2*c*d*(-4 + 3*e + 3*f*x)))*Cos[(e + f*x)/2] - (B*(8*c^2 + d^2*(41 - 12*e - 12*f*x) + 4*c*d*(-10 + 3*e + 3*f*x )) + 2*A*(2*c^2 + 8*c*d + d^2*(-10 + 3*e + 3*f*x)))*Cos[(3*(e + f*x))/2] + 3*B*d^2*Cos[(5*(e + f*x))/2] + 6*(2*A*c^2 + 2*B*c^2 + 4*A*c*d - 12*B*c*d - 6*A*d^2 + 9*B*d^2 + 8*B*c*d*e + 4*A*d^2*e - 8*B*d^2*e + 8*B*c*d*f*x + 4* A*d^2*f*x - 8*B*d^2*f*x - 2*d*(-2*B*c*(e + f*x) - A*d*(e + f*x) + 2*B*d*(1 + e + f*x))*Cos[e + f*x] - B*d^2*Cos[2*(e + f*x)])*Sin[(e + f*x)/2]))/(12 *a^2*f*(1 + Sin[e + f*x])^2)
Time = 1.05 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.05, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 3456, 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 {(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(a \sin (e+f x)+a)^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(a \sin (e+f x)+a)^2}dx\) |
\(\Big \downarrow \) 3456 |
\(\displaystyle \frac {\int \frac {(c+d \sin (e+f x)) (a (2 B (c-d)+A (c+2 d))-a (A-4 B) d \sin (e+f x))}{\sin (e+f x) a+a}dx}{3 a^2}-\frac {(A-B) \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)) (a (2 B (c-d)+A (c+2 d))-a (A-4 B) d \sin (e+f x))}{\sin (e+f x) a+a}dx}{3 a^2}-\frac {(A-B) \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 (A-4 B) d^2 \sin ^2(e+f x)+(a d (2 B (c-d)+A (c+2 d))-a (A-4 B) c d) \sin (e+f x)+a c (2 B (c-d)+A (c+2 d))}{\sin (e+f x) a+a}dx}{3 a^2}-\frac {(A-B) \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 (A-4 B) d^2 \sin (e+f x)^2+(a d (2 B (c-d)+A (c+2 d))-a (A-4 B) c d) \sin (e+f x)+a c (2 B (c-d)+A (c+2 d))}{\sin (e+f x) a+a}dx}{3 a^2}-\frac {(A-B) \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 (2 B (c-d)+A (c+2 d)) a^2+3 d (2 B (c-d)+A d) \sin (e+f x) a^2}{\sin (e+f x) a+a}dx}{a}+\frac {d^2 (A-4 B) \cos (e+f x)}{f}}{3 a^2}-\frac {(A-B) \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 (2 B (c-d)+A (c+2 d)) a^2+3 d (2 B (c-d)+A d) \sin (e+f x) a^2}{\sin (e+f x) a+a}dx}{a}+\frac {d^2 (A-4 B) \cos (e+f x)}{f}}{3 a^2}-\frac {(A-B) \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-d) (A (c+3 d)+2 B (c-3 d)) \int \frac {1}{\sin (e+f x) a+a}dx+3 a d x (A d+2 B (c-d))}{a}+\frac {d^2 (A-4 B) \cos (e+f x)}{f}}{3 a^2}-\frac {(A-B) \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-d) (A (c+3 d)+2 B (c-3 d)) \int \frac {1}{\sin (e+f x) a+a}dx+3 a d x (A d+2 B (c-d))}{a}+\frac {d^2 (A-4 B) \cos (e+f x)}{f}}{3 a^2}-\frac {(A-B) \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 x (A d+2 B (c-d))-\frac {a^2 (c-d) (A (c+3 d)+2 B (c-3 d)) \cos (e+f x)}{f (a \sin (e+f x)+a)}}{a}+\frac {d^2 (A-4 B) \cos (e+f x)}{f}}{3 a^2}-\frac {(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a \sin (e+f x)+a)^2}\) |
Input:
Int[((A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2)/(a + a*Sin[e + f*x])^2,x ]
Output:
-1/3*((A - B)*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(f*(a + a*Sin[e + f*x]) ^2) + (((A - 4*B)*d^2*Cos[e + f*x])/f + (3*a*d*(2*B*(c - d) + A*d)*x - (a^ 2*(c - d)*(2*B*(c - 3*d) + A*(c + 3*d))*Cos[e + f*x])/(f*(a + a*Sin[e + f* x])))/a)/(3*a^2)
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]
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]
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]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^n/( 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 - 1)*Simp[A*(a*d*n - b*c*(m + 1)) - B*(a*c*m + b*d*n) - d*(a*B*(m - n) + A*b*(m + n + 1))*Sin[e + f*x], x], x], x] /; Fre eQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] & & NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)] && GtQ[n, 0] && IntegerQ[2*m] && (In tegerQ[2*n] || EqQ[c, 0])
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]
Time = 1.04 (sec) , antiderivative size = 193, normalized size of antiderivative = 1.46
method | result | size |
derivativedivides | \(\frac {-\frac {2 \left (A \,c^{2}-A \,d^{2}-2 B c d +2 B \,d^{2}\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}-\frac {-2 A \,c^{2}+4 A c d -2 A \,d^{2}+2 B \,c^{2}-4 B c d +2 B \,d^{2}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}-\frac {2 \left (2 A \,c^{2}-4 A c d +2 A \,d^{2}-2 B \,c^{2}+4 B c d -2 B \,d^{2}\right )}{3 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+2 d \left (-\frac {B d}{1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}+\left (A d +2 B c -2 B d \right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{a^{2} f}\) | \(193\) |
default | \(\frac {-\frac {2 \left (A \,c^{2}-A \,d^{2}-2 B c d +2 B \,d^{2}\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}-\frac {-2 A \,c^{2}+4 A c d -2 A \,d^{2}+2 B \,c^{2}-4 B c d +2 B \,d^{2}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}-\frac {2 \left (2 A \,c^{2}-4 A c d +2 A \,d^{2}-2 B \,c^{2}+4 B c d -2 B \,d^{2}\right )}{3 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+2 d \left (-\frac {B d}{1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}+\left (A d +2 B c -2 B d \right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{a^{2} f}\) | \(193\) |
risch | \(\frac {d^{2} x A}{a^{2}}+\frac {2 d x B c}{a^{2}}-\frac {2 d^{2} x B}{a^{2}}-\frac {B \,d^{2} {\mathrm e}^{i \left (f x +e \right )}}{2 a^{2} f}-\frac {B \,d^{2} {\mathrm e}^{-i \left (f x +e \right )}}{2 a^{2} f}-\frac {2 \left (3 B \,c^{2} {\mathrm e}^{2 i \left (f x +e \right )}-A \,c^{2}-2 B \,c^{2}+5 A \,d^{2}-4 A c d -8 B \,d^{2}+3 i B \,c^{2} {\mathrm e}^{i \left (f x +e \right )}+6 A c d \,{\mathrm e}^{2 i \left (f x +e \right )}+6 i A c d \,{\mathrm e}^{i \left (f x +e \right )}-6 A \,d^{2} {\mathrm e}^{2 i \left (f x +e \right )}+9 B \,d^{2} {\mathrm e}^{2 i \left (f x +e \right )}+10 B c d -12 B c d \,{\mathrm e}^{2 i \left (f x +e \right )}+3 i A \,c^{2} {\mathrm e}^{i \left (f x +e \right )}-18 i B c d \,{\mathrm e}^{i \left (f x +e \right )}-9 i A \,d^{2} {\mathrm e}^{i \left (f x +e \right )}+15 i B \,d^{2} {\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}}\) | \(296\) |
parallelrisch | \(\frac {\left (\left (-18 f x A +36 f x B -30 A +78 B \right ) d^{2}+12 \left (\left (-3 f x -5\right ) B +A \right ) c d +18 c^{2} \left (A +\frac {B}{3}\right )\right ) \cos \left (\frac {f x}{2}+\frac {e}{2}\right )+\left (\left (6 f x A -12 f x B -2 A +5 B \right ) d^{2}+4 c \left (\left (3 f x -1\right ) B +A \right ) d -2 c^{2} \left (A -B \right )\right ) \cos \left (\frac {3 f x}{2}+\frac {3 e}{2}\right )+\left (\left (-18 f x A +36 f x B -18 A +42 B \right ) d^{2}+12 \left (\left (-3 f x -3\right ) B +A \right ) c d +6 c^{2} \left (A +B \right )\right ) \sin \left (\frac {f x}{2}+\frac {e}{2}\right )+\left (\left (-6 f x A +12 f x B -18 A +45 B \right ) d^{2}+12 c \left (\left (-f x -3\right ) B +A \right ) d +6 c^{2} \left (A +B \right )\right ) \sin \left (\frac {3 f x}{2}+\frac {3 e}{2}\right )-3 B \,d^{2} \left (\cos \left (\frac {5 f x}{2}+\frac {5 e}{2}\right )-\sin \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 )}\) | \(302\) |
norman | \(\frac {\frac {d \left (A d +2 B c -2 B d \right ) x}{a}+\frac {d \left (A d +2 B c -2 B d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{9}}{a}-\frac {4 A \,c^{2}+4 A c d -8 A \,d^{2}+2 B \,c^{2}-16 B c d +20 B \,d^{2}}{3 a f}-\frac {\left (2 A \,c^{2}-2 A \,d^{2}-4 B c d +4 B \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}}{a f}-\frac {2 \left (A \,c^{2}+2 A c d -3 A \,d^{2}+B \,c^{2}-6 B c d +6 B \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{a f}-\frac {\left (2 A \,c^{2}+4 A c d -6 A \,d^{2}+2 B \,c^{2}-12 B c d +16 B \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}-\frac {2 \left (3 A \,c^{2}+2 A c d -5 A \,d^{2}+B \,c^{2}-10 B c d +14 B \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{a f}-\frac {2 \left (3 A \,c^{2}+6 A c d -9 A \,d^{2}+3 B \,c^{2}-18 B c d +20 B \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{a f}-\frac {2 \left (3 A \,c^{2}+6 A c d -9 A \,d^{2}+3 B \,c^{2}-18 B c d +22 B \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{a f}-\frac {2 \left (5 A \,c^{2}+2 A c d -7 A \,d^{2}+B \,c^{2}-14 B c d +20 B \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{a f}-\frac {2 \left (11 A \,c^{2}+2 A c d -13 A \,d^{2}+B \,c^{2}-26 B c d +34 B \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{3 a f}+\frac {3 d \left (A d +2 B c -2 B d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a}+\frac {6 d \left (A d +2 B c -2 B d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{a}+\frac {10 d \left (A d +2 B c -2 B d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{a}+\frac {12 d \left (A d +2 B c -2 B d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{a}+\frac {12 d \left (A d +2 B c -2 B d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{a}+\frac {10 d \left (A d +2 B c -2 B d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{a}+\frac {6 d \left (A d +2 B c -2 B d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{a}+\frac {3 d \left (A d +2 B c -2 B 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}}\) | \(776\) |
Input:
int((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^2,x,method=_RETUR NVERBOSE)
Output:
2/f/a^2*(-(A*c^2-A*d^2-2*B*c*d+2*B*d^2)/(tan(1/2*f*x+1/2*e)+1)-1/2*(-2*A*c ^2+4*A*c*d-2*A*d^2+2*B*c^2-4*B*c*d+2*B*d^2)/(tan(1/2*f*x+1/2*e)+1)^2-1/3*( 2*A*c^2-4*A*c*d+2*A*d^2-2*B*c^2+4*B*c*d-2*B*d^2)/(tan(1/2*f*x+1/2*e)+1)^3+ d*(-B*d/(1+tan(1/2*f*x+1/2*e)^2)+(A*d+2*B*c-2*B*d)*arctan(tan(1/2*f*x+1/2* e))))
Leaf count of result is larger than twice the leaf count of optimal. 375 vs. \(2 (126) = 252\).
Time = 0.09 (sec) , antiderivative size = 375, normalized size of antiderivative = 2.84 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(a+a \sin (e+f x))^2} \, dx=-\frac {3 \, B d^{2} \cos \left (f x + e\right )^{3} - {\left (A - B\right )} c^{2} + 2 \, {\left (A - B\right )} c d - {\left (A - B\right )} d^{2} + 6 \, {\left (2 \, B c d + {\left (A - 2 \, B\right )} d^{2}\right )} f x - {\left ({\left (A + 2 \, B\right )} c^{2} + 2 \, {\left (2 \, A - 5 \, B\right )} c d - {\left (5 \, A - 11 \, B\right )} d^{2} + 3 \, {\left (2 \, B c d + {\left (A - 2 \, B\right )} d^{2}\right )} f x\right )} \cos \left (f x + e\right )^{2} - {\left ({\left (2 \, A + B\right )} c^{2} + 2 \, {\left (A - 4 \, B\right )} c d - {\left (4 \, A - 13 \, B\right )} d^{2} - 3 \, {\left (2 \, B c d + {\left (A - 2 \, B\right )} d^{2}\right )} f x\right )} \cos \left (f x + e\right ) - {\left (3 \, B d^{2} \cos \left (f x + e\right )^{2} - {\left (A - B\right )} c^{2} + 2 \, {\left (A - B\right )} c d - {\left (A - B\right )} d^{2} - 6 \, {\left (2 \, B c d + {\left (A - 2 \, B\right )} d^{2}\right )} f x + {\left ({\left (A + 2 \, B\right )} c^{2} + 2 \, {\left (2 \, A - 5 \, B\right )} c d - {\left (5 \, A - 14 \, B\right )} d^{2} - 3 \, {\left (2 \, B c d + {\left (A - 2 \, B\right )} d^{2}\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((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^2,x, algori thm="fricas")
Output:
-1/3*(3*B*d^2*cos(f*x + e)^3 - (A - B)*c^2 + 2*(A - B)*c*d - (A - B)*d^2 + 6*(2*B*c*d + (A - 2*B)*d^2)*f*x - ((A + 2*B)*c^2 + 2*(2*A - 5*B)*c*d - (5 *A - 11*B)*d^2 + 3*(2*B*c*d + (A - 2*B)*d^2)*f*x)*cos(f*x + e)^2 - ((2*A + B)*c^2 + 2*(A - 4*B)*c*d - (4*A - 13*B)*d^2 - 3*(2*B*c*d + (A - 2*B)*d^2) *f*x)*cos(f*x + e) - (3*B*d^2*cos(f*x + e)^2 - (A - B)*c^2 + 2*(A - B)*c*d - (A - B)*d^2 - 6*(2*B*c*d + (A - 2*B)*d^2)*f*x + ((A + 2*B)*c^2 + 2*(2*A - 5*B)*c*d - (5*A - 14*B)*d^2 - 3*(2*B*c*d + (A - 2*B)*d^2)*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))
Leaf count of result is larger than twice the leaf count of optimal. 5358 vs. \(2 (121) = 242\).
Time = 4.61 (sec) , antiderivative size = 5358, normalized size of antiderivative = 40.59 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(a+a \sin (e+f x))^2} \, dx=\text {Too large to display} \] Input:
integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))**2/(a+a*sin(f*x+e))**2,x)
Output:
Piecewise((-6*A*c**2*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*ta n(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 6*A*c**2*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) - 10*A*c**2*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*A*c**2*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*A*c**2/(3*a**2*f*t an(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) - 12*A*c*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) - 4*A*c*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 + 1 2*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*ta n(e/2 + f*x/2) + 3*a**2*f) - 12*A*c*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)*...
Leaf count of result is larger than twice the leaf count of optimal. 831 vs. \(2 (126) = 252\).
Time = 0.13 (sec) , antiderivative size = 831, normalized size of antiderivative = 6.30 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(a+a \sin (e+f x))^2} \, dx=\text {Too large to display} \] Input:
integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^2,x, algori thm="maxima")
Output:
-2/3*(2*B*d^2*((12*sin(f*x + e)/(cos(f*x + e) + 1) + 11*sin(f*x + e)^2/(co s(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 ) - 2*B*c*d*((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*si n(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) - A*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) + A*c^2*(3*sin(f*x + e)/(cos(f*x + e) + 1) + 3*s in(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) + B*c^2*(3*sin(f*x + e)/(cos(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) + 2*A*c*d*(3*sin(f *x + e)/(cos(f*x + e) + 1) + 1)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e)...
Leaf count of result is larger than twice the leaf count of optimal. 264 vs. \(2 (126) = 252\).
Time = 0.23 (sec) , antiderivative size = 264, normalized size of antiderivative = 2.00 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(a+a \sin (e+f x))^2} \, dx=\frac {\frac {3 \, {\left (2 \, B c d + A d^{2} - 2 \, B d^{2}\right )} {\left (f x + e\right )}}{a^{2}} - \frac {6 \, B d^{2}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1\right )} a^{2}} - \frac {2 \, {\left (3 \, A c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 6 \, B c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 3 \, A d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 6 \, B d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, A c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 3 \, B c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 6 \, A c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 18 \, B c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 9 \, A d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 15 \, B d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 2 \, A c^{2} + B c^{2} + 2 \, A c d - 8 \, B c d - 4 \, A d^{2} + 7 \, B d^{2}\right )}}{a^{2} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}^{3}}}{3 \, f} \] Input:
integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^2,x, algori thm="giac")
Output:
1/3*(3*(2*B*c*d + A*d^2 - 2*B*d^2)*(f*x + e)/a^2 - 6*B*d^2/((tan(1/2*f*x + 1/2*e)^2 + 1)*a^2) - 2*(3*A*c^2*tan(1/2*f*x + 1/2*e)^2 - 6*B*c*d*tan(1/2* f*x + 1/2*e)^2 - 3*A*d^2*tan(1/2*f*x + 1/2*e)^2 + 6*B*d^2*tan(1/2*f*x + 1/ 2*e)^2 + 3*A*c^2*tan(1/2*f*x + 1/2*e) + 3*B*c^2*tan(1/2*f*x + 1/2*e) + 6*A *c*d*tan(1/2*f*x + 1/2*e) - 18*B*c*d*tan(1/2*f*x + 1/2*e) - 9*A*d^2*tan(1/ 2*f*x + 1/2*e) + 15*B*d^2*tan(1/2*f*x + 1/2*e) + 2*A*c^2 + B*c^2 + 2*A*c*d - 8*B*c*d - 4*A*d^2 + 7*B*d^2)/(a^2*(tan(1/2*f*x + 1/2*e) + 1)^3))/f
Time = 39.33 (sec) , antiderivative size = 365, normalized size of antiderivative = 2.77 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(a+a \sin (e+f x))^2} \, dx=\frac {2\,d\,\mathrm {atan}\left (\frac {2\,d\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (A\,d+2\,B\,c-2\,B\,d\right )}{2\,A\,d^2-4\,B\,d^2+4\,B\,c\,d}\right )\,\left (A\,d+2\,B\,c-2\,B\,d\right )}{a^2\,f}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (2\,A\,c^2-6\,A\,d^2+2\,B\,c^2+12\,B\,d^2+4\,A\,c\,d-12\,B\,c\,d\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {10\,A\,c^2}{3}-\frac {14\,A\,d^2}{3}+\frac {2\,B\,c^2}{3}+\frac {44\,B\,d^2}{3}+\frac {4\,A\,c\,d}{3}-\frac {28\,B\,c\,d}{3}\right )+\frac {4\,A\,c^2}{3}-\frac {8\,A\,d^2}{3}+\frac {2\,B\,c^2}{3}+\frac {20\,B\,d^2}{3}+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (2\,A\,c^2-2\,A\,d^2+4\,B\,d^2-4\,B\,c\,d\right )+\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (2\,A\,c^2-6\,A\,d^2+2\,B\,c^2+16\,B\,d^2+4\,A\,c\,d-12\,B\,c\,d\right )+\frac {4\,A\,c\,d}{3}-\frac {16\,B\,c\,d}{3}}{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(((A + B*sin(e + f*x))*(c + d*sin(e + f*x))^2)/(a + a*sin(e + f*x))^2,x )
Output:
(2*d*atan((2*d*tan(e/2 + (f*x)/2)*(A*d + 2*B*c - 2*B*d))/(2*A*d^2 - 4*B*d^ 2 + 4*B*c*d))*(A*d + 2*B*c - 2*B*d))/(a^2*f) - (tan(e/2 + (f*x)/2)^3*(2*A* c^2 - 6*A*d^2 + 2*B*c^2 + 12*B*d^2 + 4*A*c*d - 12*B*c*d) + tan(e/2 + (f*x) /2)^2*((10*A*c^2)/3 - (14*A*d^2)/3 + (2*B*c^2)/3 + (44*B*d^2)/3 + (4*A*c*d )/3 - (28*B*c*d)/3) + (4*A*c^2)/3 - (8*A*d^2)/3 + (2*B*c^2)/3 + (20*B*d^2) /3 + tan(e/2 + (f*x)/2)^4*(2*A*c^2 - 2*A*d^2 + 4*B*d^2 - 4*B*c*d) + tan(e/ 2 + (f*x)/2)*(2*A*c^2 - 6*A*d^2 + 2*B*c^2 + 16*B*d^2 + 4*A*c*d - 12*B*c*d) + (4*A*c*d)/3 - (16*B*c*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)))
Time = 0.18 (sec) , antiderivative size = 618, normalized size of antiderivative = 4.68 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(a+a \sin (e+f x))^2} \, dx=\frac {17 \sin \left (f x +e \right )^{2} b \,d^{2}-3 \sin \left (f x +e \right ) a \,d^{2}+3 \sin \left (f x +e \right )^{2} b \,c^{2}+6 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b c d f x +3 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b \,d^{2}-3 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a \,d^{2}+\cos \left (f x +e \right ) \sin \left (f x +e \right ) b \,c^{2}+8 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b \,d^{2}-4 \cos \left (f x +e \right ) b c d -3 a \,d^{2} f x +6 b \,d^{2} f x +2 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a c d -6 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b c d -6 b c d f x +8 \sin \left (f x +e \right ) b \,d^{2}-6 \sin \left (f x +e \right ) b c d +\sin \left (f x +e \right )^{2} a \,c^{2}+\sin \left (f x +e \right ) a \,c^{2}+6 \sin \left (f x +e \right )^{2} a c d +2 a \,d^{2}-4 b \,d^{2}-2 a \,c^{2}+\cos \left (f x +e \right ) \sin \left (f x +e \right ) a \,c^{2}+3 \cos \left (f x +e \right ) a \,d^{2} f x -6 \cos \left (f x +e \right ) b \,d^{2} f x -3 \sin \left (f x +e \right )^{2} a \,d^{2} f x +6 \sin \left (f x +e \right )^{2} b \,d^{2} f x +6 \cos \left (f x +e \right ) b c d f x -12 \sin \left (f x +e \right ) b c d f x +3 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a \,d^{2} f x -6 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b \,d^{2} f x -6 \sin \left (f x +e \right )^{2} b c d f x +3 \sin \left (f x +e \right )^{3} b \,d^{2}-7 \sin \left (f x +e \right )^{2} a \,d^{2}-14 \sin \left (f x +e \right )^{2} b c d +\sin \left (f x +e \right ) b \,c^{2}+2 \sin \left (f x +e \right ) a c d -6 \sin \left (f x +e \right ) a \,d^{2} f x +12 \sin \left (f x +e \right ) b \,d^{2} f x +2 \cos \left (f x +e \right ) a \,c^{2}-2 \cos \left (f x +e \right ) a \,d^{2}+4 \cos \left (f x +e \right ) b \,d^{2}+4 b c d}{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((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^2,x)
Output:
(3*cos(e + f*x)*sin(e + f*x)**2*b*d**2 + cos(e + f*x)*sin(e + f*x)*a*c**2 + 2*cos(e + f*x)*sin(e + f*x)*a*c*d + 3*cos(e + f*x)*sin(e + f*x)*a*d**2*f *x - 3*cos(e + f*x)*sin(e + f*x)*a*d**2 + cos(e + f*x)*sin(e + f*x)*b*c**2 + 6*cos(e + f*x)*sin(e + f*x)*b*c*d*f*x - 6*cos(e + f*x)*sin(e + f*x)*b*c *d - 6*cos(e + f*x)*sin(e + f*x)*b*d**2*f*x + 8*cos(e + f*x)*sin(e + f*x)* b*d**2 + 2*cos(e + f*x)*a*c**2 + 3*cos(e + f*x)*a*d**2*f*x - 2*cos(e + f*x )*a*d**2 + 6*cos(e + f*x)*b*c*d*f*x - 4*cos(e + f*x)*b*c*d - 6*cos(e + f*x )*b*d**2*f*x + 4*cos(e + f*x)*b*d**2 + 3*sin(e + f*x)**3*b*d**2 + sin(e + f*x)**2*a*c**2 + 6*sin(e + f*x)**2*a*c*d - 3*sin(e + f*x)**2*a*d**2*f*x - 7*sin(e + f*x)**2*a*d**2 + 3*sin(e + f*x)**2*b*c**2 - 6*sin(e + f*x)**2*b* c*d*f*x - 14*sin(e + f*x)**2*b*c*d + 6*sin(e + f*x)**2*b*d**2*f*x + 17*sin (e + f*x)**2*b*d**2 + sin(e + f*x)*a*c**2 + 2*sin(e + f*x)*a*c*d - 6*sin(e + f*x)*a*d**2*f*x - 3*sin(e + f*x)*a*d**2 + sin(e + f*x)*b*c**2 - 12*sin( e + f*x)*b*c*d*f*x - 6*sin(e + f*x)*b*c*d + 12*sin(e + f*x)*b*d**2*f*x + 8 *sin(e + f*x)*b*d**2 - 2*a*c**2 - 3*a*d**2*f*x + 2*a*d**2 - 6*b*c*d*f*x + 4*b*c*d + 6*b*d**2*f*x - 4*b*d**2)/(3*a**2*f*(cos(e + f*x)*sin(e + f*x) + cos(e + f*x) - sin(e + f*x)**2 - 2*sin(e + f*x) - 1))