使用sympy
,有没有一种方法可以找出一个被视为实函数的函数的某些属性呢?
例如,如果
>>> x = Symbol('x', real=True)
>>> f = Lambda(x, sqrt((x-2)/(x+2)))
然后类似于这样。
>>> 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
一些内容已在 Wolfram Alpha 中实现。