posible bug - clashing variable names in integrals



2009/10/3 Barton Willis <willisb at unk.edu>

> is(equal(..,, ...)) knows something about dummy variables for lambda
> forms and sums, but not integrals:
>
>  (%i5) is(equal(integrate(f(x),x,a,b), integrate(f(y),y,a,b)));
>  (%o5) unknown
>
>  (%i6) is(equal(sum(f(x),x,0,n), sum(f(y),y,0,n)));
>  (%o6) true
>
>  (%i7) is(equal(lambda([x], f(x)), lambda([y], f(y))));
>  (%o7) true
>
> If integrate(f(x),x,a,b) is undefined, you could argue that (%o5) is
> correct and (%o6) and (%o7) are spurious--after all,
> is(equal(und,und)) --> false (and correctly so, I think). but I guess
> that most users prefer (%o6) and (%o7) over (%o5).
>

Thanks for those examples.

I actually think that %o6 and %o7 are correct.  is(equal(und,und)) yields
false, but I think it's more relevant to compare the expressions to
is(equal(foo, foo)) where foo is undefined -- that gives true.  It's pretty
important that it does, since otherwise you wouldn't be able to ask
is(equal((x+1)*(x-1), x^2-1)) without first defining x.  The point is that
sum(f(x),x,0,n) is in fact equal to sum(f(y),y,0,n), no matter how f(x) is
defined - and it should really be the same with integral(f(x),x,a,b) and
integral(f(y),a,b).

Nathaniel




> Barton
>
> -----maxima-bounces at math.utexas.edu wrote: -----
>
> >To: Leo Butler <l.butler at ed.ac.uk>
> >From: Nathaniel Virgo <nathanielvirgo at gmail.com>
> >Sent by: maxima-bounces at math.utexas.edu
> >Date: 10/03/2009 08:17AM
> >cc: maxima <maxima at math.utexas.edu>
> >Subject: Re: [Maxima] posible bug - clashing variable names in integrals
> >
> >Ok, sorry, yes, I think I understand this now.  So it's not a bug per se
> >that 'is' returns 'false' in that situation.
> >
> >It is, however, still annoying that it doesn't treat integrate(f(x),x,a,b)
> >in exactly the same way as integrate(f(y),y,a,b).  It should do because x
> >and y are bound variables in those expressions, so their name should not
> >make any difference in any situation.  This difference in the way it
> >treats these two expressions is likely to be a problem for a lot of the
> >things I wanted to use Maxima for.
> >
> >
> >
> >Nathaniel
> >
> >
> >2009/10/3 Leo Butler <l.butler at ed.ac.uk>
> >
> >
> >
> >
> >
> >
> >On Sat, 3 Oct 2009, Nathaniel Virgo wrote:
> >
> >
> >
> >< On a similar note, am I right to say the following should not return
> >false?
> >
> ><
> >
> >< (%i20) A: 'integrate(f(x),x,a,b);
> >
> >< (%o20) integrate(f(x),x,a,b)
> >
> >< (%i21) B: 'integrate(f(y),y,a,b);
> >
> >< (%o21) integrate(f(y),y,a,b)
> >
> >< (%i22) is(A=B);
> >
> >< (%o22) false
> >
> ><
> >
> >< the two expressions are equivalent, the only difference being the name
> >of a
> >
> >< bound variable.  So it should return "true" or "maybe" but not false. It
> >
> >< works with ordinary (non-integral) functions:
> >
> ><
> >
> >< (%i24) f(x):=x^2;
> >
> >< (%o24) f(x):=x^2
> >
> >< (%i25) g(y):=y^2;
> >
> >< (%o25) g(y):=y^2
> >
> >< (%i26) is(f(z)=g(z));
> >
> >< (%o26) true
> >
> ><
> >
> >< Nathaniel
> >
> ><
> >
> ><
> >
> >< 2009/10/3 Nathaniel Virgo <nathanielvirgo at gmail.com>
> >
> ><
> >
> >< > Hi
> >
> >< >
> >
> >< > I just came across the following.  Should it be considered a bug?
> >
> >< >
> >
> >< >
> >
> >< > this works fine:
> >
> >< >
> >
> >< > (%i10) C:integrate(g(y),y,c,d);
> >
> >< > (%o10) integrate(g(y),y,c,d)
> >
> >< >
> >
> >< > (%i11) A: integrate(C*f(x),x,a,b);
> >
> >< > (%o11) integrate(f(x),x,a,b)*integrate(g(y),y,c,d)
> >
> >< >
> >
> >< > it has successfully taken the constant outside the integral
> >
> >< >
> >
> >< > (%i12) B: C*'integrate(f(x),x,a,b);
> >
> >< > (%o12) integrate(f(x),x,a,b)*integrate(g(y),y,c,d)
> >
> >< >
> >
> >< > so A and B are the same
> >
> >< >
> >
> >< > (%i13) is(A=B);
> >
> >< > (%o13) true
> >
> >< >
> >
> >< > however, if I do the following, which should be exactly equivalent, it
> >
> >< > fails:
> >
> >< >
> >
> >< > (%i14) C:integrate(g(x),x,c,d);
> >
> >< > (%o14) integrate(g(x),x,c,d)
> >
> >< >
> >
> >< > (%i15) A: integrate(C*f(x),x,a,b);
> >
> >< > (%o15) integrate(f(x)*integrate(g(x),x,c,d),x,a,b)
> >
> >< >
> >
> >< > it has failed to realise that the x in the subexpression is a
> >different
> >
> >< > variable from the x in the outer integral, so it keeps the constant
> >inside
> >
> >< > the integral
> >
> >< >
> >
> >< > (%i16) B: C*'integrate(f(x),x,a,b);
> >
> >< > (%o16) integrate(f(x),x,a,b)*integrate(g(x),x,c,d)
> >
> >< >
> >
> >< > (%i17) is(A=B);
> >
> >< > (%o17) false
> >
> >< >
> >
> >< > ...and it now thinks the two expressions A and B are provably not the
> >same,
> >
> >< > even though they are in fact equivalent.  It would be ok (although a
> >bit
> >
> >< > lame) if it answered "maybe" here, but it seems to me that "false" is
> >just
> >
> >< > incorrect.
> >
> >< >
> >
> >< >
> >
> >< > Nathaniel
> >
> >< >
> >
> >< >
> >
> ><
> >
> >
> >
> >Nathaniel,
> >
> >You slide between equal and equivalent and are not clearly
> >
> >distinguishing between the two. Maxima does. From
> >
> >
> >
> >? =
> >
> >
> >
> > `is(<a> = <b>)' evaluates `<a> = <b>' to `true' when <a> and <b>
> >
> >     are syntactically equal (that is, identical).  Expressions can be
> >
> >     equivalent and not syntactically equal.
> >
> >
> >
> >Try
> >
> >
> >
> >is(equal(A,B));
> >
> >
> >
> >
> >
> >Leo
> >
> >
> >
> >--
> >
> >The University of Edinburgh is a charitable body, registered in
> >
> >Scotland, with registration number SC005336.
> >
> >
> >
> >
> >
> >_______________________________________________
> >Maxima mailing list
> >Maxima at math.utexas.edu
> >http://www.math.utexas.edu/mailman/listinfo/maxima
>
>