integration of x^n*cos(a+b*x)



Am Mittwoch, den 07.07.2010, 17:03 -0500 schrieb Barton Willis:
> Maybe this works:
> 
> (%i28) load(abs_integrate)$
> 
> (%i29) exponentialize_int(e,x) := (e : integrate(ratexpand(exponentialize (e)), x), if freeof('integrate,e) then e else false)$
> 
> (%i30) push('exponentialize_int, extra_integration_methods)$
> 
> (%i33) integrate(x^n * cos(a+b*x),x);
> (%o33) -(%e^(-%i*a)*gamma_incomplete(n+1,%i*b*x)*x^(n+1)*(%i*b*x)^(-n-1))/2-(%e^(%i*a)*gamma_incomplete(n+1,-%i*b*x)*x^(n+1)*(-%i*b*x)^(-n-1))/2


This works too:

(%i2) integrate(x^n*cos(a+b*x),x),exponentialize;
(%o2) (-%e^-(%i*a)*gamma_incomplete(n+1,%i*b*x)*x^(n+1)*(%i*b*x)^(-n-1)
       -%e^(%i*a)*gamma_incomplete(n+1,-%i*b*x)*x^(n+1)
       *(-%i*b*x)^(-n-1))/2

We get e.g. the special case for n=1:

(%i3) subst(1,n,%),gamma_expand:true;
(%o3) (%e^(%i*a)*(%e^(%i*b*x)-%i*b*x*%e^(%i*b*x))/b^2
        +%e^-(%i*a)*(%i*b*x*%e^-(%i*b*x)+%e^-(%i*b*x))/b^2)
        /2

(%i4) trigreduce(demoivre(%));
(%o4) (b*x*sin(b*x+a)+cos(b*x+a))/b^2

Perhaps, we can build in some more of this knowledge into the code of
the integrator.

Dieter Kaiser