Home › Calculators › Tangent Line Calculator

Tangent Line Calculator

Type a function and an x-value to get the equation of the tangent line in slope-intercept and point-slope form, plus the normal line, the derivative and the slope. The graph shows the curve, both lines and the point of tangency.

Last updated:

Examples:

Use x as the variable: ^ for powers, sqrt, cbrt, ln, log, e^x, sin, cos, tan, sec, asin, atan, abs, pi. Write 2x or 3sin(x) freely. The point can be an expression like pi/3 or 1/2.

Tangent line y = 9x − 15
f(x)TangentNormal

Drag to pan, scroll to zoom. Tick Equal scale to see the normal line at a true right angle.

Step-by-step

    Linear approximation near the point

    Close to x₀ the tangent line L(x) is a good stand-in for f(x). The error grows as you move away.

    Advertisement
    Advertisement

    How to use the Tangent Line Calculator

    1. Type the function f(x), for example x^3 - 3x + 1, sin(x) or sqrt(x).
    2. Enter the x-value of the point of tangency. Expressions such as pi/6 or -1/2 are fine.
    3. Press Calculate tangent line (or Enter). The tangent and normal equations appear with the slope and the point.
    4. Check the graph: drag to pan, scroll or use + and − to zoom, and tick Equal scale for true right angles.
    5. Read the steps and the linear approximation table, then copy the equations if you need them.

    Tangent line formula

    The tangent line to y = f(x) at x = x₀ touches the curve at (x₀, f(x₀)) and has the same slope as the curve there:

    • Slope: m = f′(x₀)
    • Point-slope form: y − f(x₀) = f′(x₀)(x − x₀)
    • Slope-intercept form: y = mx + b, where b = f(x₀) − m·x₀
    • Normal line: y − f(x₀) = −(1/m)(x − x₀), or x = x₀ when m = 0

    Worked example

    Find the tangent to f(x) = x³ − 3x + 1 at x = 2. First f(2) = 8 − 6 + 1 = 3, so the point is (2, 3). The derivative is f′(x) = 3x² − 3, so the slope is f′(2) = 12 − 3 = 9. Point-slope form: y − 3 = 9(x − 2). Expanding gives y = 9x − 15. The normal line has slope −1/9: y = −x/9 + 29/9.

    Derivatives you will need most

    f(x)f′(x)Example tangent
    xⁿn·xⁿ⁻¹x² at x = 3: y = 6x − 9
    √x1 / (2√x)at x = 4: y = x/4 + 1
    eˣeˣat x = 0: y = x + 1
    ln x1 / xat x = 1: y = x − 1
    sin xcos xat x = 0: y = x
    cos x−sin xat x = 0: y = 1 (horizontal)
    1 / x−1 / x²at x = 1: y = −x + 2

    Tips

    • Trigonometric functions use radians, so the point π/4 should be typed as pi/4, not 45.
    • A horizontal tangent (slope 0) marks a stationary point: a local maximum, minimum or a flat inflection.
    • If you are given a slope instead of a point, set f′(x) equal to that slope, solve for x, then use this calculator at each solution.
    • For curves defined by an equation in x and y, such as a circle, use implicit differentiation to get the slope first.

    Frequently asked questions

    How do you find the equation of a tangent line?

    Evaluate the function at the point to get y₀ = f(x₀), differentiate to get the slope m = f′(x₀), and plug both into the point-slope form y − y₀ = m(x − x₀). Rearranging gives y = mx + b with b = y₀ − m·x₀.

    What is the normal line?

    The normal line passes through the same point but is perpendicular to the tangent. Its slope is the negative reciprocal −1/m. If the tangent is horizontal (m = 0), the normal line is vertical, x = x₀.

    What does the slope of the tangent line mean?

    It is the instantaneous rate of change of the function at that point, which is exactly the derivative f′(x₀). A positive slope means the function is increasing there, a negative slope means it is decreasing, and zero marks a possible maximum or minimum.

    When does a function have a vertical tangent?

    When the graph is continuous but the derivative grows without bound at the point, such as f(x) = ∛x at x = 0. The tangent line is then x = x₀ and its slope is undefined. The calculator detects this case.

    Why does it say there is no tangent line?

    At a corner or cusp, like |x| at x = 0, the slopes from the left and right are different, so no single line touches the graph there. The function is not differentiable at that point, and the tool shows both one-sided slopes.

    What is a linear approximation?

    Near x₀ the tangent line L(x) = f(x₀) + f′(x₀)(x − x₀) is close to the curve, so it can estimate values. For example, the tangent to √x at x = 4 is L(x) = x/4 + 1, which gives √4.1 ≈ 2.025 (the true value is 2.0248…). The table shows how the error grows with distance.

    Which functions can I enter?

    Polynomials, fractions, powers and roots (sqrt, cbrt, x^(1/3)), exponentials (e^x, 2^x), logarithms (ln, log), trigonometric and inverse trigonometric functions, hyperbolic functions and abs. Angles are in radians.

    Are all the tools on FreeToolCabin tested for quality and accuracy?

    Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

    Related tools

    Derivative CalculatorSymbolic derivative of any f(x) up to 5th order, with steps, slope at a point and a graph.Implicit Differentiation CalculatorFind dy/dx for any equation in x and y with steps, plus the slope and tangent at a point.Point Slope Form CalculatorLine equation in point-slope form from a point and slope or two points, plus y = mx + b.Slope Intercept Form CalculatorGet y = mx + b from two points, a point and slope, or standard form, with steps and a graph.Roofing Calculator (Roof Squares)Estimate roof area, squares, shingle bundles and cost from pitch.Square Root CalculatorFind square, cube and nth roots with simplified radical form and steps.Body Surface Area CalculatorCalculate body surface area in m² with the Du Bois, Mosteller, Haycock and other formulas.Pythagorean Theorem CalculatorSolve for the hypotenuse or a missing leg of a right triangle, with a diagram and steps.Area CalculatorFind the area of squares, rectangles, triangles, circles, trapezoids, ellipses and sectors.Volume CalculatorVolume of a cube, box, cylinder, sphere, cone, pyramid or capsule, in liters and gallons too.Surface Area CalculatorSurface area of a cube, box, cylinder, sphere, cone or pyramid, with lateral and base areas.Circle CalculatorEnter a circle's radius, diameter, circumference or area and get all the others.Triangle CalculatorSolve any triangle from SSS, SAS, ASA, AAS or right-triangle values: sides, angles, area, type.Slope CalculatorSlope, angle, line equation y = mx + b and distance from two points, with a graph.Midpoint CalculatorFind the midpoint of two points in 2D or 3D, or the missing endpoint from a midpoint.Distance Formula CalculatorDistance between two points in 2D or 3D with step-by-step work and an exact radical answer.Vector Calculator2D and 3D vectors: add, subtract, dot and cross product, magnitude, angle, unit vector, projection.Pascal's Triangle GeneratorGenerate Pascal's triangle up to row 30, highlight a row and expand (ax + by)ⁿ.Trigonometry CalculatorSin, cos, tan, csc, sec, cot and inverses in degrees or radians, with exact values.Arc Length CalculatorArc length, sector area and chord from radius and angle, or solve for the radius or angle.Cylinder Volume CalculatorCylinder volume in liters, gallons and cubic units from radius or diameter, plus surface area.Regular Polygon CalculatorArea, perimeter, apothem, radius and angles of a regular polygon from any one measurement.Aquarium Volume CalculatorFish tank gallons, liters and water weight: rectangle, cylinder, bow-front and hexagon tanks.Tank Volume CalculatorTotal and filled volume of cylinder, rectangular and capsule tanks in gallons and liters.Circle Skirt CalculatorWaist radius, fabric yardage and cutting layout for full, half or quarter circle skirts.Ellipse CalculatorArea, perimeter (Ramanujan), eccentricity, foci and equation of an ellipse from its axes.Camera Field of View CalculatorAngle of view and frame size from focal length, sensor size and subject distance.Law of Sines and Cosines CalculatorSolve SSS, SAS, ASA, AAS and SSA triangles with the laws of sines and cosines, steps shown.Miter Angle CalculatorMiter saw angle for any polygon or corner, plus crown molding miter and bevel settings.Simplify Square Root CalculatorSimplify square, cube and nth roots to simplest radical form a√b, with steps.Interactive Unit CircleDrag an angle on the unit circle to see degrees, radians and exact sin, cos and tan. Printable chart.Cone Volume CalculatorVolume, slant height and surface area of a right cone from its radius and height.Perimeter CalculatorPerimeter of a square, rectangle, triangle, circle, trapezoid, polygon or sector, with a diagram.Polar to Cartesian ConverterConvert polar coordinates (r, θ) to rectangular (x, y) with steps, a plot and bulk lists.Right Triangle CalculatorSolve a right triangle from any two values: sides, angles, area, perimeter and altitude.Sphere Volume CalculatorVolume and surface area of a sphere from radius, diameter or circumference, or the reverse.Trapezoid Area CalculatorArea, perimeter, median and missing base or height of a trapezoid, with a diagram.30-60-90 Triangle CalculatorEnter one side of a 30-60-90 triangle to get the other sides, area and perimeter in exact radical form.Coterminal Angle CalculatorList positive and negative coterminal angles and the principal angle, in degrees and radians.Heron's Formula CalculatorFind a triangle's area from its three sides with Heron's formula, semi-perimeter and steps.Inverse Trig Calculatorarcsin, arccos, arctan, arcsec, arccsc and arccot in degrees and radians, with exact values.Polygon Area from CoordinatesArea, perimeter and centroid of any polygon from its vertex coordinates (shoelace formula).Reference Angle CalculatorFind the reference angle and quadrant of any angle in degrees or radians, with a unit circle sketch.45-45-90 Triangle CalculatorSolve an isosceles right triangle from a leg or hypotenuse, with sides in exact √2 form.Complementary and Supplementary Angle CalculatorComplement, supplement and explement of any angle in degrees or radians, with diagrams.Coordinate Plane PlotterPlot points, segments and polygons on an interactive coordinate grid, or print blank planes.
    See all 46 Geometry & Trigonometry Calculators →