Skip to main content

asymptotic

asymptotic is a symbolic asymptotic-analysis package built on SymPy. It spans directed real and multivariate asymptotics together with complex/sector-aware branch geometry, formal ODE/transseries interchange, asymptotic expansions, limits, sums, recurrences, implicit asymptotics, perturbation methods, and probability/Laplace asymptotics, and it includes certification and evidence for the conditions that make results valid. It handles simultaneous multivariate approaches, competing power/logarithmic/exponential scales, parameter conditions, and selected special-function and perturbation problems.

Installation

python -m pip install asymptotic

The package requires Python 3.11 or later and SymPy 1.14 or later. The required semialg dependency installs python-flint 0.9.0 or later. The flint extra also declares this backend explicitly. The ode extra supplies the differential-equation integration.

Start with a limit

import sympy as sp
from asymptotic import limit, one_sided_limit
from asymptotic.limit_models import LimitStatus

x, y = sp.symbols("x y", real=True)
assert limit(x * y / sp.sqrt(x**2 + y**2), (x, y), (0, 0)) == 0
assert one_sided_limit(1 / x, x, 0, direction="+") == sp.oo

Note that the direction argument uses the SymPy convention for the sign: + means the approach is from the right and - means the approach is from the left. This differs from Mathematica's convention, in which Direction -> +1 means you approach from more negative values and Direction -> -1 means you approach from more positive values.

When you give a tuple of variables you're asking for a simultaneous limit, not one coordinate limit followed by another. For limit(...) and other API functions, the package gives the mathematical answer (without wrappers containing metadata) by default when that is feasible, i.e. it can be represented without losing unresolved branches or hypotheses. Use the option return_result=True when you need status, conditions or evidence.

expr = x * y / (x**2 + y**2)
result = limit(expr, (x, y), (0, 0), return_result=True)
assert result.status is LimitStatus.DOES_NOT_EXIST
assert len({item.value for item in result.evidence}) >= 2

The result carries evidence for incompatible approaches. Inspect result.evidence when you need the proof route.

An asymptotic sum

from asymptotic import sum

n, k = sp.symbols("n k", positive=True, integer=True)
assert sum(
    k**-2, k, n, sp.oo, parameter=n, terms=3, method="euler-maclaurin"
) == 1/n + 1/(2 * n**2) + 1/(6 * n**3)

Use return_result=True for a sum's remainder, method and certificates. This option also exposes the internal records for expansion, solving, statistics and optimization workflows. Unresolved or unproved formal calculations retain their records. Lazy nested expansions and scale-regime stratifications keep the structures needed to express their mathematics; see the return conventions.

An asymptotic expansion: keep the error term

With a series expansion, keep its omitted-term scale alongside the prefix. For a positive variable tending to infinity:

from asymptotic import multiseries

t = sp.symbols("t", positive=True)
expansion = multiseries(sp.exp(1/t), t, scale=[1 / t], terms=5, return_result=True)
truncation = expansion.as_element().truncation(3)
assert truncation.prefix == 1 + 1/t + 1/(2 * t**2)
assert truncation.remainder.check() is True

Here the omitted scale is 1/(6*t**3). A remainder certificate concerns the declared regime; a formal series alone does not establish a uniform error bound. Follow the expansion guide for the difference between a prefix, its remainder and a certified operation.

Choose the right workflow

Question Entry point What to inspect
Does a limit exist on the full approach domain? limit Status, value and domain
What happens on every complex approach? complex_limit Finite-point chart and spherical poles
Which finite values can oscillation accumulate at? cluster_set Exact set, attained sequences and pole avoidance
What happens on one real side or a fixed complex ray? one_sided_limit, complex_ray_limit Direction and branch conditions
What are the leading terms on competing small scales? series, multiseries, local_series Scale, truncation and remainder
How does an implicit solution or root behave? implicit, root, inverse Branch and nonzero-derivative conditions
How does a sum, product or recurrence grow? sum, product, rsolve Exact identities and certificates
Which perturbation method fits my equation? regular_perturbation, lindstedt_poincare Regime, residual order and solvability
What is a probability or integral's asymptotic behavior? probability, expectation, mellin Domain, saddle geometry and error

The root namespace has 66 primary entry points, including result types. The API guide distinguishes between common and specialized/expert-level theorem/ geometry functions.

Understand the answer

Limit status Meaning
PROVED The value follows under the checked hypotheses.
DOES_NOT_EXIST Admissible approaches attain incompatible limiting values or another nonexistence certificate applies.
UNKNOWN Available methods cannot establish the result.

Formal expansions and certified asymptotic expansions are distinct. Read the attached remainder and certification information before using an expansion as an error bound. Numerical checks support a symbolic argument but do not replace its domain and branch hypotheses.

Capabilities and limitations

Area Representative support Important boundary
Univariate asymptotics powers, logs, exponentials, finite log-exp scales, generalized series not a complete decision procedure for every nested or oscillatory germ
Simultaneous multivariate limits exact composition, cylindrical reduction, radial order, weighted bounds, Newton/projective geometry, semialgebraic angular images, oscillatory clusters difficult high-dimensional images or unresolved symbolic parameters can remain UNKNOWN
Expansions multiseries, nested forms, Puiseux branches, transseries branch-sensitive complex continuation is partial
Implicit problems simple roots, Newton-Puiseux/scaling handoff, parameter strata general resolution of higher-dimensional singularities is outside scope
Sums and recurrences exact routes, Euler-Maclaurin, Mellin/Poisson routes, recurrence asymptotics difficult resonance and deeper ramification remain partial
ODE/perturbation structured PerturbationProblem, explainable method recommendation, regular/Lindstedt/multiple-scale/matched methods, symbolic residual validation, numerical convergence diagnostics automatic method selection declines ambiguous oscillator cases; general nonlinear/global connection problems are not solved
Probability/Laplace exact reductions, selected lattice methods, multivariate Laplace geometry curved constraints and general degenerate saddles are partial
Certification explicit status, evidence, replayable remainder certificates a formal construction is not automatically a certified asymptotic statement

For limits, strong coverage includes rational and algebraic real limits, uniform norm and logarithmic bounds, selected real discontinuities,selected parameter strata, finite local germs, fixed complex-ray branches, gamma and harmonic tails, proportional large-order Bessel J/Y tails, bounded recurrence reductions, and attained oscillatory subsequences. Complex directional infinity retains a direction and is distinct from spherical complex infinity. General complex sectors, arbitrary variable-order special functions, and coupled oscillations with accumulating poles need additional hypotheses or unsupported theorems. Some expressions exceed practical computation budgets. Unknown user functions have no assumed continuity; analytic_limit accepts an explicit, call-scoped analytic contract.

The capability matrix gives supported inputs, proof boundaries and limitations by area. The limit guide explains domains, parameters, branches and nonexistence witnesses for limits. The limit contracts guide covers conditional outputs, whole-plane approaches, cluster sets and directional infinities.

Learn by running examples

Start with certified limits, then try complex branches and special-function tails. Each example contains executable checks and explains its mathematical question.

For expansion, summation, probability and perturbation workflows, follow the examples guide. The getting-started guide supplies the assumptions and terminology needed for these examples.

The examples/ directory contains executable examples. The introductory sequence is:

  1. certified_limits.py — existence, nonexistence, domains, and evidence.
  2. multivariate_limits.py — radial, path-dependent, cylindrical, and correlated examples.
  3. ordinary_expansion.py — ordinary expansion.
  4. asymptotic_summation.py — discrete asymptotics.
  5. probability_asymptotics.py — probability and Laplace asymptotics.
  6. perturbation_problem.py — unified perturbation dispatch, validation, and evidence.

Documentation

I suggest starting with these guides:

Development

Contributions – whether they are bug reports, suggestions, or code – are welcome!

Source check:

python -m pip install -e ".[test,lint,benchmark]"
ruff check src tests examples
ruff format --check src tests examples
pytest -m "not reference_corpus"

Correctness, proof boundaries and performance tested separately. See testing guide and documentation guide.

Maintainers can follow the release guide for artifact checks and publishing gates.

License

The package is distributed under the GPL-3.0 license.

Metadata

Release files for asymptotic 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asymptotic 0.2.0
File Size Uploaded
asymptotic-0.2.0.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for asymptotic 0.2.0
File Interpreter ABI Platform
asymptotic-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.1 MB

Release files / asymptotic-0.2.0.tar.gz

Download URL asymptotic-0.2.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
74e87555c99acfce4c31faaf34621859fb2186be9c7175cf3a6677dd6fc3f574
BLAKE2b-256 checksum
How to use checksums
b399595a25dc9d7bfbf48d0376d5821304d6d5b11abda2398b7aad0b07093e1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / asymptotic-0.2.0-py3-none-any.whl

Download URL asymptotic-0.2.0-py3-none-any.whl
Size 853.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a6b390a3179e57f680570ff303a8ce68dfb25ad19ad5987752f0a055395f82f
BLAKE2b-256 checksum
How to use checksums
b17348633459b132de83d33c106a801d6d4c6d30da17f78457e148a6e5514ed2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page