Subject: Are these both the right answer for the integral?
From: reyssat
Date: Thu, 06 Jan 2011 01:59:18 +0100
Le 06/01/2011 01:19, Richard Hennessy a ?crit :
> On second thought this is not okay. You cannot add signum(x) *%i,
> because that is not a constant.
Due to the term 1-1/x^2, the function is not defined at 0 hence
signum(x)*%i _is_ a constant on each interval where your function is
defined. You can choose different integration constants on disjoint
intervals.
> I think it is a bug which I don't know offhand how to fix. I would not
> call it a feature. The function is not real from (-1,1). That is not
> a supported type of function. When I wrote pw I was thinking about
> real functions not complex ones. I will have to figure it out. I
> don't see how you can call it a feature.
The complex function explains the behaviour of the real one, but we may
of course restrict to the real values only.
I didn't look precisely at the documentation about your integration
procedure of piecewise defined functions, so I cannot assert that it is
a bug (i.e. contradictory to what you write it should return) or not.
But in this case, the returned result (even with the singnum(x)*%i) is a
function which has the correct derivative at each point of the real line
where the given function f is defined without branch point (points where
you can choose more than one analytic continuation, the points 1 and -1
here). I call it a feature because it gives a reasonable value of what
we can call an integral of f. It would be a bug if you say in the
documentation that the result is either an error message or an
everywhere (on the real line) differentiable function whose derivative
is f, since it is clearly not the case here.
Eric
> I just don't understand the problem yet.
>
> Rich
>
>
>
> -----Original Message----- From: Richard Hennessy
> Sent: Wednesday, January 05, 2011 5:48 PM
> To: reyssat
> Cc: Maxima List
> Subject: Re: [Maxima] Are these both the right answer for the integral?
>
> Thanks, your right, it is always okay to add a constant to the answer for
> integrate. I don't understand integration with respect to complex
> numbers
> very well. The article mentions that users who are only familiar with
> real
> integration would have a problem with understanding the answer to
> integration of some piecewise functions. I am not sure if my
> algorithm is
> right, I designed it for real numbers but sometimes complex numbers
> appear
> out of nowhere.
>
> Rich
>
>
> -----Original Message----- From: reyssat
> Sent: Wednesday, January 05, 2011 5:06 PM
> To: Richard Hennessy
> Cc: Maxima List
> Subject: Re: [Maxima] Are these both the right answer for the integral?
>
> Richard Hennessy a ?crit :
>> Hi List,
>> I found an article which gives an integral problem of interest.
>> integrate(3*x^2*sqrt(1-1/x^2),x);
>> Maxima alone said it works out to (1-1/x^2)^(3/2)*x^3, with
>> abs_integrate loaded the answer is the same (1-1/x^2)^(3/2)*x^3, but
>> with pw.mac loaded Maxima gives 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x)
>> They all agree that diff(integrate(3*x^2*sqrt(1-1/x^2),x),x) gives
>> the original form back, but not directly. You have to simplify to
>> get everything to cancel out to 0. I don?t know why pw.mac returns
>> an answer with %i in it. Is that a bug?
>> Rich
>>
> Hi Rich,
> The function is a multivalued function defined on the complex plane
> except at 0 , 1 and -1.
> So on the real line, depending on how the integral is computed, the
> answer is defined only up to an additive constant on each of the
> intervals ]-inf,-1[ , ]-1,0[ , ]0,1[ , ]1,inf[. The answer with pw.mac
> just adds %i, this is ok, it could even be worse : adding %i +
> 5*%i*signum(1-x) - (3+2*%i)*signum(1+x) is also a correct result.
> So I don't know either why pw.mac adds %i, but I would consider it as a
> feature, not a bug.
>
> Eric
>> (%i25) kill(all);
>> (out0) done
>> (%i1) 3*x^2*sqrt(1-1/x^2);
>> (out1) 3*sqrt(1-1/x^2)*x^2
>> (%i2) integrate(%,x);
>> (out2) (1-1/x^2)^(3/2)*x^3
>> (%i3) diff(%,x);
>> (out3) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2)
>> (%i4) radcan(%-(out1));
>> (out4) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x))
>> (%i5) radcan(%);
>> (out5) 0
>> (%i6) kill(all);
>> (out0) done
>> (%i1) load(pw);
>> (out1) "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/pw.mac"
>> (%i2) 3*x^2*sqrt(1-1/x^2);
>> (out2) 3*sqrt(1-1/x^2)*x^2
>> (%i3) pwint(%,x);
>> (out3) 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x)
>> (%i4) diff(%,x);
>> (out4) 3*x*sqrt((x-1)*(x+1))*signum(x)
>> (%i5) radcan(%-(out2));
>> (out5) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x)
>> (%i6) radcan(%);
>> (out6) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x)
>> (%i7) signum2abs(%);
>> (out7) 0
>> (%i8) kill(all);
>> (out0) done
>> (%i1) load(abs_integrate);
>> (out1)
>> "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/integration/abs_integrate.mac"
>>
>> (%i2) 3*x^2*sqrt(1-1/x^2);
>> (out2) 3*sqrt(1-1/x^2)*x^2
>> (%i3) integrate(%,x);
>> (out3) (1-1/x^2)^(3/2)*x^3
>> (%i4) diff(%,x);
>> (out4) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2)
>> (%i5) radcan(%-(out2));
>> (out5) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x))
>> (%i6) radcan(%);
>> (out6) 0
>> ------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>