Tools for solving formulas and equations — symbolic, numeric, step-by-step, and graphical — and how each class is used to independently verify the formulas in this library. The library's discipline is that no implementation certifies itself: every export is pinned to a canonical value or cross-checked by at least one tool from this page. Formula details live in the searchable index.
Exact answer wanted → symbolic. Number wanted from a formula with no closed form → numeric. Learning or auditing the derivation → step-by-step. Building intuition about roots, intersections, and shape → graphing.
| Class | Tools | Solves | Reaches its limit when |
|---|---|---|---|
| Symbolic (CAS) | SymPy · WolframAlpha · pen-input CAS apps (Derive-style handwriting canvases) | Exact antiderivatives, closed-form roots, algebraic simplification, ODEs | No elementary closed form exists — most real pricing integrals |
| Numeric | SciPy · NumPy · MATLAB / Octave | Quadrature, root-finding, optimization, linear systems — to machine precision | You need the form of the answer, not its value |
| Step-by-step web | eMathHelp Integral Calculator · WolframAlpha Pro steps · Symbolab | Worked derivations with each rule named — audit-grade paper trail | Expressions exceed textbook size; no programmatic reuse |
| Graphing | Desmos · GeoGebra | Roots as x-intercepts, equilibria as intersections, sensitivity by slider | You need more than ~3 significant figures |
A CAS answers with a formula, not a float. Use it to confirm the algebra this library hard-codes — breakeven identities, parity relations, closed-form Greeks — before trusting any numeric agreement.
# Gate 5 breakeven: solve EV(p) = p·RR − (1−p) = 0 exactly >>> from sympy import symbols, solve, Rational >>> p, rr = symbols("p rr", positive=True) >>> solve(p*rr - (1 - p), p) [1/(rr + 1)] ← breakeven_win_rate, exact >>> solve(p*Rational(3,2) - (1-p) - Rational(1,4), p) [1/2] ← EV floor 0.25R at R:R 1.5 ⇒ p* = 50%
When the closed form runs out, SciPy turns the formula into a number to machine precision. The library itself keeps SciPy as an optional extra — NumPy core stays dependency-light; SciPy powers the CVaR LP solver and the verification bench.
# Verify Black-Scholes 10.4506 (Hull) by brute-force quadrature >>> from scipy.integrate import quad; from numpy import exp, log, sqrt, pi >>> S,K,r,T,s = 100,100,.05,1,.20 >>> f = lambda z: exp(-z*z/2)/sqrt(2*pi) * \ ... max(S*exp((r-s*s/2)*T + s*sqrt(T)*z) - K, 0) >>> exp(-r*T) * quad(f, -10, 10)[0] 10.450583572534535 ← black_scholes_call gives 10.450583572186: agreement to 9 decimals (quad tolerance) # Root-find the same Gate 5 boundary numerically >>> from scipy.optimize import brentq >>> brentq(lambda p: p*2.5 - 1 - 0.25, 0, 1) 0.5 ← agrees with the CAS and the library
Web solvers like eMathHelp's Integral Calculator return not just the answer but each rule applied — substitution, parts, table lookup. That is a derivation audit trail: the same posture as this stack's gate audits, where the verdict must be reproducible line by line.
∫ cos(x²) dx ← the calculator's own example = √(π/2) · C(√(2/π)·x) + K Fresnel C — no elementary form
The example is chosen well: it looks innocent and has no elementary antiderivative. A step-by-step solver proves that honestly (it names the Fresnel special function) where a naive symbolic attempt just stalls — the tool tells you which class of answer exists before you spend time hunting for one that doesn't.
Plot the two sides of an equation and the solution is the intersection; plot f and the roots are the x-intercepts. For this library's decision math, Desmos is the fastest way to see the gate geometry before trusting any solver's number.
# Paste into Desmos — Gate 5 in two curves: f(p) = p·(1 + 1.5) − 1 EV at R:R = 1.5 y = 0.25 the EV floor → intersection at p = 0.5 the charter worked number # Supply–demand equilibrium (derivatives §26): Q = 400 − 2P demand Q = −100 + 2P supply → intersection at P* = 125, Q* = 150
| Library export | Verified against | Pinned value / identity |
|---|---|---|
black_scholes_call | Hull canon + SciPy quadrature | 10.4506 at S=K=100, r=5%, σ=20%, T=1 |
breakeven_win_rate | SymPy exact solve · Desmos intersection | π* = 1/(1+R:R); 40% at 1.5R |
ev_gate_check | brentq root of the floor equation | p* = 0.50 at floor 0.25R, R:R 1.5 |
cvar_lp_solve_robust | SciPy linprog (the optional extra itself) | Rockafellar–Uryasev LP formulation |
crr_price | Lattice → Black-Scholes convergence | within 0.01 of 10.4506 at 1000 steps |
linear_equilibrium | Desmos/GeoGebra intersection | P* = 125, Q* = 150 on the Figure-2 lines |
fokker_planck_step | Analytic moments of the diffusion | mass ≡ 1; mean drifts μ·t; variance grows σ²·t |
| Gate 5 in production | Parity suite (library as third oracle beside MATLAB) | verdict parity through the old rounding boundary |