Tangent Line Calculator

The tangent line to a curve at a point is the straight line that best approximates the curve right at that point. It touches the curve without crossing it (for smooth functions) and has exactly the same slope as the curve at the point of contact. That slope is the derivative of the function, and finding it is the central task of differential calculus. Tangent lines matter practically because they let you approximate complex function values using simple linear arithmetic, they define the direction of motion for a moving object, and they form the basis of Newton's method for finding roots. This calculator takes any function of x written in standard notation, such as x^2, and an x value at which to find the tangent. It returns the slope of the tangent (which equals the derivative at that point), the complete tangent line equation in y = mx + c form, the coordinates of the point of tangency, and the normal line equation for the perpendicular line at the same point. Slope is computed by central difference numerical differentiation with h = 1e-7, giving highly accurate results for smooth functions. Use standard operators +, -, *, / and ^ for powers, plus functions like sin, cos, tan, exp, log, sqrt, and abs. The default example uses f(x) = x^2 at x = 2, giving slope = 4 and tangent y = 4x - 4.

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
4.00
slope of tangent (derivative at x)
Tangent liney = 4x - 4
Point (x, f(x))(2.00, 4.00)
Normal liney = -0.25x + 4.50

Slope uses central difference numerical differentiation. Use ^ for powers and * for multiplication.

How it works

The derivative (slope of the tangent) is estimated by central difference: f'(x) is approximately (f(x+h) - f(x-h)) / (2h) with h = 1e-7. The function value f(x) is the y coordinate of the point of tangency. The tangent line equation uses point-slope form: y = slope * x + (f(x) - slope * x), giving the y-intercept c. The normal line is perpendicular with slope = -1/slope (or described as a vertical line if the tangent is horizontal). Positive c is shown as y = mx + c; negative c is shown as y = mx - |c|.

Worked example

For f(x) = x^2 at x = 2: the function value is f(2) = 4, so the point of tangency is (2.00, 4.00). The derivative is f'(x) = 2x, so f'(2) = 4. The tangent line equation is y = 4x + (4 - 4 * 2) = y = 4x - 4. The normal slope is -1/4 = -0.25 and the normal line is y = -0.25x + (4 + 0.25 * 2) = y = -0.25x + 4.50. 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.