Math Expression
Overview
Use this skill when a natural-language math request should be translated into a single Wolfram Language expression and then evaluated or solved.
It fits symbolic algebra, calculus, exact arithmetic, high-precision numerics, matrix problems, series, asymptotics, and ODE/PDE tasks. It does not replace a general code executor or a multi-step notebook workflow.
Quick start
python3 -m pip install --user wolframclient
python3 {baseDir}/scripts/eval_expression.py --expr "Factor[x^4 - 1]"
python3 {baseDir}/scripts/eval_expression.py --expr "DSolve[y''[x] + y[x] == 0, y[x], x]"
python3 {baseDir}/scripts/eval_expression.py --expr "N[Pi, 80]" --precision 80 --json
Safety boundary
- Use this skill for math-only Wolfram Language expressions.
- By default, the script blocks filesystem, network, and process-related symbols such as
Import, URLRead, Run, RunProcess, Get, Put, OpenRead, and OpenWrite.
- Do not disable this guard unless the runtime is isolated.
- This skill is not a general code execution tool and not a multi-step notebook agent.
Workflow
- Convert the user's request into one Wolfram Language expression.
- Check that the expression is math-only.
- Run
scripts/eval_expression.py --expr "..."
- Return
Exact, Numeric, Verified, and Version.
Examples
- Algebraic simplification:
Factor[x^4 - 1]
- Definite integral:
Integrate[x^2 Exp[-x], {x, 0, Infinity}]
- Limit:
Limit[(Sin[x] - x)/x^3, x -> 0]
- ODE analytic solution:
DSolve[y''[x] + y[x] == 0, y[x], x]
- PDE numeric solution:
NDSolve[{D[u[x, t], t] == D[u[x, t], {x, 2}], u[0, t] == 0, u[1, t] == 0, u[x, 0] == Sin[Pi x]}, u, {x, 0, 1}, {t, 0, 1}]
- Asymptotic expansion:
Asymptotic[LogGamma[x], x -> Infinity, 5]
- High-precision value:
N[Pi, 120]
Notes
- Input is Wolfram Language only.
- This skill is single-expression and single-run.
- Runtime dependency:
wolframclient and WolframKernel.