SymPy - Symbolic Mathematics in Python
Guides Claude to use SymPy for exact symbolic algebra, calculus, equation solving, and code generation.
Dev & CodingIntermediate★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
This skill teaches Claude how to use SymPy, Python's symbolic math library, so results stay exact (sqrt(2)) instead of floating-point approximations (1.414...). It covers:
- Declaring symbols and applying assumptions (
positive=True,integer=True) for cleaner simplification - Calculus: derivatives, integrals, limits, series expansions
- Picking the right solver:
solveset,linsolve,nonlinsolve,dsolve, and legacysolve - Symbolic linear algebra (matrices, eigenvalues) plus physics, number theory, geometry via modular reference files
- Output paths:
lambdifyto NumPy,latex()/pprint()for documentation, C/Fortran codegen
A troubleshooting section covers undefined symbols, accidental float contamination, slow subs() loops, and stubborn simplifications.
Who it's for
- Researchers and grad students who want derivations plus a verification step
- Engineers who need closed-form answers, not just numerical estimates
- Developers turning derived formulas into fast Python/C functions
- Teachers and students who want clean LaTeX write-ups of solutions
Example uses
- Solve and verify: "Solve x²−5x+6=0 and substitute each root back in" → returns [2, 3] with a
simplify(expr.subs(...))assertion. - Symbolic-to-numeric pipeline: "Differentiate sin(x)/x and plot it from −10 to 10" →
diff, thenlambdify(..., 'numpy')and a Matplotlib snippet. - Publication-ready output: "Compute ∫₀¹ x² dx and show LaTeX plus the decimal value" → combines
Integral().doit(),latex(), andevalf().
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/sympy folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/sympy/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git && mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/sympy ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal (Terminal on macOS/Linux, WSL or Git Bash on Windows).
- Confirm Python 3.9+ is available:
python3 --version. - Install SymPy:
pip install "sympy>=1.14". Optionally addpip install numpy scipy matplotlibfor the lambdify and plotting examples. - Clone the skill repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Copy the skill into Claude's skills folder:
mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/sympy ~/.claude/skills/ - Verify with
ls ~/.claude/skills/sympy— you should see SKILL.md and a references directory. - Restart Claude Code and try a prompt like "Use SymPy to solve x²−5x+6=0".
- Note: the docs reference both
core_capabilities.mdandcore-capabilities.md; if a link fails, check the actual filenames inside the references folder.
View source on GitHub ↗License: MIT