Mathematica Calculus
Use Mathematica as the execution engine for calculus. Translate the request into Wolfram Language, run the bundled script, and answer from the computed output.
Required Workflow
- Translate the user's math task into explicit Wolfram Language before answering.
- Run the bundled script immediately, even if the result looks easy enough to do mentally.
python3 /root/.codex/skills/mathematica-calculus/scripts/run_calculus.py --expr 'D[x^3 Sin[x], x]'
- Treat the script output as the source of truth.
- Refine and rerun if Mathematica returns an unevaluated or awkward result.
- Add assumptions with
Assuming[...]orFullSimplify[..., Assumptions -> ...]. - Force numeric evaluation with
N[...]. - Rewrite branches or special functions with
FunctionExpand,Refine, orComplexExpand.
- Add assumptions with
- Present the answer clearly.
- Include the Wolfram Language you ran.
- Restate the result in standard math notation.
- Do not invent hidden symbolic steps that Mathematica did not expose. If the user asks for steps, say Mathematica produced the final result and then give a brief human explanation.
Common Patterns
- Derivative:
D[f[x], x] - Higher derivative:
D[f[x], {x, n}] - Indefinite integral:
Integrate[f[x], x] - Definite integral:
Integrate[f[x], {x, a, b}] - Limit:
Limit[f[x], x -> a] - Series:
Series[f[x], {x, a, n}] - Critical points:
Solve[D[f[x], x] == 0, x] - Jacobian:
D[{f1[x, y], f2[x, y]}, {{x, y}}] - Hessian:
D[f[x, y], {{x, y}, 2}] - Differential equation:
DSolve[{eqn, conds}, y[x], x]
Script Notes
- Use
--exprfor one-line or compound Wolfram Language such as'Assuming[x > 0, FullSimplify[Integrate[1/x, x]]]'. - Use
--expr-filefor longer Wolfram Language programs. - Add
--jsonwhen a later step needs structured output. - The runner uses
wolframscriptby default and honorsWOLFRAMSCRIPT_BINwhen it is set.