Integrand size = 30, antiderivative size = 191 \[ \int e^{a+i b x} (g \cos (d+b x)+f \sin (d+b x))^4 \, dx=\frac {i e^{a-i d-3 i (d+b x)} (f-i g)^4}{48 b}-\frac {i e^{a-i d+5 i (d+b x)} (f+i g)^4}{80 b}+\frac {e^{a-i d+3 i (d+b x)} (f+i g)^3 (i f+g)}{12 b}+\frac {e^{a-i d-i (d+b x)} (f+i g) (i f+g)^3}{4 b}-\frac {3 i e^{a-i d+i (d+b x)} \left (f^2+g^2\right )^2}{8 b} \] Output:
1/48*I*exp(a-I*d-3*I*(b*x+d))*(f-I*g)^4/b-1/80*I*exp(a-I*d+5*I*(b*x+d))*(f +I*g)^4/b+1/12*exp(a-I*d+3*I*(b*x+d))*(f+I*g)^3*(I*f+g)/b+1/4*exp(a-I*d-I* (b*x+d))*(f+I*g)*(I*f+g)^3/b-3/8*I*exp(a-I*d+I*(b*x+d))*(f^2+g^2)^2/b
Time = 2.23 (sec) , antiderivative size = 145, normalized size of antiderivative = 0.76 \[ \int e^{a+i b x} (g \cos (d+b x)+f \sin (d+b x))^4 \, dx=\frac {e^{a-3 i b x} \left (-3 i e^{4 i (d+2 b x)} (f+i g)^4+20 e^{2 i (d+3 b x)} (f+i g)^3 (i f+g)+60 e^{2 i (-d+b x)} (f+i g) (i f+g)^3+5 i e^{-4 i d} (i f+g)^4-90 i e^{4 i b x} \left (f^2+g^2\right )^2\right )}{240 b} \] Input:
Integrate[E^(a + I*b*x)*(g*Cos[d + b*x] + f*Sin[d + b*x])^4,x]
Output:
(E^(a - (3*I)*b*x)*((-3*I)*E^((4*I)*(d + 2*b*x))*(f + I*g)^4 + 20*E^((2*I) *(d + 3*b*x))*(f + I*g)^3*(I*f + g) + 60*E^((2*I)*(-d + b*x))*(f + I*g)*(I *f + g)^3 + ((5*I)*(I*f + g)^4)/E^((4*I)*d) - (90*I)*E^((4*I)*b*x)*(f^2 + g^2)^2))/(240*b)
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(647\) vs. \(2(191)=382\).
Time = 1.11 (sec) , antiderivative size = 647, normalized size of antiderivative = 3.39, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {7293, 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 e^{a+i b x} (f \sin (b x+d)+g \cos (b x+d))^4 \, dx\) |
\(\Big \downarrow \) 7293 |
\(\displaystyle \int \left (f^4 e^{a+i b x} \sin ^4(b x+d)+4 f^3 g e^{a+i b x} \sin ^3(b x+d) \cos (b x+d)+\frac {3}{2} f^2 g^2 e^{a+i b x} \sin ^2(2 b x+2 d)+4 f g^3 e^{a+i b x} \sin (b x+d) \cos ^3(b x+d)+g^4 e^{a+i b x} \cos ^4(b x+d)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {i f^4 e^{a+i b x} \sin ^4(b x+d)}{15 b}+\frac {4 i f^4 e^{a+i b x} \sin ^2(b x+d)}{15 b}-\frac {4 f^4 e^{a+i b x} \sin ^3(b x+d) \cos (b x+d)}{15 b}-\frac {8 f^4 e^{a+i b x} \sin (b x+d) \cos (b x+d)}{15 b}+\frac {i f^3 g e^{a+i b x} \sin (2 b x+2 d)}{3 b}-\frac {i f^3 g e^{a+i b x} \sin (4 b x+4 d)}{30 b}-\frac {2 f^3 g e^{a+i b x} \cos (2 b x+2 d)}{3 b}+\frac {2 f^3 g e^{a+i b x} \cos (4 b x+4 d)}{15 b}+\frac {i f^2 g^2 e^{a+i b x} \sin ^2(2 b x+2 d)}{10 b}-\frac {2 f^2 g^2 e^{a+i b x} \sin (2 b x+2 d) \cos (2 b x+2 d)}{5 b}+\frac {i f g^3 e^{a+i b x} \sin (2 b x+2 d)}{3 b}+\frac {i f g^3 e^{a+i b x} \sin (4 b x+4 d)}{30 b}-\frac {2 f g^3 e^{a+i b x} \cos (2 b x+2 d)}{3 b}-\frac {2 f g^3 e^{a+i b x} \cos (4 b x+4 d)}{15 b}+\frac {i g^4 e^{a+i b x} \cos ^4(b x+d)}{15 b}+\frac {4 i g^4 e^{a+i b x} \cos ^2(b x+d)}{15 b}+\frac {4 g^4 e^{a+i b x} \sin (b x+d) \cos ^3(b x+d)}{15 b}+\frac {8 g^4 e^{a+i b x} \sin (b x+d) \cos (b x+d)}{15 b}-\frac {8 i f^4 e^{a+i b x}}{15 b}-\frac {4 i f^2 g^2 e^{a+i b x}}{5 b}-\frac {8 i g^4 e^{a+i b x}}{15 b}\) |
Input:
Int[E^(a + I*b*x)*(g*Cos[d + b*x] + f*Sin[d + b*x])^4,x]
Output:
(((-8*I)/15)*E^(a + I*b*x)*f^4)/b - (((4*I)/5)*E^(a + I*b*x)*f^2*g^2)/b - (((8*I)/15)*E^(a + I*b*x)*g^4)/b + (((4*I)/15)*E^(a + I*b*x)*g^4*Cos[d + b *x]^2)/b + ((I/15)*E^(a + I*b*x)*g^4*Cos[d + b*x]^4)/b - (2*E^(a + I*b*x)* f^3*g*Cos[2*d + 2*b*x])/(3*b) - (2*E^(a + I*b*x)*f*g^3*Cos[2*d + 2*b*x])/( 3*b) + (2*E^(a + I*b*x)*f^3*g*Cos[4*d + 4*b*x])/(15*b) - (2*E^(a + I*b*x)* f*g^3*Cos[4*d + 4*b*x])/(15*b) - (8*E^(a + I*b*x)*f^4*Cos[d + b*x]*Sin[d + b*x])/(15*b) + (8*E^(a + I*b*x)*g^4*Cos[d + b*x]*Sin[d + b*x])/(15*b) + ( 4*E^(a + I*b*x)*g^4*Cos[d + b*x]^3*Sin[d + b*x])/(15*b) + (((4*I)/15)*E^(a + I*b*x)*f^4*Sin[d + b*x]^2)/b - (4*E^(a + I*b*x)*f^4*Cos[d + b*x]*Sin[d + b*x]^3)/(15*b) + ((I/15)*E^(a + I*b*x)*f^4*Sin[d + b*x]^4)/b + ((I/3)*E^ (a + I*b*x)*f^3*g*Sin[2*d + 2*b*x])/b + ((I/3)*E^(a + I*b*x)*f*g^3*Sin[2*d + 2*b*x])/b - (2*E^(a + I*b*x)*f^2*g^2*Cos[2*d + 2*b*x]*Sin[2*d + 2*b*x]) /(5*b) + ((I/10)*E^(a + I*b*x)*f^2*g^2*Sin[2*d + 2*b*x]^2)/b - ((I/30)*E^( a + I*b*x)*f^3*g*Sin[4*d + 4*b*x])/b + ((I/30)*E^(a + I*b*x)*f*g^3*Sin[4*d + 4*b*x])/b
Time = 6.25 (sec) , antiderivative size = 305, normalized size of antiderivative = 1.60
method | result | size |
parallelrisch | \(-\frac {32 \left (\frac {15 \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{7} g^{4}}{16}+\frac {15 g^{3} \left (i g -4 f \right ) \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{6}}{16}-\frac {5 \left (i f g -3 f^{2}-\frac {1}{8} g^{2}\right ) g^{2} \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{5}}{2}+\frac {15 \left (i f^{2} g +\frac {5}{12} i g^{3}-2 f^{3}+\frac {1}{3} f \,g^{2}\right ) g \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{4}}{4}+\left (-3 i f^{3} g -2 i f \,g^{3}+3 f^{4}+\frac {13}{16} g^{4}-3 f^{2} g^{2}\right ) \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{3}+\left (i f^{4}+\frac {21}{16} i g^{4}+\frac {3}{2} i f^{2} g^{2}+f^{3} g -\frac {9}{4} f \,g^{3}\right ) \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{2}+\left (f^{4}-\frac {9}{16} g^{4}-i f^{3} g -\frac {3}{2} i f \,g^{3}+\frac {3}{2} f^{2} g^{2}\right ) \tan \left (\frac {b x}{2}+\frac {d}{2}\right )+\frac {3 f \,g^{3}}{4}+\frac {f^{3} g}{2}+\frac {i f^{4}}{2}+\frac {3 i g^{4}}{16}+\frac {3 i f^{2} g^{2}}{4}\right ) {\mathrm e}^{i b x +a}}{15 b \left (1+\tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{2}\right )^{4}}\) | \(305\) |
norman | \(\frac {\frac {2 g^{4} {\mathrm e}^{i b x +a} \tan \left (\frac {b x}{2}+\frac {d}{2}\right )}{b}+\frac {2 \left (-i g^{4}+4 f \,g^{3}\right ) {\mathrm e}^{i b x +a} \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{2}}{b}+\frac {2 \left (-12 i f^{2} g^{2}-5 i g^{4}+24 f^{3} g -4 f \,g^{3}\right ) {\mathrm e}^{i b x +a} \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{4}}{3 b}+\frac {2 \left (-8 i f \,g^{3}+24 f^{2} g^{2}+g^{4}\right ) {\mathrm e}^{i b x +a} \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{3}}{3 b}-\frac {2 \left (16 i f^{4}+24 i f^{2} g^{2}+21 i g^{4}+16 f^{3} g -36 f \,g^{3}\right ) {\mathrm e}^{i b x +a} \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{6}}{15 b}+\frac {2 \left (-48 i f^{3} g -32 i f \,g^{3}+48 f^{4}-48 f^{2} g^{2}+13 g^{4}\right ) {\mathrm e}^{i b x +a} \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{5}}{15 b}+\frac {2 \left (-16 i f^{3} g -24 i f \,g^{3}+16 f^{4}+24 f^{2} g^{2}-9 g^{4}\right ) {\mathrm e}^{i b x +a} \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{7}}{15 b}-\frac {i \left (-16 i f^{3} g -24 i f \,g^{3}+16 f^{4}+24 f^{2} g^{2}+6 g^{4}\right ) {\mathrm e}^{i b x +a} \tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{8}}{15 b}}{\left (1+\tan \left (\frac {b x}{2}+\frac {d}{2}\right )^{2}\right )^{4}}\) | \(405\) |
parts | \(f^{4} \left (-\frac {3 i {\mathrm e}^{i b x +a}}{8 b}+\frac {i {\mathrm e}^{i b x +a} \cos \left (4 b x +4 d \right )}{120 b}+\frac {{\mathrm e}^{i b x +a} \sin \left (4 b x +4 d \right )}{30 b}-\frac {i {\mathrm e}^{i b x +a} \cos \left (2 b x +2 d \right )}{6 b}-\frac {\sin \left (2 b x +2 d \right ) {\mathrm e}^{i b x +a}}{3 b}\right )+g^{4} \left (-\frac {3 i {\mathrm e}^{i b x +a}}{8 b}+\frac {i {\mathrm e}^{i b x +a} \cos \left (4 b x +4 d \right )}{120 b}+\frac {{\mathrm e}^{i b x +a} \sin \left (4 b x +4 d \right )}{30 b}+\frac {i {\mathrm e}^{i b x +a} \cos \left (2 b x +2 d \right )}{6 b}+\frac {\sin \left (2 b x +2 d \right ) {\mathrm e}^{i b x +a}}{3 b}\right )+4 f \,g^{3} \left (-\frac {{\mathrm e}^{i b x +a} \cos \left (4 b x +4 d \right )}{30 b}+\frac {i {\mathrm e}^{i b x +a} \sin \left (4 b x +4 d \right )}{120 b}-\frac {{\mathrm e}^{i b x +a} \cos \left (2 b x +2 d \right )}{6 b}+\frac {i {\mathrm e}^{i b x +a} \sin \left (2 b x +2 d \right )}{12 b}\right )+6 f^{2} g^{2} \left (-\frac {i {\mathrm e}^{i b x +a}}{8 b}-\frac {i {\mathrm e}^{i b x +a} \cos \left (4 b x +4 d \right )}{120 b}-\frac {{\mathrm e}^{i b x +a} \sin \left (4 b x +4 d \right )}{30 b}\right )+4 f^{3} g \left (-\frac {{\mathrm e}^{i b x +a} \cos \left (2 b x +2 d \right )}{6 b}+\frac {i {\mathrm e}^{i b x +a} \sin \left (2 b x +2 d \right )}{12 b}+\frac {{\mathrm e}^{i b x +a} \cos \left (4 b x +4 d \right )}{30 b}-\frac {i {\mathrm e}^{i b x +a} \sin \left (4 b x +4 d \right )}{120 b}\right )\) | \(482\) |
default | \(-\frac {3 i f^{4} {\mathrm e}^{i b x +a}}{8 b}-\frac {3 i g^{4} {\mathrm e}^{i b x +a}}{8 b}-\frac {3 i f^{2} g^{2} {\mathrm e}^{i b x +a}}{2 b}+\frac {f^{4} \left (\frac {i {\mathrm e}^{i b x +a} \cos \left (4 b x +4 d \right )}{15 b}+\frac {4 \,{\mathrm e}^{i b x +a} \sin \left (4 b x +4 d \right )}{15 b}\right )}{8}-\frac {f^{4} \left (\frac {i {\mathrm e}^{i b x +a} \cos \left (2 b x +2 d \right )}{3 b}+\frac {2 \sin \left (2 b x +2 d \right ) {\mathrm e}^{i b x +a}}{3 b}\right )}{2}+\frac {g^{4} \left (\frac {i {\mathrm e}^{i b x +a} \cos \left (4 b x +4 d \right )}{15 b}+\frac {4 \,{\mathrm e}^{i b x +a} \sin \left (4 b x +4 d \right )}{15 b}\right )}{8}+\frac {g^{4} \left (\frac {i {\mathrm e}^{i b x +a} \cos \left (2 b x +2 d \right )}{3 b}+\frac {2 \sin \left (2 b x +2 d \right ) {\mathrm e}^{i b x +a}}{3 b}\right )}{2}+f^{3} g \left (-\frac {2 \,{\mathrm e}^{i b x +a} \cos \left (2 b x +2 d \right )}{3 b}+\frac {i {\mathrm e}^{i b x +a} \sin \left (2 b x +2 d \right )}{3 b}\right )-\frac {f^{3} g \left (-\frac {4 \,{\mathrm e}^{i b x +a} \cos \left (4 b x +4 d \right )}{15 b}+\frac {i {\mathrm e}^{i b x +a} \sin \left (4 b x +4 d \right )}{15 b}\right )}{2}+f \,g^{3} \left (-\frac {2 \,{\mathrm e}^{i b x +a} \cos \left (2 b x +2 d \right )}{3 b}+\frac {i {\mathrm e}^{i b x +a} \sin \left (2 b x +2 d \right )}{3 b}\right )+\frac {f \,g^{3} \left (-\frac {4 \,{\mathrm e}^{i b x +a} \cos \left (4 b x +4 d \right )}{15 b}+\frac {i {\mathrm e}^{i b x +a} \sin \left (4 b x +4 d \right )}{15 b}\right )}{2}-\frac {3 f^{2} g^{2} \left (-\frac {i {\mathrm e}^{i b x +a}}{2 b}+\frac {i {\mathrm e}^{i b x +a} \cos \left (4 b x +4 d \right )}{30 b}+\frac {2 \,{\mathrm e}^{i b x +a} \sin \left (4 b x +4 d \right )}{15 b}\right )}{2}\) | \(534\) |
orering | \(\text {Expression too large to display}\) | \(1363\) |
Input:
int(exp(a+I*b*x)*(g*cos(b*x+d)+f*sin(b*x+d))^4,x,method=_RETURNVERBOSE)
Output:
-32/15*(15/16*tan(1/2*b*x+1/2*d)^7*g^4+15/16*g^3*(I*g-4*f)*tan(1/2*b*x+1/2 *d)^6-5/2*(I*f*g-3*f^2-1/8*g^2)*g^2*tan(1/2*b*x+1/2*d)^5+15/4*(I*f^2*g+5/1 2*I*g^3-2*f^3+1/3*f*g^2)*g*tan(1/2*b*x+1/2*d)^4+(-3*I*f^3*g-2*I*f*g^3+3*f^ 4+13/16*g^4-3*f^2*g^2)*tan(1/2*b*x+1/2*d)^3+(I*f^4+21/16*I*g^4+3/2*I*f^2*g ^2+f^3*g-9/4*f*g^3)*tan(1/2*b*x+1/2*d)^2+(f^4-9/16*g^4-I*f^3*g-3/2*I*f*g^3 +3/2*f^2*g^2)*tan(1/2*b*x+1/2*d)+3/4*f*g^3+1/2*f^3*g+1/2*I*f^4+3/16*I*g^4+ 3/4*I*f^2*g^2)*exp(a+I*b*x)/b/(1+tan(1/2*b*x+1/2*d)^2)^4
Time = 0.07 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.04 \[ \int e^{a+i b x} (g \cos (d+b x)+f \sin (d+b x))^4 \, dx=-\frac {{\left (3 \, {\left (i \, f^{4} - 4 \, f^{3} g - 6 i \, f^{2} g^{2} + 4 \, f g^{3} + i \, g^{4}\right )} e^{\left (8 i \, b x + a + 7 i \, d\right )} + 20 \, {\left (-i \, f^{4} + 2 \, f^{3} g + 2 \, f g^{3} + i \, g^{4}\right )} e^{\left (6 i \, b x + a + 5 i \, d\right )} + 90 \, {\left (i \, f^{4} + 2 i \, f^{2} g^{2} + i \, g^{4}\right )} e^{\left (4 i \, b x + a + 3 i \, d\right )} + 60 \, {\left (i \, f^{4} + 2 \, f^{3} g + 2 \, f g^{3} - i \, g^{4}\right )} e^{\left (2 i \, b x + a + i \, d\right )} + 5 \, {\left (-i \, f^{4} - 4 \, f^{3} g + 6 i \, f^{2} g^{2} + 4 \, f g^{3} - i \, g^{4}\right )} e^{\left (a - i \, d\right )}\right )} e^{\left (-3 i \, b x - 3 i \, d\right )}}{240 \, b} \] Input:
integrate(exp(a+I*b*x)*(g*cos(b*x+d)+f*sin(b*x+d))^4,x, algorithm="fricas" )
Output:
-1/240*(3*(I*f^4 - 4*f^3*g - 6*I*f^2*g^2 + 4*f*g^3 + I*g^4)*e^(8*I*b*x + a + 7*I*d) + 20*(-I*f^4 + 2*f^3*g + 2*f*g^3 + I*g^4)*e^(6*I*b*x + a + 5*I*d ) + 90*(I*f^4 + 2*I*f^2*g^2 + I*g^4)*e^(4*I*b*x + a + 3*I*d) + 60*(I*f^4 + 2*f^3*g + 2*f*g^3 - I*g^4)*e^(2*I*b*x + a + I*d) + 5*(-I*f^4 - 4*f^3*g + 6*I*f^2*g^2 + 4*f*g^3 - I*g^4)*e^(a - I*d))*e^(-3*I*b*x - 3*I*d)/b
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 826 vs. \(2 (141) = 282\).
Time = 0.61 (sec) , antiderivative size = 826, normalized size of antiderivative = 4.32 \[ \int e^{a+i b x} (g \cos (d+b x)+f \sin (d+b x))^4 \, dx=\begin {cases} \frac {\left (\left (- 552960 i b^{4} f^{4} e^{a} e^{6 i d} - 1105920 i b^{4} f^{2} g^{2} e^{a} e^{6 i d} - 552960 i b^{4} g^{4} e^{a} e^{6 i d}\right ) e^{i b x} + \left (- 368640 i b^{4} f^{4} e^{a} e^{4 i d} - 737280 b^{4} f^{3} g e^{a} e^{4 i d} - 737280 b^{4} f g^{3} e^{a} e^{4 i d} + 368640 i b^{4} g^{4} e^{a} e^{4 i d}\right ) e^{- i b x} + \left (122880 i b^{4} f^{4} e^{a} e^{8 i d} - 245760 b^{4} f^{3} g e^{a} e^{8 i d} - 245760 b^{4} f g^{3} e^{a} e^{8 i d} - 122880 i b^{4} g^{4} e^{a} e^{8 i d}\right ) e^{3 i b x} + \left (30720 i b^{4} f^{4} e^{a} e^{2 i d} + 122880 b^{4} f^{3} g e^{a} e^{2 i d} - 184320 i b^{4} f^{2} g^{2} e^{a} e^{2 i d} - 122880 b^{4} f g^{3} e^{a} e^{2 i d} + 30720 i b^{4} g^{4} e^{a} e^{2 i d}\right ) e^{- 3 i b x} + \left (- 18432 i b^{4} f^{4} e^{a} e^{10 i d} + 73728 b^{4} f^{3} g e^{a} e^{10 i d} + 110592 i b^{4} f^{2} g^{2} e^{a} e^{10 i d} - 73728 b^{4} f g^{3} e^{a} e^{10 i d} - 18432 i b^{4} g^{4} e^{a} e^{10 i d}\right ) e^{5 i b x}\right ) e^{- 6 i d}}{1474560 b^{5}} & \text {for}\: b^{5} e^{6 i d} \neq 0 \\\frac {x \left (f^{4} e^{a} e^{8 i d} - 4 f^{4} e^{a} e^{6 i d} + 6 f^{4} e^{a} e^{4 i d} - 4 f^{4} e^{a} e^{2 i d} + f^{4} e^{a} + 4 i f^{3} g e^{a} e^{8 i d} - 8 i f^{3} g e^{a} e^{6 i d} + 8 i f^{3} g e^{a} e^{2 i d} - 4 i f^{3} g e^{a} - 6 f^{2} g^{2} e^{a} e^{8 i d} + 12 f^{2} g^{2} e^{a} e^{4 i d} - 6 f^{2} g^{2} e^{a} - 4 i f g^{3} e^{a} e^{8 i d} - 8 i f g^{3} e^{a} e^{6 i d} + 8 i f g^{3} e^{a} e^{2 i d} + 4 i f g^{3} e^{a} + g^{4} e^{a} e^{8 i d} + 4 g^{4} e^{a} e^{6 i d} + 6 g^{4} e^{a} e^{4 i d} + 4 g^{4} e^{a} e^{2 i d} + g^{4} e^{a}\right ) e^{- 4 i d}}{16} & \text {otherwise} \end {cases} \] Input:
integrate(exp(a+I*b*x)*(g*cos(b*x+d)+f*sin(b*x+d))**4,x)
Output:
Piecewise((((-552960*I*b**4*f**4*exp(a)*exp(6*I*d) - 1105920*I*b**4*f**2*g **2*exp(a)*exp(6*I*d) - 552960*I*b**4*g**4*exp(a)*exp(6*I*d))*exp(I*b*x) + (-368640*I*b**4*f**4*exp(a)*exp(4*I*d) - 737280*b**4*f**3*g*exp(a)*exp(4* I*d) - 737280*b**4*f*g**3*exp(a)*exp(4*I*d) + 368640*I*b**4*g**4*exp(a)*ex p(4*I*d))*exp(-I*b*x) + (122880*I*b**4*f**4*exp(a)*exp(8*I*d) - 245760*b** 4*f**3*g*exp(a)*exp(8*I*d) - 245760*b**4*f*g**3*exp(a)*exp(8*I*d) - 122880 *I*b**4*g**4*exp(a)*exp(8*I*d))*exp(3*I*b*x) + (30720*I*b**4*f**4*exp(a)*e xp(2*I*d) + 122880*b**4*f**3*g*exp(a)*exp(2*I*d) - 184320*I*b**4*f**2*g**2 *exp(a)*exp(2*I*d) - 122880*b**4*f*g**3*exp(a)*exp(2*I*d) + 30720*I*b**4*g **4*exp(a)*exp(2*I*d))*exp(-3*I*b*x) + (-18432*I*b**4*f**4*exp(a)*exp(10*I *d) + 73728*b**4*f**3*g*exp(a)*exp(10*I*d) + 110592*I*b**4*f**2*g**2*exp(a )*exp(10*I*d) - 73728*b**4*f*g**3*exp(a)*exp(10*I*d) - 18432*I*b**4*g**4*e xp(a)*exp(10*I*d))*exp(5*I*b*x))*exp(-6*I*d)/(1474560*b**5), Ne(b**5*exp(6 *I*d), 0)), (x*(f**4*exp(a)*exp(8*I*d) - 4*f**4*exp(a)*exp(6*I*d) + 6*f**4 *exp(a)*exp(4*I*d) - 4*f**4*exp(a)*exp(2*I*d) + f**4*exp(a) + 4*I*f**3*g*e xp(a)*exp(8*I*d) - 8*I*f**3*g*exp(a)*exp(6*I*d) + 8*I*f**3*g*exp(a)*exp(2* I*d) - 4*I*f**3*g*exp(a) - 6*f**2*g**2*exp(a)*exp(8*I*d) + 12*f**2*g**2*ex p(a)*exp(4*I*d) - 6*f**2*g**2*exp(a) - 4*I*f*g**3*exp(a)*exp(8*I*d) - 8*I* f*g**3*exp(a)*exp(6*I*d) + 8*I*f*g**3*exp(a)*exp(2*I*d) + 4*I*f*g**3*exp(a ) + g**4*exp(a)*exp(8*I*d) + 4*g**4*exp(a)*exp(6*I*d) + 6*g**4*exp(a)*e...
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 559 vs. \(2 (120) = 240\).
Time = 0.07 (sec) , antiderivative size = 559, normalized size of antiderivative = 2.93 \[ \int e^{a+i b x} (g \cos (d+b x)+f \sin (d+b x))^4 \, dx =\text {Too large to display} \] Input:
integrate(exp(a+I*b*x)*(g*cos(b*x+d)+f*sin(b*x+d))^4,x, algorithm="maxima" )
Output:
1/240*(-3*I*cos(5*b*x + 4*d)*e^a + 5*I*cos(3*b*x + 4*d)*e^a + 20*I*cos(3*b *x + 2*d)*e^a - 60*I*cos(b*x + 2*d)*e^a - 90*I*cos(b*x)*e^a + 3*e^a*sin(5* b*x + 4*d) + 5*e^a*sin(3*b*x + 4*d) - 20*e^a*sin(3*b*x + 2*d) - 60*e^a*sin (b*x + 2*d) + 90*e^a*sin(b*x))*f^4/b + 1/60*(3*cos(5*b*x + 4*d)*e^a + 5*co s(3*b*x + 4*d)*e^a - 10*cos(3*b*x + 2*d)*e^a - 30*cos(b*x + 2*d)*e^a + 3*I *e^a*sin(5*b*x + 4*d) - 5*I*e^a*sin(3*b*x + 4*d) - 10*I*e^a*sin(3*b*x + 2* d) + 30*I*e^a*sin(b*x + 2*d))*f^3*g/b - 1/40*(-3*I*cos(5*b*x + 4*d)*e^a + 5*I*cos(3*b*x + 4*d)*e^a + 30*I*cos(b*x)*e^a + 3*e^a*sin(5*b*x + 4*d) + 5* e^a*sin(3*b*x + 4*d) - 30*e^a*sin(b*x))*f^2*g^2/b - 1/60*(3*cos(5*b*x + 4* d)*e^a + 5*cos(3*b*x + 4*d)*e^a + 10*cos(3*b*x + 2*d)*e^a + 30*cos(b*x + 2 *d)*e^a + 3*I*e^a*sin(5*b*x + 4*d) - 5*I*e^a*sin(3*b*x + 4*d) + 10*I*e^a*s in(3*b*x + 2*d) - 30*I*e^a*sin(b*x + 2*d))*f*g^3/b + 1/240*(-3*I*cos(5*b*x + 4*d)*e^a + 5*I*cos(3*b*x + 4*d)*e^a - 20*I*cos(3*b*x + 2*d)*e^a + 60*I* cos(b*x + 2*d)*e^a - 90*I*cos(b*x)*e^a + 3*e^a*sin(5*b*x + 4*d) + 5*e^a*si n(3*b*x + 4*d) + 20*e^a*sin(3*b*x + 2*d) + 60*e^a*sin(b*x + 2*d) + 90*e^a* sin(b*x))*g^4/b
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 684 vs. \(2 (120) = 240\).
Time = 0.45 (sec) , antiderivative size = 684, normalized size of antiderivative = 3.58 \[ \int e^{a+i b x} (g \cos (d+b x)+f \sin (d+b x))^4 \, dx =\text {Too large to display} \] Input:
integrate(exp(a+I*b*x)*(g*cos(b*x+d)+f*sin(b*x+d))^4,x, algorithm="giac")
Output:
1/480*(180*(f^4 + 2*f^2*g^2 + g^4)*e^a*sin(b*x) - 3*I*((f^4 + 4*I*f^3*g - 6*f^2*g^2 - 4*I*f*g^3 + g^4)*e^(5*I*b*x + 4*I*d) + (f^4 + 4*I*f^3*g - 6*f^ 2*g^2 - 4*I*f*g^3 + g^4)*e^(-5*I*b*x - 4*I*d))*e^a - 3*((I*f^4 - 4*f^3*g - 6*I*f^2*g^2 + 4*f*g^3 + I*g^4)*e^(5*I*b*x + 4*I*d) + (-I*f^4 + 4*f^3*g + 6*I*f^2*g^2 - 4*f*g^3 - I*g^4)*e^(-5*I*b*x - 4*I*d))*e^a + 5*I*((f^4 - 4*I *f^3*g - 6*f^2*g^2 + 4*I*f*g^3 + g^4)*e^(3*I*b*x + 4*I*d) + (f^4 - 4*I*f^3 *g - 6*f^2*g^2 + 4*I*f*g^3 + g^4)*e^(-3*I*b*x - 4*I*d))*e^a - 5*((I*f^4 + 4*f^3*g - 6*I*f^2*g^2 - 4*f*g^3 + I*g^4)*e^(3*I*b*x + 4*I*d) + (-I*f^4 - 4 *f^3*g + 6*I*f^2*g^2 + 4*f*g^3 - I*g^4)*e^(-3*I*b*x - 4*I*d))*e^a + 20*I*( (f^4 + 2*I*f^3*g + 2*I*f*g^3 - g^4)*e^(3*I*b*x + 2*I*d) + (f^4 + 2*I*f^3*g + 2*I*f*g^3 - g^4)*e^(-3*I*b*x - 2*I*d))*e^a - 20*((-I*f^4 + 2*f^3*g + 2* f*g^3 + I*g^4)*e^(3*I*b*x + 2*I*d) + (I*f^4 - 2*f^3*g - 2*f*g^3 - I*g^4)*e ^(-3*I*b*x - 2*I*d))*e^a - 60*I*((f^4 - 2*I*f^3*g - 2*I*f*g^3 - g^4)*e^(I* b*x + 2*I*d) + (f^4 - 2*I*f^3*g - 2*I*f*g^3 - g^4)*e^(-I*b*x - 2*I*d))*e^a - 60*((-I*f^4 - 2*f^3*g - 2*f*g^3 + I*g^4)*e^(I*b*x + 2*I*d) + (I*f^4 + 2 *f^3*g + 2*f*g^3 - I*g^4)*e^(-I*b*x - 2*I*d))*e^a - 90*I*((f^4 + 2*f^2*g^2 + g^4)*e^(I*b*x) + (f^4 + 2*f^2*g^2 + g^4)*e^(-I*b*x))*e^a)/b
Time = 16.46 (sec) , antiderivative size = 144, normalized size of antiderivative = 0.75 \[ \int e^{a+i b x} (g \cos (d+b x)+f \sin (d+b x))^4 \, dx=\frac {{\mathrm {e}}^{a-d\,4{}\mathrm {i}-b\,x\,3{}\mathrm {i}}\,{\left (g+f\,1{}\mathrm {i}\right )}^4\,1{}\mathrm {i}}{48\,b}-\frac {{\mathrm {e}}^{a+d\,4{}\mathrm {i}+b\,x\,5{}\mathrm {i}}\,{\left (-g+f\,1{}\mathrm {i}\right )}^4\,1{}\mathrm {i}}{80\,b}-\frac {{\mathrm {e}}^{a+b\,x\,1{}\mathrm {i}}\,{\left (f^2+g^2\right )}^2\,3{}\mathrm {i}}{8\,b}+\frac {{\mathrm {e}}^{a+d\,2{}\mathrm {i}+b\,x\,3{}\mathrm {i}}\,\left (g+f\,1{}\mathrm {i}\right )\,{\left (-g+f\,1{}\mathrm {i}\right )}^3\,1{}\mathrm {i}}{12\,b}-\frac {{\mathrm {e}}^{a-d\,2{}\mathrm {i}-b\,x\,1{}\mathrm {i}}\,{\left (f-g\,1{}\mathrm {i}\right )}^3\,\left (f+g\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4\,b} \] Input:
int(exp(a + b*x*1i)*(g*cos(d + b*x) + f*sin(d + b*x))^4,x)
Output:
(exp(a - d*4i - b*x*3i)*(f*1i + g)^4*1i)/(48*b) - (exp(a + d*4i + b*x*5i)* (f*1i - g)^4*1i)/(80*b) - (exp(a + b*x*1i)*(f^2 + g^2)^2*3i)/(8*b) + (exp( a + d*2i + b*x*3i)*(f*1i + g)*(f*1i - g)^3*1i)/(12*b) - (exp(a - d*2i - b* x*1i)*(f - g*1i)^3*(f + g*1i)*1i)/(4*b)
Time = 0.16 (sec) , antiderivative size = 477, normalized size of antiderivative = 2.50 \[ \int e^{a+i b x} (g \cos (d+b x)+f \sin (d+b x))^4 \, dx=\frac {e^{b i x +a} \left (8 \cos \left (b x +d \right )^{3} \sin \left (b x +d \right ) f^{3} g i +12 \cos \left (b x +d \right )^{3} \sin \left (b x +d \right ) f \,g^{3} i -18 \cos \left (b x +d \right )^{2} \sin \left (b x +d \right )^{2} f^{2} g^{2} i +12 \cos \left (b x +d \right ) \sin \left (b x +d \right )^{3} f^{3} g i +8 \cos \left (b x +d \right ) \sin \left (b x +d \right )^{3} f \,g^{3} i -3 \sin \left (b x +d \right )^{4} f^{4} i -8 \cos \left (b x +d \right )^{4} f^{3} g -8 \cos \left (b x +d \right )^{3} \sin \left (b x +d \right ) f^{4}+12 \sin \left (b x +d \right )^{4} f^{3} g +12 \cos \left (b x +d \right )^{3} \sin \left (b x +d \right ) g^{4}+8 \cos \left (b x +d \right ) \sin \left (b x +d \right )^{3} g^{4}-8 \cos \left (b x +d \right )^{4} f^{4} i -12 \cos \left (b x +d \right ) \sin \left (b x +d \right )^{3} f^{4}-3 \cos \left (b x +d \right )^{4} g^{4} i -8 \sin \left (b x +d \right )^{4} g^{4} i -12 \cos \left (b x +d \right )^{4} f \,g^{3}+8 \sin \left (b x +d \right )^{4} f \,g^{3}-12 \cos \left (b x +d \right )^{4} f^{2} g^{2} i -12 \cos \left (b x +d \right )^{3} \sin \left (b x +d \right ) f^{2} g^{2}-12 \cos \left (b x +d \right )^{2} \sin \left (b x +d \right )^{2} f^{4} i -12 \cos \left (b x +d \right )^{2} \sin \left (b x +d \right )^{2} f^{3} g +12 \cos \left (b x +d \right )^{2} \sin \left (b x +d \right )^{2} f \,g^{3}-12 \cos \left (b x +d \right )^{2} \sin \left (b x +d \right )^{2} g^{4} i +12 \cos \left (b x +d \right ) \sin \left (b x +d \right )^{3} f^{2} g^{2}-12 \sin \left (b x +d \right )^{4} f^{2} g^{2} i \right )}{15 b} \] Input:
int(exp(a+I*b*x)*(g*cos(b*x+d)+f*sin(b*x+d))^4,x)
Output:
(e**(a + b*i*x)*( - 8*cos(b*x + d)**4*f**4*i - 8*cos(b*x + d)**4*f**3*g - 12*cos(b*x + d)**4*f**2*g**2*i - 12*cos(b*x + d)**4*f*g**3 - 3*cos(b*x + d )**4*g**4*i - 8*cos(b*x + d)**3*sin(b*x + d)*f**4 + 8*cos(b*x + d)**3*sin( b*x + d)*f**3*g*i - 12*cos(b*x + d)**3*sin(b*x + d)*f**2*g**2 + 12*cos(b*x + d)**3*sin(b*x + d)*f*g**3*i + 12*cos(b*x + d)**3*sin(b*x + d)*g**4 - 12 *cos(b*x + d)**2*sin(b*x + d)**2*f**4*i - 12*cos(b*x + d)**2*sin(b*x + d)* *2*f**3*g - 18*cos(b*x + d)**2*sin(b*x + d)**2*f**2*g**2*i + 12*cos(b*x + d)**2*sin(b*x + d)**2*f*g**3 - 12*cos(b*x + d)**2*sin(b*x + d)**2*g**4*i - 12*cos(b*x + d)*sin(b*x + d)**3*f**4 + 12*cos(b*x + d)*sin(b*x + d)**3*f* *3*g*i + 12*cos(b*x + d)*sin(b*x + d)**3*f**2*g**2 + 8*cos(b*x + d)*sin(b* x + d)**3*f*g**3*i + 8*cos(b*x + d)*sin(b*x + d)**3*g**4 - 3*sin(b*x + d)* *4*f**4*i + 12*sin(b*x + d)**4*f**3*g - 12*sin(b*x + d)**4*f**2*g**2*i + 8 *sin(b*x + d)**4*f*g**3 - 8*sin(b*x + d)**4*g**4*i))/(15*b)