residues
Provides automated strategies for computing residues, identifying pole orders, and applying the Residue Theorem using SymPy and Z3.
Install
mkdir -p .claude/skills/residues && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3318" && unzip -o skill.zip -d .claude/skills/residues && rm skill.zipInstalls to .claude/skills/residues
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Problem-solving strategies for residues in complex analysisKey capabilities
- →Compute residue limits for poles
- →Differentiate for high-order poles
- →Perform Laurent series expansions
- →Verify contour integral poles
How it works
Uses SymPy symbolic math to automate limits and derivatives according to standard residue theorem decision trees.
Inputs & outputs
When to use residues
- →Computing residues for simple poles
- →Determining order of poles
- →Calculating complex line integrals
- →Laurent series expansion
About this skill
Residues
When to Use
Use this skill when working on residues problems in complex analysis.
Decision Tree
-
Computing Residues
- Simple pole at z0:
- Res(f, z0) = lim_{z->z0} (z - z0)f(z)
sympy_compute.py limit "(z - z0)*f(z)" --var z --at z0
- Pole of order n:
- Res(f, z0) = (1/(n-1)!) * lim d^{n-1}/dz^{n-1}[(z-z0)^n f(z)]
sympy_compute.py diff "((z-z0)**n)*f(z)" --var z --order n-1
- L'Hopital shortcut for f = g/h with simple pole:
- Res(f, z0) = g(z0)/h'(z0)
- Simple pole at z0:
-
Identify Pole Order
- Simple pole: (z - z0)f(z) has finite limit
- Order n: (z - z0)^n f(z) has finite limit, but (z - z0)^{n-1} f(z) doesn't
sympy_compute.py limit "(z - z0)**n * f(z)" --var z --at z0
-
Essential Singularities
- Neither pole nor removable (e.g., e^{1/z} at z=0)
- Compute residue via Laurent series
sympy_compute.py series "exp(1/z)" --var z --at 0
-
Apply Residue Theorem
- oint_C f(z)dz = 2pii * (sum of residues inside C)
- Count only poles INSIDE the contour
z3_solve.py prove "pole_inside_contour"
Tool Commands
Sympy_Residue
uv run python -m runtime.harness scripts/sympy_compute.py residue "1/((z-1)*(z-2))" --var z --at 1
Sympy_Limit
uv run python -m runtime.harness scripts/sympy_compute.py limit "(z - z0)*f(z)" --var z --at z0
Sympy_Laurent
uv run python -m runtime.harness scripts/sympy_compute.py series "exp(1/z)" --var z --at 0
Z3_Pole_Inside
uv run python -m runtime.harness scripts/z3_solve.py prove "abs(z0) < R"
Key Techniques
From indexed textbooks:
- [Complex analysis an introduction to... (Z-Library)] The fact that the calculus of residues yields complex rather than real integrals is no dis¬ (49) with g(z) — z, we obtain <»» i>(”)=25 / f^w) = 2vi / /'() /(z) - w z dz. If (49) is applied with g(z) = zm, equation (50) is replaced by 2iri I |z-zo| = /'() f(z) - w zm dz. The right-hand member represents an analytic function of w for \w — ir0| < 8.
- [Complex analysis an introduction to... (Z-Library)] What are the possible values of r dz J /l — z2 over a closed curve in the region? THE CALCULUS OF RESIDUES The results of the preceding section have shown that the determination of line integrals of analytic functions over closed curves can be reduced to the determination of periods. Under certain circumstances it turns out that the periods can be found without or with very little computation.
- [Complex analysis an introduction to... (Z-Library)] Hint: Sketch the image of the imaginary axis and apply the argument principle to a large half disk. Evaluation of Definite Integrals. The calculus of residues pro¬ vides a very efficient tool for the evaluation of definite integrals.
- [Complex analysis an introduction to... (Z-Library)] The particular function 1 /(z — ay) has a vanishing period. The constant Rj which produces this result is called the residue of f(z) at the point ay. We repeat the definition in the following form: It is helpful to use such self-explanatory notations as R = Res!
- [Complex Analysis (Elias M. Stein, Ram... (Z-Library)] Cauchy, 1826 There is a general principle in the theory, already implicit in Riemann’s work, which states that analytic functions are in an essential way charac- terized by their singularities. That is to say, globally analytic functions are “eectively” determined by their zeros, and meromorphic functions by their zeros and poles. While these assertions cannot be formulated as precise general theorems, there are nevertheless signicant instances where this principle applies.
Cognitive Tools Reference
See .claude/skills/math-mode/SKILL.md for full tool documentation.
When not to use it
- →Numerical integration where analytic methods fail
- →Real-valued calculus without complex extensions
Prerequisites
Limitations
- →Requires explicit function definition
- →Automated symbolic differentiation may fail on extremely complex functions
How it compares
Provides a structured decision tree for residue computation rather than relying on manual derivation or generic calculators.
Compared to similar skills
residues side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| residues (this skill) | 1 | 7mo | Review | Advanced |
| literature-review | 559 | 2mo | Review | Advanced |
| openalex-database | 48 | 7mo | Review | Intermediate |
| scientific-critical-thinking | 18 | 7mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by parcadei
View all by parcadei →You might also like
literature-review
K-Dense-AI
Conduct comprehensive, systematic literature reviews using multiple academic databases (PubMed, arXiv, bioRxiv, Semantic Scholar, etc.). This skill should be used when conducting systematic literature reviews, meta-analyses, research synthesis, or comprehensive literature searches across biomedical, scientific, and technical domains. Creates professionally formatted markdown documents and PDFs with verified citations in multiple citation styles (APA, Nature, Vancouver, etc.).
openalex-database
davila7
Query and analyze scholarly literature using the OpenAlex database. This skill should be used when searching for academic papers, analyzing research trends, finding works by authors or institutions, tracking citations, discovering open access publications, or conducting bibliometric analysis across 240M+ scholarly works. Use for literature searches, research output analysis, citation analysis, and academic database queries.
scientific-critical-thinking
davila7
Evaluate research rigor. Assess methodology, experimental design, statistical validity, biases, confounding, evidence quality (GRADE, Cochrane ROB), for critical analysis of scientific claims.
biorxiv-database
lifangda
Efficient database search tool for bioRxiv preprint server. Use this skill when searching for life sciences preprints by keywords, authors, date ranges, or categories, retrieving paper metadata, downloading PDFs, or conducting literature reviews.
physics-validator
omriwen
Validate optical physics parameters including Fresnel numbers, diffraction regimes, and resolution limits. This skill should be used when configuring Telescope, Microscope, or Camera instruments to ensure physically realistic parameters.
fda-database
davila7
Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.