Partial Derivative Calculator

A partial derivative tells you how a function of two variables changes when you move along just one of those variables while holding the other fixed. If you have a surface defined by z = f(x, y), the partial derivative with respect to x gives you the slope of that surface in the x direction at a specific point, and the partial derivative with respect to y gives the slope in the y direction. Together they form the gradient vector, which points in the direction of steepest ascent on the surface. Partial derivatives appear throughout multivariable calculus, mathematical physics, engineering optimisation, and machine learning, where gradients are used to train models by descending a loss surface. This calculator takes a function of x and y written in standard notation, for example x^2 + 3*x*y, and a point (x, y) at which to evaluate it. It returns df/dx, df/dy, the gradient vector as an ordered pair, and the mixed second partial d2f/dxdy. Calculations use central difference numerical differentiation, which is accurate to around twelve significant figures for smooth functions. You can use standard operators: +, -, *, /, and ^ for powers, along with Math functions such as sin, cos, exp, log, sqrt, and abs. Enter the function and the point below to see all four results instantly.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner: Health Based Building
7.00
df/dx at (x, y)
df/dy6.00
Gradient vector(7.00, 6.00)
d2f/dxdy3.00
f(x, y)10.00

Numerical results use central difference with h = 1e-7. Use * for multiplication and ^ for powers.

How it works

The calculator evaluates your function using JavaScript's Function constructor, which allows standard Math operations without any external library. The partial derivative with respect to x uses central difference: df/dx is approximately (f(x+h, y) minus f(x-h, y)) divided by 2h, with h = 1e-7. The same method applies in the y direction to find df/dy. The mixed partial d2f/dxdy is found by applying the central difference formula in x to the df/dy values evaluated at x+h and x-h. The gradient vector collects (df/dx, df/dy) into an ordered pair, and f(x, y) is the function value at the given point.

Worked example

For f(x, y) = x^2 + 3*x*y at the point x = 2, y = 1: differentiating with respect to x gives df/dx = 2x + 3y, which at (2, 1) equals 2(2) + 3(1) = 7.00. Differentiating with respect to y gives df/dy = 3x, which at (2, 1) equals 3(2) = 6.00. The gradient vector is (7.00, 6.00), the mixed partial d2f/dxdy = 3.00, and f(2, 1) = 4 + 6 = 10.00. These match the defaults pre-filled above.

Related calculators

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-19 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.