Tutorials › AP Calculus › Deriving the Derivative Function for X Squared

Derivative as a Limit · Tutorial 91 of 999

Deriving the Derivative Function for X Squared

Derive the derivative function for \(x^2\) from the limit definition, then verify it at specific inputs.

Beginner 8 min read

What You'll Learn

  • Set up the derivative limit at a general input \(x\) for \(f(x)=x^2\)
  • Expand and simplify the difference quotient while keeping the increment nonzero
  • Explain why the simplified quotient has a limit for every real \(x\)
  • State and interpret the resulting derivative function
  • Check the result at particular inputs using the original limit
  • Recognize errors caused by substituting a zero increment too early

From a Derivative at One Input to a Derivative Function

A derivative at a particular input gives the instantaneous rate of change there. The limit definition lets us calculate that rate from nearby secant slopes. For \(f(x)=x^2\), we can go further: instead of choosing one input first, we can keep the input as \(x\) and derive a formula that gives the derivative at every real number.

The key is to distinguish the input \(x\), which stays fixed while a limit is taken, from the increment \(h\), which approaches zero. Expanding the square produces a factor of \(h\) that can be cancelled for \(h\ne 0\). After that cancellation, the limit can be evaluated.

Definition: For a function \(f\), its derivative at an input \(x\), when the limit exists, is $$ f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}. $$ The quotient is defined for nonzero \(h\) for which the function values exist. The derivative function assigns to each input where this limit exists the resulting derivative value.

Deriving the Formula at a General Input

For \(f(x)=x^2\), the definition requires the function value at \(x+h\) and at \(x\). Since \(f(x+h)=(x+h)^2\) and \(f(x)=x^2\), substitute those expressions into the limit. The algebra must be done before taking the limit: the original quotient has denominator \(h\), so it is not defined at \(h=0\).

1
Write the definition.
Keep \(x\) fixed and let only \(h\) approach zero.
2
Substitute the function values.
Use \(f(x+h)=(x+h)^2\) and \(f(x)=x^2\).
3
Expand and simplify.
Combine like terms in the numerator, then factor and cancel \(h\), with \(h\ne 0\).
4
Take the limit.
The simplified expression has a finite limit as \(h\) approaches zero.

Here is the complete calculation. The condition \(h\ne 0\) applies to the quotient and to the cancellation step.

$$ \begin{aligned} f'(x) &=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\\ &=\lim_{h\to 0}\frac{(x+h)^2-x^2}{h}\\ &=\lim_{h\to 0}\frac{x^2+2xh+h^2-x^2}{h}\\ &=\lim_{h\to 0}\frac{2xh+h^2}{h}\\ &=\lim_{h\to 0}\frac{h(2x+h)}{h}\\ &=\lim_{h\to 0}(2x+h)\\ &=2x. \end{aligned} $$

The cancellation is valid for every nonzero \(h\), precisely the values used in the difference quotient. Once the quotient has been simplified to \(2x+h\), its limit as \(h\to0\) is \(2x\). This reasoning works for any fixed real \(x\), so the derivative exists at every real input.

Result: For \(f(x)=x^2\), the derivative function is $$ f'(x)=2x,\qquad x\in\mathbb{R}. $$ At each real input \(x\), the value \(2x\) is the derivative of \(f\) there.

Why the Algebra Produces a Limit

The difference quotient compares the change in function value with the change in input. For the square function, expanding \((x+h)^2\) reveals that the change in the function value is \(2xh+h^2\). Both terms contain \(h\), so the numerator is zero when \(h=0\), but for nonzero \(h\) it can be divided by \(h\). The resulting quotient is \(2x+h\).

As \(h\) becomes arbitrarily close to zero, the term \(h\) in this simplified expression becomes arbitrarily small, while \(2x\) stays fixed. Therefore the quotient approaches \(2x\). This explains both the algebraic method and why the limit is finite for every real input.

The input \(x\) is not being sent to zero in this calculation. It is an arbitrary but fixed number. The limit variable is \(h\). Keeping those roles separate is what allows one calculation to produce a whole derivative function, rather than only the derivative at a single chosen point.

Worked Examples: Checking the Derivative at Particular Inputs

Worked Example: Derivative at \(x=3\)

Use the limit definition directly at \(x=3\), then compare the result with the derivative function.

$$ \begin{aligned} f'(3) &=\lim_{h\to0}\frac{(3+h)^2-3^2}{h}\\ &=\lim_{h\to0}\frac{9+6h+h^2-9}{h}\\ &=\lim_{h\to0}\frac{6h+h^2}{h}\\ &=\lim_{h\to0}\frac{h(6+h)}{h}\\ &=\lim_{h\to0}(6+h)\\ &=6. \end{aligned} $$

The cancellation uses \(h\ne0\), as required for the difference quotient. Now check the result using the general formula: \(f'(3)=2(3)=6\). Both calculations give the same derivative value.

Worked Example: Derivative at \(x=-2\)

A negative input is handled by the same definition. Substitute \(-2\) for the fixed input and simplify carefully.

$$ \begin{aligned} f'(-2) &=\lim_{h\to0}\frac{(-2+h)^2-(-2)^2}{h}\\ &=\lim_{h\to0}\frac{4-4h+h^2-4}{h}\\ &=\lim_{h\to0}\frac{-4h+h^2}{h}\\ &=\lim_{h\to0}\frac{h(-4+h)}{h}\\ &=\lim_{h\to0}(-4+h)\\ &=-4. \end{aligned} $$

The general result checks this value: \(f'(-2)=2(-2)=-4\). Substituting \(-2\) into the derivative function agrees with the independently simplified limit.

Worked Example: Derivative at \(x=\frac12\)

Use the limit at a fractional input. This provides another check that the formula applies beyond integer inputs.

$$ \begin{aligned} f'\left(\frac12\right) &=\lim_{h\to0} \frac{\left(\frac12+h\right)^2-\left(\frac12\right)^2}{h}\\ &=\lim_{h\to0} \frac{\frac14+h+h^2-\frac14}{h}\\ &=\lim_{h\to0}\frac{h+h^2}{h}\\ &=\lim_{h\to0}\frac{h(1+h)}{h}\\ &=\lim_{h\to0}(1+h)\\ &=1. \end{aligned} $$

The derivative function gives \(f'(\frac12)=2(\frac12)=1\), matching the limit. In each example, the increment \(h\) remains nonzero during cancellation and approaches zero only after the quotient is simplified.

Common Mistake: Setting the Increment Equal to Zero Too Soon

A tempting but incorrect step is to substitute \(h=0\) into the original difference quotient. For example, at a general input the numerator and denominator would both become zero, producing \(0/0\). That expression is undefined; it is not the derivative and does not evaluate the limit.

$$ \text{Incorrect:}\qquad \frac{(x+0)^2-x^2}{0} = \frac{0}{0}. $$

The correction is to simplify the quotient for nonzero \(h\) first, then evaluate its limit. The factor \(h\) cancels only because the quotient is being considered where \(h\ne0\); the limit then examines what the simplified expression approaches as \(h\) tends to zero.

$$ \text{Correct:}\qquad \frac{(x+h)^2-x^2}{h} = \frac{h(2x+h)}{h} = 2x+h \quad (h\ne0), \qquad \lim_{h\to0}(2x+h)=2x. $$

Another useful check is to keep the roles of the symbols clear: \(x\) is the input where the derivative is being calculated, while \(h\) is the changing increment. Taking \(x\to0\) instead would answer a different question.

What the Derivative Function Tells Us

The formula \(f'(x)=2x\) gives a derivative value at every real input without repeating the limit calculation each time. For instance, at positive inputs the derivative values are positive, at \(x=0\) the derivative value is zero, and at negative inputs the derivative values are negative. These signs describe the instantaneous rate of change of \(x^2\) at those inputs.

This result is more than a collection of separate computations: the general-input calculation establishes the formula for all real \(x\). The limit definition is essential to that conclusion. It shows why the derivative exists at every input and where the factor \(2x\) comes from. The formula here is specific to \(x^2\); its derivation does not, by itself, establish a rule for differentiating other powers or other types of functions.

Key takeaway: To derive a derivative function from the limit definition, keep the input general, simplify the difference quotient while its increment is nonzero, and then take the limit. For \(f(x)=x^2\), this process gives \(f'(x)=2x\) for every real \(x\).

Check Your Understanding

For each question, keep the input and the increment in their correct roles. Show the algebra before taking the limit.

  1. Write the limit definition for \(f'(x)\) when \(f(x)=x^2\), and identify which symbol approaches zero.
  2. Expand \((x+h)^2-x^2\) and factor the resulting numerator.
  3. Why is it valid to cancel \(h\) in the difference quotient even though the limit is taken as \(h\to0\)?
  4. Use the derivative function to find \(f'(4)\), then state the corresponding calculation with the limit definition that you would use to check it.
  5. What is wrong with substituting \(h=0\) into the original difference quotient before simplifying?

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon