Calculator
Example Data Table
| f(x,y) | Point (x0,y0) | Expected behavior | Notes |
|---|---|---|---|
| x^2*y + sin(x*y) | (1, 2) | Nonlinear, mixed curvature | Good sanity test for fxy. |
| x^2 + y^2 | (3, -1) | Constant curvature | fxx = 2, fyy = 2, fxy = 0. |
| exp(x) * cos(y) | (0, 0) | Curvature changes with y | Try smaller steps to reduce error. |
Formula Used
This calculator estimates second partial derivatives using central finite differences, evaluated at a point.
Central differences are typically more accurate than forward differences for smooth functions, but very tiny steps can amplify floating‑point noise.
How to Use This Calculator
- Enter a valid function using variables x and y.
- Choose the evaluation point (x0, y0).
- Set step sizes hx and hy (start with 1e-4).
- Optional: enable grid samples to view nearby curvature values.
- Press Compute. Results appear above the form.
Notes on Accuracy
- Smoothness matters: discontinuities can produce misleading derivatives.
- Step tuning: try hx,hy in the 1e-3 to 1e-6 range.
- Scale awareness: large x,y values may require larger steps.
Numerical second derivatives for real-world models
Many multivariable models are defined by measured relationships rather than closed-form calculus. Central differences let you estimate curvature directly from function evaluations, making the workflow practical for optimization, sensitivity studies, and surface fitting across engineering, economics, and machine learning.
What fxx, fyy, and fxy reveal about a surface
The values fxx and fyy describe curvature along the x and y directions at the chosen point. A positive fxx indicates local upward curvature in x, while a negative value suggests downward curvature. The mixed term fxy captures interaction: how the slope in x changes as y varies.
Step-size selection and practical error control
Central difference error typically scales with the square of the step size for smooth functions, while rounding error grows as steps get extremely small. In practice, try hx and hy between 1e-3 and 1e-6. If results fluctuate sharply when halving steps, rounding noise or non-smooth behavior may dominate.
Using grid samples to validate stability
The optional grid table provides nearby evaluations around (x0, y0). Consistent patterns across the neighborhood are a strong signal that the chosen steps are stable. Large sign flips or outliers often point to discontinuities, very steep gradients, or a step size that is too small for the numeric scale.
Interpreting Plotly surface and contour views
The surface plot visualizes f(x,y) locally, while the contour plot emphasizes level sets and steep regions. Broad, evenly spaced contours imply gentle change; tightly packed contours imply rapid change. When mixed curvature is present, contours often tilt or bend, reflecting non-separable behavior in x and y.
Data export for reporting and reproducibility
Use CSV export to archive inputs, results, and grid samples for audit trails or spreadsheet analysis. The PDF export is suited for quick sharing in reviews. Keeping the expression, point, and step sizes together helps others reproduce the same numeric derivatives and compare revisions over time.
FAQs
Does this compute symbolic derivatives?
No. It estimates derivatives numerically using central finite differences, which is useful when symbolic differentiation is unavailable or inconvenient.
What functions are supported in the expression?
Common functions like sin, cos, tan, exp, ln, log, sqrt, abs, and helpers like pow(a,b), min(a,b), and max(a,b) are supported.
How do I choose hx and hy?
Start with 0.0001. If results change smoothly when you halve the steps, you are improving accuracy. If results become erratic, steps may be too small.
Why do I sometimes get NaN or INF?
NaN or INF can occur when the expression is undefined at sampled points, such as division by zero, sqrt of a negative, or logs of non-positive values.
Is fxy always equal to fyx?
For sufficiently smooth functions, the mixed partials match. Numerically, small differences can appear due to rounding and step choices, especially near non-smooth regions.
Can I use this for optimization workflows?
Yes. Second partials help approximate curvature and build Hessian-related insights. Validate step stability and avoid non-smooth points to keep numeric estimates reliable.