Skip to content
Derivative Calculator
Resources

Tangents, secants and real-domain restrictions

A tangent and a secant can pass through the same point but have different slopes. I check which calculation the line represents: one point and a derivative for the tangent, two points and an average change for the secant.

How do I find a tangent line at a point?

A tangent at a differentiable point a has slope f′(a), and its equation is y = f(a)+f′(a)*(x−a). It uses the function value to locate the line and the first derivative to tilt it. Selecting a second derivative does not turn f″(a) into a tangent slope. Higher derivatives describe further changes and must be labelled separately.

The derivative calculator displays the function, first-derivative slope and selected-order value as separate values. The tangent always uses the first derivative, while the dashed violet curve follows the selected derivative order. I check those labels whenever I switch from finding a slope to studying concavity or a higher-order pattern.

What is the tangent line to x² at x = 2?

Take f(x) = x^2, a = 2 and h = 0.1. The function value is f(2) = 4. The power rule gives f′(x) = 2*x, so f′(2) = 4. Substituting into the tangent equation gives y = 4+4*(x−2), which is equivalent to y = 4*x−4. The tangent passes through (2,4), as it must.

The forward point is 2.1, where f(2.1) = 4.41. The forward secant slope is (4.41−4)/0.1 = 4.1. It joins (2,4) and (2.1,4.41), so its slope describes an average change over that interval rather than the instantaneous slope at its left endpoint. For a rising convex quadratic, this forward average is slightly larger than the tangent slope.

The backward value is f(1.9) = 3.61. A centered slope uses both sides: (4.41−3.61)/(2*0.1) = 4. For this quadratic the centered formula equals the exact derivative algebraically for every nonzero h. That special agreement does not mean every centered difference is exact; the next example shows its remaining error.

A quadratic curve with tangent and secant
The illustration uses h = 0.8 so the tangent and secant can be distinguished; the numerical example above uses h = 0.1. Both use a = 2 and f(x) = x^2.

Can a horizontal tangent have a nonzero secant slope?

For f(x) = x^3−3*x at a = 1, the function value is −2. The derivative is 3*x^2−3, so f′(1) = 0 and the tangent is horizontal: y = −2. With h = 0.1, f(1.1) = −1.969. The forward slope is (−1.969−(−2))/0.1 = 0.31, even though the tangent slope is zero.

The backward value f(0.9) is −1.971. The centered slope is (−1.969−(−1.971))/0.2 = 0.01. Expansion gives a centered slope of h^2 for this specific cubic at a = 1; the forward slope is 3*h+h^2. These formulas explain why both estimates approach zero as h shrinks and why they do so at different rates.

I compare h = 0.1, 0.01 and 0.001 when examining this example. The centered values are 0.01, 0.0001 and 0.000001 before floating-point error. The forward values are 0.31, 0.0301 and 0.003001. Those differences are expected truncation error, not evidence that the symbolic derivative is wrong. Near zero slopes, absolute error is more meaningful than dividing by the exact derivative.

Does simplification change the original domain?

Consider f(x) = x/x. Away from zero, it is equal to 1 and its derivative is zero. At zero, however, the original expression is undefined. Cancelling the x terms does not fill in the missing point. The calculator retains the original expression as a domain check, so it reports no function or derivative value there rather than silently evaluating the simplified constant.

The quotient (x^2−1)/(x−1) similarly equals x+1 where x ≠ 1, but it has a hole at x = 1. Its derivative is 1 on its domain. You can define a new extended function by assigning the missing value 2, but that is a deliberate change to the function. I do not assume an extension merely because a simplified formula makes it convenient.

Logarithms and square roots introduce different restrictions. Ln(x) needs x > 0. Sqrt(x) has a real function value at x = 0 but no finite derivative there. Abs(x) is defined at zero yet has unequal one-sided slopes, −1 and 1. An unavailable derivative can therefore arise from a missing function value, an infinite slope or incompatible one-sided behaviour.

Does an unavailable formula mean no derivative exists?

There is another reason for an unavailable numerical derivative: the unsimplified chain formula may contain a removable exception. Sqrt(x^4) equals x^2 for every real x, so its derivative at zero exists and equals zero. A mechanically generated expression containing x^3/sqrt(x^4) would be undefined at zero. The calculator avoids that removable exception by applying the real identity sqrt(x^4) = x^2 before differentiating. It shows this transformation in the steps, returns slope 0 at zero and draws the horizontal tangent there.

The local engine deliberately checks the original expression and each derivative stage before evaluating a selected order. This guards against erased holes, but it can still report unavailable for other removable intermediate formula exceptions. I treat that label as a prompt to analyze the limit or rewrite the function with justified domain-preserving algebra, not as a universal proof of nondifferentiability.

Numerical differences can suggest what a removable limit should be, but they cannot settle every question. For abs(x) at zero, the centered difference is zero for symmetric intervals even though no derivative exists. A reassuring centered number is therefore insufficient. Check one-sided behaviour and the definition whenever the point is a cusp, endpoint or suspect cancellation.

Can a graph prove that a derivative exists?

The graph uses a finite number of x samples, chooses a useful vertical range and breaks detected gaps or steep jumps. Midpoint checks reduce the chance of joining curves across a pole, but no finite sampling method guarantees finding every discontinuity in every expression. A narrow feature can lie between samples, and large values near a pole may be cropped.

For tan(x), the numerical evaluator treats |cos(x)| below 10^−14 as unavailable. This software tolerance helps handle approximations to odd multiples of pi/2; it is not a new mathematical domain rule. Panning or zooming changes the sampled points, so a visually continuous curve should never replace an exact denominator or argument check.

Use the point table as an accessible numerical view, and export its six rows as CSV when comparing h values. PNG preserves the current picture; copying the report preserves the expression, variable, derivative order and limitations. Save a calculation explicitly if you want to return to it. Device history is optional and remains local rather than being uploaded.

How do I check my tangent line calculation?

I follow the steps below before presenting a tangent equation. The order matters: a slope calculation cannot repair a point outside the original domain. If an expression has parameters, their assigned values also belong to the problem statement; leaving them unspecified does not justify treating them as zero.

The standard derivative rules are described in OpenStax Calculus, with logarithm restrictions discussed in its exponential and logarithmic derivatives section. For mistakes that happen before the calculus begins, read Chain rule and parentheses. For repeated differentiation or functions with parameters, read Higher and partial derivatives.

  1. Inspect the original expression and its grouping.
  2. Identify the real domain and assign any parameters.
  3. Apply the appropriate rules, including every chain factor.
  4. Evaluate the function and first derivative at a valid point.
  5. Compare one-sided and centered changes without treating them as proof.
hForward slope, cubic at 1Centered slope
0.10.310.01
0.010.03010.0001
0.0010.0030010.000001

Quick answers

Can a centered difference be zero at a cusp?

Yes. For abs(x) at zero it is zero on symmetric intervals, despite unequal one-sided slopes. A centered value alone does not prove differentiability.

Can simplification fill a hole?

No. A simplified formula retains the original domain unless you deliberately define a new extended function.

Does unavailable always mean no derivative exists?

No. It may reflect a missing function value, a missing parameter or a removable exception in an intermediate derivative formula. Analyze the domain and limit separately.

Use the derivative calculator now

Keep reading