查找实际函数的属性

Bac*_*ach 5 python math symbolic-math sympy

有没有办法,使用sympy,找出一些函数的属性,被认为是一个真正的函数?

例如,如果

>>> x = Symbol('x', real=True)
>>> f = Lambda(x, sqrt((x-2)/(x+2)))
Run Code Online (Sandbox Code Playgroud)

然后像

>>> f.domain()
(-oo, -2) U [2, oo)
>>> f.image()  # there is "imageset", but it is not expanding on the set of reals
[0, 1) U (1, oo)
>>> f.is_injective()
True
>>> f.is_bounded()
False
>>> f.is_even  # currently returns None
False
Run Code Online (Sandbox Code Playgroud)

其中一些是在Wolfram Alpha中实现的.

asm*_*rer 3

其中一些在sympy.calculus.util和中实现sympy.calculus.singularities,尽管它们尚未导出到from sympy import *,因此您必须手动导入它们。其中一些功能仍然有限,因此您可能尚未得到答案。