Integrand size = 31, antiderivative size = 55 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx=-a^2 (A+2 B) x+\frac {a^2 (A+2 B) \cos (c+d x)}{d}+\frac {(A+B) \sec (c+d x) (a+a \sin (c+d x))^2}{d} \] Output:
-a^2*(A+2*B)*x+a^2*(A+2*B)*cos(d*x+c)/d+(A+B)*sec(d*x+c)*(a+a*sin(d*x+c))^ 2/d
Time = 0.38 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.65 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx=\frac {a^2 \sec (c+d x) \left (4 A+5 B+4 (A+2 B) \arcsin \left (\frac {\sqrt {1-\sin (c+d x)}}{\sqrt {2}}\right ) \sqrt {\cos ^2(c+d x)}+B \cos (2 (c+d x))+4 A \sin (c+d x)+4 B \sin (c+d x)\right )}{2 d} \] Input:
Integrate[Sec[c + d*x]^2*(a + a*Sin[c + d*x])^2*(A + B*Sin[c + d*x]),x]
Output:
(a^2*Sec[c + d*x]*(4*A + 5*B + 4*(A + 2*B)*ArcSin[Sqrt[1 - Sin[c + d*x]]/S qrt[2]]*Sqrt[Cos[c + d*x]^2] + B*Cos[2*(c + d*x)] + 4*A*Sin[c + d*x] + 4*B *Sin[c + d*x]))/(2*d)
Time = 0.29 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.91, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3042, 3334, 2009}
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 \sec ^2(c+d x) (a \sin (c+d x)+a)^2 (A+B \sin (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a \sin (c+d x)+a)^2 (A+B \sin (c+d x))}{\cos (c+d x)^2}dx\) |
\(\Big \downarrow \) 3334 |
\(\displaystyle \frac {(A+B) \sec (c+d x) (a \sin (c+d x)+a)^2}{d}-a (A+2 B) \int (\sin (c+d x) a+a)dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {(A+B) \sec (c+d x) (a \sin (c+d x)+a)^2}{d}-a (A+2 B) \left (a x-\frac {a \cos (c+d x)}{d}\right )\) |
Input:
Int[Sec[c + d*x]^2*(a + a*Sin[c + d*x])^2*(A + B*Sin[c + d*x]),x]
Output:
-(a*(A + 2*B)*(a*x - (a*Cos[c + d*x])/d)) + ((A + B)*Sec[c + d*x]*(a + a*S in[c + d*x])^2)/d
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-(b* c + a*d))*(g*Cos[e + f*x])^(p + 1)*((a + b*Sin[e + f*x])^m/(a*f*g*(p + 1))) , x] + Simp[b*((a*d*m + b*c*(m + p + 1))/(a*g^2*(p + 1))) Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x])^(m - 1), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && EqQ[a^2 - b^2, 0] && GtQ[m, -1] && LtQ[p, -1]
Time = 0.95 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.33
method | result | size |
parallelrisch | \(-\frac {\left (-\frac {B \cos \left (2 d x +2 c \right )}{2}+\left (d x A +2 d x B -2 A -3 B \right ) \cos \left (d x +c \right )+\left (-2 B -2 A \right ) \sin \left (d x +c \right )-2 A -\frac {5 B}{2}\right ) a^{2}}{d \cos \left (d x +c \right )}\) | \(73\) |
risch | \(-a^{2} x A -2 a^{2} x B +\frac {a^{2} B \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {a^{2} B \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {4 a^{2} A}{d \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}+\frac {4 a^{2} B}{d \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}\) | \(98\) |
derivativedivides | \(\frac {A \,a^{2} \left (\tan \left (d x +c \right )-d x -c \right )+a^{2} B \left (\frac {\sin \left (d x +c \right )^{4}}{\cos \left (d x +c \right )}+\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )\right )+\frac {2 A \,a^{2}}{\cos \left (d x +c \right )}+2 a^{2} B \left (\tan \left (d x +c \right )-d x -c \right )+A \,a^{2} \tan \left (d x +c \right )+\frac {a^{2} B}{\cos \left (d x +c \right )}}{d}\) | \(123\) |
default | \(\frac {A \,a^{2} \left (\tan \left (d x +c \right )-d x -c \right )+a^{2} B \left (\frac {\sin \left (d x +c \right )^{4}}{\cos \left (d x +c \right )}+\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )\right )+\frac {2 A \,a^{2}}{\cos \left (d x +c \right )}+2 a^{2} B \left (\tan \left (d x +c \right )-d x -c \right )+A \,a^{2} \tan \left (d x +c \right )+\frac {a^{2} B}{\cos \left (d x +c \right )}}{d}\) | \(123\) |
norman | \(\frac {\left (A \,a^{2}+2 a^{2} B \right ) x +\left (-2 A \,a^{2}-4 a^{2} B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (-A \,a^{2}-2 a^{2} B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (2 A \,a^{2}+4 a^{2} B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-\frac {4 A \,a^{2}+6 a^{2} B}{d}-\frac {2 \left (2 A \,a^{2}+a^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{d}-\frac {2 \left (6 A \,a^{2}+7 a^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}-\frac {4 a^{2} \left (A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {12 a^{2} \left (A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {12 a^{2} \left (A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {4 a^{2} \left (A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {2 a^{2} \left (6 A +5 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right ) \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}\) | \(312\) |
Input:
int(sec(d*x+c)^2*(a+a*sin(d*x+c))^2*(A+B*sin(d*x+c)),x,method=_RETURNVERBO SE)
Output:
-(-1/2*B*cos(2*d*x+2*c)+(A*d*x+2*B*d*x-2*A-3*B)*cos(d*x+c)+(-2*B-2*A)*sin( d*x+c)-2*A-5/2*B)*a^2/d/cos(d*x+c)
Leaf count of result is larger than twice the leaf count of optimal. 128 vs. \(2 (55) = 110\).
Time = 0.08 (sec) , antiderivative size = 128, normalized size of antiderivative = 2.33 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx=-\frac {{\left (A + 2 \, B\right )} a^{2} d x - B a^{2} \cos \left (d x + c\right )^{2} - 2 \, {\left (A + B\right )} a^{2} + {\left ({\left (A + 2 \, B\right )} a^{2} d x - {\left (2 \, A + 3 \, B\right )} a^{2}\right )} \cos \left (d x + c\right ) - {\left ({\left (A + 2 \, B\right )} a^{2} d x - B a^{2} \cos \left (d x + c\right ) + 2 \, {\left (A + B\right )} a^{2}\right )} \sin \left (d x + c\right )}{d \cos \left (d x + c\right ) - d \sin \left (d x + c\right ) + d} \] Input:
integrate(sec(d*x+c)^2*(a+a*sin(d*x+c))^2*(A+B*sin(d*x+c)),x, algorithm="f ricas")
Output:
-((A + 2*B)*a^2*d*x - B*a^2*cos(d*x + c)^2 - 2*(A + B)*a^2 + ((A + 2*B)*a^ 2*d*x - (2*A + 3*B)*a^2)*cos(d*x + c) - ((A + 2*B)*a^2*d*x - B*a^2*cos(d*x + c) + 2*(A + B)*a^2)*sin(d*x + c))/(d*cos(d*x + c) - d*sin(d*x + c) + d)
\[ \int \sec ^2(c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx=a^{2} \left (\int A \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 A \sin {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int A \sin ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \sin {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 B \sin ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \sin ^{3}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx\right ) \] Input:
integrate(sec(d*x+c)**2*(a+a*sin(d*x+c))**2*(A+B*sin(d*x+c)),x)
Output:
a**2*(Integral(A*sec(c + d*x)**2, x) + Integral(2*A*sin(c + d*x)*sec(c + d *x)**2, x) + Integral(A*sin(c + d*x)**2*sec(c + d*x)**2, x) + Integral(B*s in(c + d*x)*sec(c + d*x)**2, x) + Integral(2*B*sin(c + d*x)**2*sec(c + d*x )**2, x) + Integral(B*sin(c + d*x)**3*sec(c + d*x)**2, x))
Time = 0.12 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.89 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx=-\frac {{\left (d x + c - \tan \left (d x + c\right )\right )} A a^{2} + 2 \, {\left (d x + c - \tan \left (d x + c\right )\right )} B a^{2} - B a^{2} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} - A a^{2} \tan \left (d x + c\right ) - \frac {2 \, A a^{2}}{\cos \left (d x + c\right )} - \frac {B a^{2}}{\cos \left (d x + c\right )}}{d} \] Input:
integrate(sec(d*x+c)^2*(a+a*sin(d*x+c))^2*(A+B*sin(d*x+c)),x, algorithm="m axima")
Output:
-((d*x + c - tan(d*x + c))*A*a^2 + 2*(d*x + c - tan(d*x + c))*B*a^2 - B*a^ 2*(1/cos(d*x + c) + cos(d*x + c)) - A*a^2*tan(d*x + c) - 2*A*a^2/cos(d*x + c) - B*a^2/cos(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 125 vs. \(2 (55) = 110\).
Time = 0.18 (sec) , antiderivative size = 125, normalized size of antiderivative = 2.27 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx=-\frac {{\left (A a^{2} + 2 \, B a^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (2 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, A a^{2} + 3 \, B a^{2}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1}}{d} \] Input:
integrate(sec(d*x+c)^2*(a+a*sin(d*x+c))^2*(A+B*sin(d*x+c)),x, algorithm="g iac")
Output:
-((A*a^2 + 2*B*a^2)*(d*x + c) + 2*(2*A*a^2*tan(1/2*d*x + 1/2*c)^2 + 2*B*a^ 2*tan(1/2*d*x + 1/2*c)^2 - B*a^2*tan(1/2*d*x + 1/2*c) + 2*A*a^2 + 3*B*a^2) /(tan(1/2*d*x + 1/2*c)^3 - tan(1/2*d*x + 1/2*c)^2 + tan(1/2*d*x + 1/2*c) - 1))/d
Time = 34.53 (sec) , antiderivative size = 110, normalized size of antiderivative = 2.00 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx=-\frac {4\,A\,a^2+6\,B\,a^2+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (4\,A\,a^2+4\,B\,a^2\right )-2\,B\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )}-A\,a^2\,x-2\,B\,a^2\,x \] Input:
int(((A + B*sin(c + d*x))*(a + a*sin(c + d*x))^2)/cos(c + d*x)^2,x)
Output:
- (4*A*a^2 + 6*B*a^2 + tan(c/2 + (d*x)/2)^2*(4*A*a^2 + 4*B*a^2) - 2*B*a^2* tan(c/2 + (d*x)/2))/(d*(tan(c/2 + (d*x)/2) - tan(c/2 + (d*x)/2)^2 + tan(c/ 2 + (d*x)/2)^3 - 1)) - A*a^2*x - 2*B*a^2*x
Time = 0.18 (sec) , antiderivative size = 134, normalized size of antiderivative = 2.44 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx=\frac {a^{2} \left (\cos \left (d x +c \right ) \sin \left (d x +c \right ) b -\cos \left (d x +c \right ) a d x -4 \cos \left (d x +c \right ) a -2 \cos \left (d x +c \right ) b d x -4 \cos \left (d x +c \right ) b -\sin \left (d x +c \right )^{2} b -\sin \left (d x +c \right ) a d x -2 \sin \left (d x +c \right ) b d x +\sin \left (d x +c \right ) b +a d x +4 a +2 b d x +4 b \right )}{d \left (\cos \left (d x +c \right )+\sin \left (d x +c \right )-1\right )} \] Input:
int(sec(d*x+c)^2*(a+a*sin(d*x+c))^2*(A+B*sin(d*x+c)),x)
Output:
(a**2*(cos(c + d*x)*sin(c + d*x)*b - cos(c + d*x)*a*d*x - 4*cos(c + d*x)*a - 2*cos(c + d*x)*b*d*x - 4*cos(c + d*x)*b - sin(c + d*x)**2*b - sin(c + d *x)*a*d*x - 2*sin(c + d*x)*b*d*x + sin(c + d*x)*b + a*d*x + 4*a + 2*b*d*x + 4*b))/(d*(cos(c + d*x) + sin(c + d*x) - 1))