Tangent Line Calculator

The tangent line is the straight line that grazes a curve at a single point while matching its direction exactly, and this calculator finds its equation for any function at any point you choose. Enter a function of x and the x-value of the point, and it returns the equation of the tangent line in slope-intercept form, together with the slope, the y-intercept and the coordinates of the point of contact, updating as you type. The tangent line is one of the central ideas of calculus, because its slope is precisely the derivative of the function at that point, the instantaneous rate of change. That single fact is what makes derivatives so powerful: the tangent is the best possible straight-line approximation to the curve near the point, so close that for small steps you can use the line in place of the curve, which underlies everything from linear approximation to Newton's method for solving equations. To build the line, the calculator finds the function value at the point and the slope there, then writes the line as y equals the function value plus the slope times the distance from the point, before simplifying to the familiar y equals m x plus c. It accepts ordinary function notation, with the caret for powers and the usual sin, cos, sqrt, exp and ln, so you can find tangents to polynomials, roots, exponentials, trig functions and more. That makes it genuinely useful for calculus students learning derivatives and tangents and checking homework, and for anyone needing a linear approximation to a function at a point. Because the result updates live, you can slide the point along the curve and watch the tangent tilt to follow it. The method and a worked example are explained clearly below.

Calculate.co.nz is proud to be partnered with Premium Homes, a recognised leader in eco-friendly, sustainable, and energy-efficient homebuilding. With a dedicated team and award-winning experience, they create homes that prioritise health, comfort, and long-term performance. Their founders, Andrew and Kelly, set out to raise the standard of residential construction in New Zealand by combining practical building expertise with a clear commitment to doing things better for homeowners.
Calculate.co.nz partner
y = 0
tangent line
Slope (f ′(a))0
y-intercept0
Point0

Use x, ^ for powers, and functions like sin, cos, tan, sqrt, exp, ln. The slope is found numerically.

How it works

The calculator evaluates the function at the point to get f(a), and estimates the derivative f prime of a with a central difference, nudging x a tiny amount either side. The tangent line is y equals f(a) plus f prime of a times (x minus a). Multiplying out gives slope-intercept form, with slope equal to the derivative and y-intercept equal to f(a) minus the slope times a.

Worked example

For f(x) = x squared at x = 3: the function value is 9 and the derivative 2x is 6. The tangent is y = 9 plus 6 times (x minus 3), which simplifies to y = 6x minus 9. The slope is 6 and the y-intercept is minus 9.

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.

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

Reviewed and maintained. Last reviewed 2026-06-05 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.

© 2019 to 2026 Calculate.co.nz. All rights reserved.