求实函数的性质

2024-04-25 06:55:02 发布

您现在位置:Python中文网/ 问答频道 /正文

有没有一种方法,使用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中实现的。你知道吗


Tags: 方法lambda函数imagefalsetrue属性is