Calculus

This module contains query handlers responsible for calculus queries: infinitesimal, finite, etc.

class sympy.assumptions.handlers.calculus.AskFiniteHandler[source]

Handler for key ‘finite’.

Test that an expression is bounded respect to all its variables.

Examples of usage:

>>> from sympy import Symbol, Q
>>> from sympy.assumptions.handlers.calculus import AskFiniteHandler
>>> from sympy.abc import x
>>> a = AskFiniteHandler()
>>> a.Symbol(x, Q.positive(x)) == None
True
>>> a.Symbol(x, Q.finite(x))
True
static Add(expr, assumptions)[source]

Return True if expr is bounded, False if not and None if unknown.

Truth Table:

  B U ?
    ‘+’ ‘-‘ ‘x’ ‘+’ ‘-‘ ‘x’
B B U ?
U ‘+’   U ? ? U ? ?
‘-‘   ? U ? ? U ?
‘x’   ? ?
?     ?
  • ‘B’ = Bounded
  • ‘U’ = Unbounded
  • ‘?’ = unknown boundedness
  • ‘+’ = positive sign
  • ‘-‘ = negative sign
  • ‘x’ = sign unknown

  • All Bounded -> True
  • 1 Unbounded and the rest Bounded -> False
  • >1 Unbounded, all with same known sign -> False
  • Any Unknown and unknown sign -> None
  • Else -> None

When the signs are not the same you can have an undefined result as in oo - oo, hence ‘bounded’ is also undefined.

static Mul(expr, assumptions)[source]

Return True if expr is bounded, False if not and None if unknown.

Truth Table:

  B U ?
      s /s
B B U ?
U   U U ?
?     ?
  • B = Bounded
  • U = Unbounded
  • ? = unknown boundedness
  • s = signed (hence nonzero)
  • /s = not signed
static Pow(expr, assumptions)[source]

Unbounded ** NonZero -> Unbounded Bounded ** Bounded -> Bounded Abs()<=1 ** Positive -> Bounded Abs()>=1 ** Negative -> Bounded Otherwise unknown

static Symbol(expr, assumptions)[source]

Handles Symbol.

Examples

>>> from sympy import Symbol, Q
>>> from sympy.assumptions.handlers.calculus import AskFiniteHandler
>>> from sympy.abc import x
>>> a = AskFiniteHandler()
>>> a.Symbol(x, Q.positive(x)) == None
True
>>> a.Symbol(x, Q.finite(x))
True