Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding properties of a real function

Is there a way, using sympy, to figure out (some) properties of a function, thought of as a real function?

For example, if

>>> x = Symbol('x', real=True)
>>> f = Lambda(x, sqrt((x-2)/(x+2)))

then something like

>>> 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

Some of this is implemented in Wolfram Alpha.

like image 465
Bach Avatar asked Oct 18 '22 06:10

Bach


1 Answers

Some of these are implemented in sympy.calculus.util and sympy.calculus.singularities, although they aren't exported to from sympy import * yet, so you'd have to import them manually. The functionality for some of them is still limited, so you may not yet get an answer.

like image 78
asmeurer Avatar answered Oct 21 '22 00:10

asmeurer