Math Derivation Skill
Verify mathematical derivations step-by-step using SymPy.
When to Use
- Deriving equations (differentiation, integration, algebraic manipulation)
- Verifying mathematical identities
- Step-by-step proofs where each step should be validated
Workflow
For each derivation step:
- State the transformation being applied
- Write the result
- Verify with
./scripts/verify.pybefore proceeding
Verification Commands
# Check two expressions are equal
./scripts/verify.py eq "EXPR1" "EXPR2"
# Compute derivative
./scripts/verify.py diff "EXPR" [VAR]
# Compute integral
./scripts/verify.py int "EXPR" [VAR]
# Simplify/expand expression
./scripts/verify.py simp "EXPR"
# Solve equation (EXPR = 0)
./scripts/verify.py solve "EXPR" [VAR]
Paths are relative to this skill's directory.
Expression Syntax
- Powers:
x**2orx^2 - Functions:
sin(x),cos(x),exp(x),log(x),sqrt(x) - Pre-defined symbols:
x y z t s n k a b c C - Reserved symbols handled:
E I S N O(treated as variables, not SymPy constants)
Example Derivation
Problem: Find dF/ds where F(s) = s - log(e^s + C)
Step 1: Apply derivative rule
dF/ds = 1 - d/ds[log(e^s + C)]
= 1 - e^s/(e^s + C)
./scripts/verify.py diff "s - log(exp(s) + C)" s
Step 2: Simplify to single fraction
= (e^s + C - e^s)/(e^s + C)
= C/(e^s + C)
./scripts/verify.py eq "1 - exp(s)/(exp(s) + C)" "C/(exp(s) + C)"