I think it would be useful to have even and odd function assumptions
that could be added to Function to assume that the function is even or
odd.
So you should be able to do something like
>>> f = Function('f', even=True)
>>> f(-x)
f(x)
>>> g = Function('g', odd=True)
>>> g(-x)
-g(x)
Feel free to send in a patch implementing this.
Aaron Meurer
On Mon, Feb 28, 2011 at 5:05 PM, Ondrej Certik <[email protected]> wrote:
> Hi Jeff,
>
> On Mon, Feb 28, 2011 at 3:40 PM, Jeff <[email protected]> wrote:
>> Hi,
>>
>> For function f, I would like to make -f(x) equal to f(-x).
>>
>> I wonder what would be a good way to do it in sympy.
>
> You can look into the implementation of the sin(x) function, which has
> this behavior:
>
>>>> sin(-x)
> -sin(x)
>
>
> Ondrej
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.