odd behaviour of `if`



Hi !

I'm getting bugged by somewhat odd (and for me unexpected) behaviour of maple:

subs(i=5,`if`(i mod 5 = 0,1,i)) = 5, but `if`(5 mod 5 = 0,1,5) = 1

and in sum and product statement the `if` behaves like with the
substitution.
What's the reason for this behaviour and is there a workaround?
In other words how can if use the `if` in formulas/products/sums ?
.



Relevant Pages

  • Re: odd behaviour of `if`
    ... and in sum and product statement the `if` behaves like with the ... substitution. ...
    (sci.math.symbolic)
  • Re: Does such strange function exist (nondiff yet cont)?
    ... function *and* to prove that it behaves the way you want it to behave. ... = sum f_n. ... Highlights of a proof, with ... many details left to the reader: ...
    (sci.math)
  • Re: Problem using solve... keeps busy
    ... However, if you then simplify() the result, you get a *large* ... Then at the end of the sum, there are a few lines of other terms ... and you simplifyafter substitution (applying the ... a=x into the original equation ...
    (comp.soft-sys.matlab)
  • Re: x^y + y^z + z^x > 1
    ... Venkat Reddy wrote: ... or another substitution), which is also "messy" (albeit simple). ... the minimal value for the sum in ...
    (sci.math)
  • Re: x^y + y^z + z^x > 1
    ... or another substitution), which is also "messy" (albeit simple). ... Just some curiosity as a math newbie: At the minimal value for the ... the minimal value for the sum in ...
    (sci.math)