Skip to main content
skill CX Codex

root-finding — Claude Code skill for numerical roots

root-finding is a Claude Code skill that selects a numerical method for finding equation or system roots based on available derivatives and a known interval.

MIT ★ 3,951 updated 2026-01-26

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add parcadei/Continuous-Claude-v3 --skill root-finding -a claude-code
Open on GitHub

What root-finding does

The skill starts by sorting out whether the task involves one root or several, whether an interval containing a root is known, and whether derivatives are available. For a bracketed root without derivatives, it points to bisection or Brent’s method; with derivatives, it suggests Newton’s method. Systems of equations use scipy.optimize.fsolve.

Examples call scipy.optimize.brentq and scipy.optimize.newton. For symbolic solutions, the skill shows sympy_compute.py solve, while multiple roots can be approached by deflation or by trying several starting points. One practical distinction matters: the guide says brentq is guaranteed to converge when the root is bracketed.

To check a result, it recommends comparing the function value at the candidate root with a tolerance and checking that the root lies in the expected domain. It also gives z3_solve.py prove "f(root) == 0" as a proof command. The runnable examples use uv run python.

What it helps with

  • select a root-finding method based on derivatives and a bracket
  • compute an equation’s root with SciPy
  • solve a nonlinear system of equations
  • search for multiple roots from different starting points
  • check a computed root against a tolerance and domain

Example prompts for the agent

  • Find a root of x**2 - 2 between 0 and 2 and choose a suitable method.
  • Solve this nonlinear system with an appropriate SciPy method.
  • Search for multiple roots from different starting points, then check the results.

How to install root-finding

1Skills CLI (Vercel)

npx skills add parcadei/Continuous-Claude-v3 --skill root-finding -a claude-code

2Manually: put the files in place

~/.claude/skills/root-finding/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/root-finding/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about root-finding

How do I install root-finding in Claude Code?

Run npx skills add parcadei/Continuous-Claude-v3 --skill root-finding -a claude-code. The skill file is at ~/.claude/skills/root-finding/SKILL.md.

What does root-finding do?

It helps choose a numerical method for an equation or system based on whether derivatives and a root-containing interval are available, then suggests checks for the result.

How does the skill recommend checking a root?

Compare the function’s value at the candidate root with a tolerance and confirm the root is in the expected domain. The guide also gives z3_solve.py prove "f(root) == 0".

Source text

SKILL.md · MIT
---
name: root-finding
description: "Problem-solving strategies for root finding in numerical methods"
allowed-tools: [Bash, Read]
---

# Root Finding

## When to Use

Use this skill when working on root-finding problems in numerical methods.

## Decision Tree


1. **Characterize the Problem**
   - Single root or multiple roots?
   - Bracketed (know interval containing root)?
   - Derivatives available?

2. **Method Selection**
   | Situation | Method | Implementation |
   |-----------|--------|----------------|
   | Bracketed, no derivatives | Bisection, Brent | `scipy.optimize.brentq` |
   | Derivatives available | Newton-Raphson | `scipy.optimize.newton` |
   | No derivatives | Secant method | `scipy.optimize.newton` (no fprime) |
   | System of equations | `scipy.optimize.fsolve` | Requires Jacobian ideally |

3. **Implement Root Finding**
   - `scipy.optimize.brentq(f, a, b)` - guaranteed convergence if bracketed
   - `scipy.optimize.newton(f, x0, fprime=df)` - quadratic convergence near root
   - For systems: `scipy.optimize.fsolve(F, x0)`

4. **Handle Multiple Roots**
   - Deflation: divide out found roots
   - Multiple starting points
   - `sympy_compute.py solve "f(x)" --var x` for symbolic solutions

5. **Verify Solutions**
   - Check |f(root)| < tolerance
   - Verify root is in expected domain
   - `z3_solve.py prove "f(root) == 0"`


## Tool Commands

### Scipy_Brentq
```bash
uv run python -c "from scipy.optimize import brentq; root = brentq(lambda x: x**2 - 2, 0, 2); print('Root:', root)"
```

### Scipy_Newton
```bash
uv run python -c "from scipy.optimize import newton; root = newton(lambda x: x**2 - 2, 1.0, fprime=lambda x: 2*x); print('Root:', root)"
```

### Sympy_Solve
```bash
uv run python -m runtime.harness scripts/sympy_compute.py solve "x**3 - x - 1" --var x
```

## Key Techniques

*From indexed textbooks:*

- [Numerical analysis (Burden R.L., Fair... (Z-Library)] How accurate was his approximation? C H A P T E R 2 Solutions of Equations in One Variable 2. Survey of Methods and Software In this chapter we have considered the problem of solving the equation f (x) = 0, where f is a given continuous function.
- [An Introduction to Numerical Analysis... (Z-Library)] Computational Solution of Nonlinear Operator Equations. Methods for Solving Systems of Nonlinear Equations. Society for Industrial and Applied Mathematics, Philadelphia.
- [An Introduction to Numerical Analysis... (Z-Library)] General polynomial rootfinding methods There are a large number of rootfind ing algorithms designed especially for polynomials. Many of these are taken up in detail in the books Dejon and Henrici (1969), Henrici (1974, chap. There are far too many types of such methods to attempt to describe them all here.
- [An Introduction to Numerical Analysis... (Z-Library)] J n Consider the product a 0 a 1 ••• am, where a 0 , a1, ••• , am are m + 1 num bers stored in a computer that uses n digit base fJ arithmetic. What is a rigorous bound for w? What is a statistical estimate for the size of w?
- [An Introduction to Numerical Analysis... (Z-Library)] Discussion of the Literature There is a large literature on methods for calculating the roots of a single equation. See the books by Householder (1970), Ostrowski (1973), and Traub (1964) for a more extensive development than has been given here. Newton's method is one of the most widely used methods, and its development is due to many people.

## Cognitive Tools Reference

See `.claude/skills/math-mode/SKILL.md` for full tool documentation.

© parcadei · MIT · parcadei/Continuous-Claude-v3

Similar skills

All skills for Science and research →

From the same set161

The whole set →
second-order-odes second-order-odes guides Claude Code through analytical and numerical workflows for solving second-order ordinary differential equations. CX Codex +1 ★ 3,951repo stars math-model-selector The math-model-selector skill helps identify a mathematical framework when you have a problem but aren’t sure how to formalize it. Use it to choose a direction before working through the calculations. CX Codex +1 ★ 3,951repo stars first-order-odes first-order-odes — a skill for classifying and solving first-order differential equations. Guides you through equation type detection, selects a solution method, and provides commands for both analytical and numerical solving. CX Codex +1 ★ 3,951repo stars operator-theory operator-theory — a skill for Claude Code with strategies for functional analysis: bounded operator verification, spectral theory, compact operators. Runs Z3 and SymPy for proofs and computations. CX Codex +1 ★ 3,951repo stars banach-spaces Tackles problems in functional analysis involving Banach spaces. Includes strategies for proving key theorems: completeness, Hahn-Banach, open mapping, closed graph, and uniform boundedness principle. CX Codex +1 ★ 3,951repo stars contour-integrals contour-integrals — a Claude Code skill for solving contour integral problems in complex analysis. It guides you through choosing the right contour, locating poles, and applying the residue theorem to evaluate definite integrals. CX Codex +1 ★ 3,951repo stars arbiter arbiter runs unit and integration tests, investigates failures, and checks an implementation against acceptance criteria. Saves its report in the project. CX Codex ★ 3,951repo stars convex-optimization Skill for tackling convex optimization problems. Includes convexity verification, problem classification, and solution methods based on KKT conditions. CX Codex +1 ★ 3,951repo stars

Project sponsors

Companies that keep this analytics open