How can I define a abstract odd function, say f[x].
Whenever f[x]+f[-x] appears, mathematica simplifies it to zero.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This can be done easily using upvalues
Normally Mathematica would try to assign the above rule to
Plus, which of course does not work since that’s protected. By using^:=instead of:=you can assign the rule tof. A quick check yields:Edit: This, however, only works for
Plus. It’s probably better to use something more general, like:Now this also works with things like
If you also want the function to work symbolically, you could add something like: