Stavros,
I guess you want it this way round:
(%i2) freeof(x, sum(f(i,x),i,1,inf));
(%o2) false
(%i3) freeof(i, x[i]);
(%o3) false
(%i4) freeof(x, x[i]);
(%o4) false
some more comments on freeof:
(%i5) freeof(i, sin(x));
(%o5) true
OK, i is no sub expression
(%i6) freeof(inf, sum(1/k^42,k,1,inf));
(%o6) false
OK
(%i12) freeof(42, sum(1/k^42,k,1,inf));
(%o12) true
1/k^42 is internally represented with -42, so
(%i13) freeof(-42, sum(1/k^42,k,1,inf));
(%o13) false
or
(%i17) simp:false$
(%i18) freeof(42, sum(1/k^42,k,1,inf));
(%o18) false
I don't know if it is possible to turn the simplifier off when evaluating freeof
or if this would cause trouble then.
FWIW
Volker
Am 15 Jun 2008 um 17:36 hat Stavros Macrakis geschrieben:
> Whether it actually *depends on* the variable is in general hard to
> determine. For example, does sin(x)^2+cos(x)^2 depend on x? No, of
> course not, though it contains the variable x. Probabilistic tests
> like the ones RJF outlines fail on cases like (if x=.2323 then 1 else
> 0).
>
> But I suspect you actually simply want to know whether a certain
> variable is named in an expression, in which case you can use
>
> not freeof( expr, var)
> or
> member(var, listofvars(expr))
>
> There are some annoying edge cases for both of these because they're
> rather simple syntactic tests.
>
> For example:
>
> freeof(sum(f(i,x),i,1,inf),x) => true (OOPS!)
> freeof(x[i],i) => true
> freeof(x[i],x) => true
> freeof(x[i],x[j]) => true
>
> There is almost *nothing* in Maxima that should be done by looking at
> the string form of an expression (except perhaps to compare length as
> a sort of measure of complexity).
>
> -s
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima