This calculator finds the numerical derivative of any mathematical function at a point you choose, using the central difference method. The derivative of a function at a point tells you the instantaneous rate of change at that exact location on the curve: how steeply the function is rising or falling, and in which direction. In formal terms it is the slope of the tangent line to the graph of f(x) at x equals your chosen value. Rather than finding a symbolic formula for the derivative (which requires algebraic manipulation), numerical differentiation evaluates the function at two nearby points and divides the change in output by the change in input. The central difference method is the most accurate simple approach: it evaluates f at x plus a tiny step h and at x minus the same step, then computes (f(x+h) minus f(x-h)) divided by 2h. This calculator uses h equal to 0.0000001, giving results accurate to roughly six decimal places for most smooth functions. You type the function using standard maths notation (for example x*x+3*x, sin(x)*cos(x) or exp(-x*x)), enter the point x where you want the derivative, and the result appears instantly. Supported functions include sin, cos, tan, log (natural logarithm), exp, sqrt, abs and pow. The tool is aimed at calculus students, engineers checking gradient values, and data analysts looking at the rate of change of a modelled curve. Results are numerical approximations only; they may be less accurate near sharp discontinuities or where the function is undefined at or near the chosen point.
Type expressions using * for multiply, pow(x,n) or x*x for powers, and standard Math functions: sin, cos, tan, log, exp, sqrt.
The central difference formula is f′(x) = (f(x + h) − f(x − h)) / (2h). With a step size h of 0.0000001, the truncation error is proportional to h squared, making this method far more accurate than the simple forward difference formula for the same step size. The function you enter is evaluated using JavaScript's Function constructor with the Math library in scope, so you can use any expression that a JS Math object supports. If your expression contains a syntax error or evaluates to a non-finite number, the calculator shows an error message rather than an incorrect result.
Set f(x) to x*x+3*x and x to 2. The true derivative of x squared plus 3x is 2x plus 3, so at x equals 2 the exact answer is 7. The calculator evaluates f(2.0000001) and f(1.9999999), divides their difference by 2 times 0.0000001, and returns 7.000000, matching the exact result. f(2) itself equals 4 + 6 = 10.000000. These match the default values pre-filled in the calculator above.
If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.
Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.
Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.
All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.
Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.
Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.
Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.
All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.
About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use
Reviewed and maintained. Last reviewed 2026-07-02 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.
© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.