Optimal. Leaf size=59 \[ \frac {B (a \sin (e+f x)+a)^{m+2}}{a^2 f (m+2)}+\frac {(A-B) (a \sin (e+f x)+a)^{m+1}}{a f (m+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {2833, 43} \[ \frac {B (a \sin (e+f x)+a)^{m+2}}{a^2 f (m+2)}+\frac {(A-B) (a \sin (e+f x)+a)^{m+1}}{a f (m+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 43
Rule 2833
Rubi steps
\begin {align*} \int \cos (e+f x) (a+a \sin (e+f x))^m (A+B \sin (e+f x)) \, dx &=\frac {\operatorname {Subst}\left (\int (a+x)^m \left (A+\frac {B x}{a}\right ) \, dx,x,a \sin (e+f x)\right )}{a f}\\ &=\frac {\operatorname {Subst}\left (\int \left ((A-B) (a+x)^m+\frac {B (a+x)^{1+m}}{a}\right ) \, dx,x,a \sin (e+f x)\right )}{a f}\\ &=\frac {(A-B) (a+a \sin (e+f x))^{1+m}}{a f (1+m)}+\frac {B (a+a \sin (e+f x))^{2+m}}{a^2 f (2+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.13, size = 51, normalized size = 0.86 \[ \frac {(a (\sin (e+f x)+1))^{m+1} (A (m+2)+B (m+1) \sin (e+f x)-B)}{a f (m+1) (m+2)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.70, size = 70, normalized size = 1.19 \[ -\frac {{\left ({\left (B m + B\right )} \cos \left (f x + e\right )^{2} - {\left (A + B\right )} m - {\left ({\left (A + B\right )} m + 2 \, A\right )} \sin \left (f x + e\right ) - 2 \, A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{m}}{f m^{2} + 3 \, f m + 2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.16, size = 156, normalized size = 2.64 \[ \frac {\frac {{\left (a \sin \left (f x + e\right ) + a\right )}^{m + 1} A}{m + 1} + \frac {{\left ({\left (a \sin \left (f x + e\right ) + a\right )}^{2} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} m - {\left (a \sin \left (f x + e\right ) + a\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} a m + {\left (a \sin \left (f x + e\right ) + a\right )}^{2} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} - 2 \, {\left (a \sin \left (f x + e\right ) + a\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} a\right )} B}{{\left (m^{2} + 3 \, m + 2\right )} a}}{a f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 4.70, size = 0, normalized size = 0.00 \[ \int \cos \left (f x +e \right ) \left (a +a \sin \left (f x +e \right )\right )^{m} \left (A +B \sin \left (f x +e \right )\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.40, size = 83, normalized size = 1.41 \[ \frac {\frac {{\left (a^{m} {\left (m + 1\right )} \sin \left (f x + e\right )^{2} + a^{m} m \sin \left (f x + e\right ) - a^{m}\right )} B {\left (\sin \left (f x + e\right ) + 1\right )}^{m}}{m^{2} + 3 \, m + 2} + \frac {{\left (a \sin \left (f x + e\right ) + a\right )}^{m + 1} A}{a {\left (m + 1\right )}}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 10.17, size = 99, normalized size = 1.68 \[ \frac {{\left (a\,\left (\sin \left (e+f\,x\right )+1\right )\right )}^m\,\left (4\,A-B+2\,A\,m+B\,m+4\,A\,\sin \left (e+f\,x\right )+B\,\left (2\,{\sin \left (e+f\,x\right )}^2-1\right )+2\,A\,m\,\sin \left (e+f\,x\right )+2\,B\,m\,\sin \left (e+f\,x\right )+B\,m\,\left (2\,{\sin \left (e+f\,x\right )}^2-1\right )\right )}{2\,f\,\left (m^2+3\,m+2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 5.82, size = 428, normalized size = 7.25 \[ \begin {cases} x \left (A + B \sin {\relax (e )}\right ) \left (a \sin {\relax (e )} + a\right )^{m} \cos {\relax (e )} & \text {for}\: f = 0 \\- \frac {A}{a^{2} f \sin {\left (e + f x \right )} + a^{2} f} + \frac {B \log {\left (\sin {\left (e + f x \right )} + 1 \right )} \sin {\left (e + f x \right )}}{a^{2} f \sin {\left (e + f x \right )} + a^{2} f} + \frac {B \log {\left (\sin {\left (e + f x \right )} + 1 \right )}}{a^{2} f \sin {\left (e + f x \right )} + a^{2} f} + \frac {B}{a^{2} f \sin {\left (e + f x \right )} + a^{2} f} & \text {for}\: m = -2 \\\frac {A \log {\left (\sin {\left (e + f x \right )} + 1 \right )}}{a f} - \frac {B \log {\left (\sin {\left (e + f x \right )} + 1 \right )}}{a f} + \frac {B \sin {\left (e + f x \right )}}{a f} & \text {for}\: m = -1 \\\frac {A m \left (a \sin {\left (e + f x \right )} + a\right )^{m} \sin {\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac {A m \left (a \sin {\left (e + f x \right )} + a\right )^{m}}{f m^{2} + 3 f m + 2 f} + \frac {2 A \left (a \sin {\left (e + f x \right )} + a\right )^{m} \sin {\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac {2 A \left (a \sin {\left (e + f x \right )} + a\right )^{m}}{f m^{2} + 3 f m + 2 f} + \frac {B m \left (a \sin {\left (e + f x \right )} + a\right )^{m} \sin ^{2}{\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac {B m \left (a \sin {\left (e + f x \right )} + a\right )^{m} \sin {\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac {B \left (a \sin {\left (e + f x \right )} + a\right )^{m} \sin ^{2}{\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} - \frac {B \left (a \sin {\left (e + f x \right )} + a\right )^{m}}{f m^{2} + 3 f m + 2 f} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________