integrate adds "ind" to correct answer



Edwin Woollett wrote:
> On Sept. 05, 2008, Raymond Toy wrote:
>
>>> but direct use of integrate adds "ind" to the
>>> correct answer.
>>>
>>> (%i7) integrate(x*exp(-a*x)*cos( w*x), x, 0, inf);
>>> (%o7) ind  -  (w^2 - a^2)/(w^4 + 2*a^2*w^2 + a^4)
>>>
>>> Is this a bug?
>>>
>>> Yes this is a bug.
>>
>> Ray
>>
>
> Since maxima can find the indefinite integral, this
> must be a limit(...)  bug:
>
> (%i2) assume( a > 0, w > 0 )$
> (%i3) indef : integrate( x*exp( - a*x)*cos(w*x), x);
> (%o3) %e^-(a*x)*(((w^3+a^2*w)*x+2*a*w)*sin(w*x)
>                +((-a*w^2-a^3)*x+w^2-a^2)*cos(w*x))
>       /(w^4+2*a^2*w^2+a^4)
> (%i4) nindef : num( indef);
> (%o4) %e^-(a*x)*(((w^3+a^2*w)*x+2*a*w)*sin(w*x)
>                +((-a*w^2-a^3)*x+w^2-a^2)*cos(w*x))
> (%i5) coeff( nindef, exp( - a*x) );
> (%o5) ((w^3+a^2*w)*x+2*a*w)*sin(w*x)+((-a*w^2-a^3)*x+w^2-a^2)*cos(w*x)
> (%i6) limit(nindef, x, 0, plus);
> (%o6) w^2-a^2
> (%i7) limit(nindef, x, inf );
> (%o7) ind
>
> l
I looked at how maxima tries to evaluate this integral.  In this
particular case, it does compute the antiderivative and uses limit to
find the limits.  So this is, a bug in limit.

Note that this integral is a Laplace transform integral, and specint
produces the desired result.

Ray