Algebra

Linear vs. Nonlinear Functions

Last updated: March 2026 · Intermediate
Before you start

You should be comfortable with:

Real-world applications
πŸ’°
Retail & Finance

Discounts, tax, tips, profit margins

πŸ’Š
Nursing

Medication dosages, IV drip rates, vital monitoring

Not all functions behave the same way. Some grow at a constant, steady pace β€” the same amount of change for every step. Others speed up, slow down, or curve in unpredictable ways. The first group is called linear functions, and the second is nonlinear functions. Learning to tell them apart is one of the most important skills in algebra because the tools you use to analyze them are completely different.

What Makes a Function Linear?

A function is linear if it has a constant rate of change. That means for every equal increase in the input, the output changes by the same amount β€” always. This constant rate of change is the slope.

Algebraically, a linear function can always be written in the form:

f(x)=mx+bf(x) = mx + b

where mm is the slope (rate of change) and bb is the yy-intercept.

Three identifying features of linear functions:

  1. Equation: The highest power of xx is 1 (no x2x^2, x3x^3, x\sqrt{x}, etc.)
  2. Graph: A straight line
  3. Table: Constant first differences (explained below)

What Makes a Function Nonlinear?

A function is nonlinear if its rate of change is not constant. Common types include:

  • Quadratic: f(x)=x2f(x) = x^2 β€” rate of change increases as xx increases
  • Exponential: f(x)=2xf(x) = 2^x β€” rate of change grows multiplicatively
  • Square root: f(x)=xf(x) = \sqrt{x} β€” rate of change decreases as xx increases
  • Absolute value: f(x)=∣x∣f(x) = |x| β€” has a sharp corner; rate of change switches abruptly

Nonlinear graphs are curves (or lines with corners), not straight lines.

Identifying from Equations

Look at the highest power of xx and the operations applied to it.

Example 1: Is f(x)=3xβˆ’7f(x) = 3x - 7 linear or nonlinear?

The highest power of xx is 1. No squares, cubes, roots, or absolute values.

Answer: Linear (slope m=3m = 3, yy-intercept b=βˆ’7b = -7).

Example 2: Is g(x)=x2+4xβˆ’1g(x) = x^2 + 4x - 1 linear or nonlinear?

The term x2x^2 means the highest power of xx is 2.

Answer: Nonlinear β€” this is a quadratic function.

Example 3: Is h(x)=5xh(x) = \dfrac{5}{x} linear or nonlinear?

Rewrite as h(x)=5xβˆ’1h(x) = 5x^{-1}. The exponent βˆ’1-1 is not 1.

Answer: Nonlinear β€” this is a rational function.

Example 4: Is f(x)=8f(x) = 8 linear or nonlinear?

This can be written as f(x)=0β‹…x+8f(x) = 0 \cdot x + 8. The highest power of xx present is technically 0 (a constant), but this is still considered linear β€” it is a horizontal line with slope 0.

Answer: Linear (a special case called a constant function).

Identifying from Tables: The First Differences Method

The first differences are the changes in the output (yy-values) between consecutive rows when the xx-values increase by equal steps.

If all first differences are equal, the function is linear.

Example 5: Linear table

xxf(x)f(x)First difference
0022β€”
11555βˆ’2=35 - 2 = 3
22888βˆ’5=38 - 5 = 3
33111111βˆ’8=311 - 8 = 3
44141414βˆ’11=314 - 11 = 3

Every first difference is 3. The rate of change is constant.

Answer: Linear, with slope m=3m = 3. The equation is f(x)=3x+2f(x) = 3x + 2.

Example 6: Nonlinear table

xxg(x)g(x)First difference
0011β€”
11222βˆ’1=12 - 1 = 1
22555βˆ’2=35 - 2 = 3
33101010βˆ’5=510 - 5 = 5
44171717βˆ’10=717 - 10 = 7

The first differences are 1, 3, 5, 7 β€” they are not constant. The rate of change increases.

Answer: Nonlinear. (In fact, this is g(x)=x2+1g(x) = x^2 + 1.)

Second Differences

For nonlinear tables, you can compute second differences β€” the differences of the first differences:

From Example 6: first differences are 1, 3, 5, 7. The second differences are:

3βˆ’1=2,5βˆ’3=2,7βˆ’5=23 - 1 = 2, \quad 5 - 3 = 2, \quad 7 - 5 = 2

Constant second differences of 2 confirm this is a quadratic function with a=22=1a = \dfrac{2}{2} = 1.

Rule of thumb:

  • Constant first differences β†’ linear
  • Constant second differences β†’ quadratic
  • Neither constant β†’ some other type of nonlinear function

Identifying from Graphs

Example 7: Straight line through (βˆ’1,βˆ’3)(-1, -3) and (2,3)(2, 3)

A straight line means constant slope. Compute:

m=3βˆ’(βˆ’3)2βˆ’(βˆ’1)=63=2m = \frac{3 - (-3)}{2 - (-1)} = \frac{6}{3} = 2

Answer: Linear.

Example 8: A curve that gets steeper as xx increases

If the graph is a curve β€” it bends β€” the function is nonlinear. A parabola, exponential curve, or any shape that is not a straight line means the rate of change is not constant.

Answer: Nonlinear.

Quick visual test: Place a straightedge (ruler) along the graph. If the entire graph lies along the straightedge, it is linear. If any part curves away, it is nonlinear.

Rate of Change Comparison

Let us compare a linear and a nonlinear function side by side to see the difference clearly.

Linear: f(x)=2x+1f(x) = 2x + 1 (constant rate of change = 2)

xxf(x)f(x)Change
0011β€”
1133+2+2
2255+2+2
3377+2+2

Nonlinear: g(x)=x2g(x) = x^2 (increasing rate of change)

xxg(x)g(x)Change
0000β€”
1111+1+1
2244+3+3
3399+5+5

For the linear function, each step adds 2. For the quadratic, the steps grow: 1, 3, 5. This accelerating growth is the hallmark of nonlinearity.

Real-World Application: Retail β€” Linear Cost vs. Nonlinear Revenue

A retail business has a cost function and a revenue function. Understanding whether each is linear or nonlinear is critical for making business decisions.

Cost function (linear): The business pays $500 per month in rent plus $8 per unit to produce each item:

C(n)=8n+500C(n) = 8n + 500

This is linear β€” every additional unit adds exactly $8 to the cost. The first differences are constant at 8.

Revenue with volume discount (nonlinear): Suppose the selling price drops as volume increases (bulk discount). Revenue might follow:

R(n)=20nβˆ’0.01n2R(n) = 20n - 0.01n^2

This is nonlinear β€” the n2n^2 term means revenue does not increase at a constant rate. At low volumes, revenue grows quickly; at high volumes, the discount effect slows growth and eventually causes revenue to decrease.

An owner checking a table of revenues would see first differences that shrink as nn increases β€” a clear sign of nonlinearity. This tells them they should not blindly extrapolate using a straight-line assumption.

Real-World Application: Nursing β€” Medication Decay

A nurse administers a medication, and the amount remaining in the patient’s bloodstream decreases over time. A simple linear model might say:

Alinear(t)=200βˆ’25tA_{\text{linear}}(t) = 200 - 25t

This predicts a loss of 25 mg each hour β€” constant rate of change, a straight line. But real medication decay is typically exponential (nonlinear):

Aactual(t)=200β‹…(0.85)tA_{\text{actual}}(t) = 200 \cdot (0.85)^t

Hours (tt)Linear modelExponential modelLinear changeExponential change
0200200.0β€”β€”
1175170.0βˆ’25-25βˆ’30.0-30.0
2150144.5βˆ’25-25βˆ’25.5-25.5
3125122.8βˆ’25-25βˆ’21.7-21.7
4100104.4βˆ’25-25βˆ’18.4-18.4

The linear model has constant first differences (βˆ’25-25 each time). The exponential model has first differences that change (βˆ’30,βˆ’25.5,βˆ’21.7,βˆ’18.4-30, -25.5, -21.7, -18.4) β€” the decay slows down as there is less medication left.

In practice, the exponential model is more accurate. Recognizing that real-world medication levels follow a nonlinear pattern helps nurses understand why dosing schedules are timed the way they are.

Common Mistakes to Avoid

  1. Assuming β€œnonlinear” means β€œno pattern.” Nonlinear functions absolutely follow patterns β€” they just are not straight-line patterns. Quadratic, exponential, and other nonlinear functions are highly predictable.
  2. Computing first differences with unequal xx-steps. The first differences method only works when the xx-values increase by equal amounts. If the steps are 1, 1, 2, 1, you cannot compare the differences directly.
  3. Concluding linearity from two points. Any two points can be connected by a straight line, so two data points are never enough to distinguish linear from nonlinear. You need at least three points.
  4. Forgetting that f(x)=bf(x) = b (a constant) is linear. A horizontal line has slope 0, but it is still a linear function β€” just a special one.
  5. Thinking the first differences must be positive. First differences can be negative (decreasing function) or zero (constant). What matters for linearity is that they are all the same value, not that they are positive.

Practice Problems

Test your understanding with these problems. Click to reveal each answer.

Problem 1: Is f(x)=βˆ’4x+9f(x) = -4x + 9 linear or nonlinear?

The highest power of xx is 1. This is in the form mx+bmx + b with m=βˆ’4m = -4 and b=9b = 9.

Answer: Linear.

Problem 2: Is g(x)=3x3βˆ’xg(x) = 3x^3 - x linear or nonlinear?

The term 3x33x^3 has degree 3, which is greater than 1.

Answer: Nonlinear (cubic function).

Problem 3: Use first differences to determine if this table is linear: (1, 6), (2, 10), (3, 14), (4, 18), (5, 22).

First differences: 10βˆ’6=410 - 6 = 4, 14βˆ’10=414 - 10 = 4, 18βˆ’14=418 - 14 = 4, 22βˆ’18=422 - 18 = 4. All equal to 4.

Answer: Linear, with slope m=4m = 4. The equation is y=4x+2y = 4x + 2.

Problem 4: Use first differences to determine if this table is linear: (0, 3), (1, 6), (2, 12), (3, 24), (4, 48).

First differences: 6βˆ’3=36 - 3 = 3, 12βˆ’6=612 - 6 = 6, 24βˆ’12=1224 - 12 = 12, 48βˆ’24=2448 - 24 = 24. These are not constant (3, 6, 12, 24). The outputs are doubling β€” this is exponential.

Answer: Nonlinear (exponential: y=3β‹…2xy = 3 \cdot 2^x).

Problem 5: A table has first differences of 2,2,2,22, 2, 2, 2 and second differences of 0,0,00, 0, 0. What type of function is it?

Constant first differences mean the function is linear. (The second differences being 0 is consistent β€” there is no curvature.)

Answer: Linear.

Problem 6: A nurse records drug amounts remaining: (0 hrs, 400 mg), (1 hr, 360 mg), (2 hrs, 324 mg), (3 hrs, 291.6 mg). Is the decay linear or nonlinear?

First differences: 360βˆ’400=βˆ’40360 - 400 = -40, 324βˆ’360=βˆ’36324 - 360 = -36, 291.6βˆ’324=βˆ’32.4291.6 - 324 = -32.4. The first differences (βˆ’40,βˆ’36,βˆ’32.4-40, -36, -32.4) are not constant.

Check the ratios: 360/400=0.9360/400 = 0.9, 324/360=0.9324/360 = 0.9, 291.6/324=0.9291.6/324 = 0.9. Constant ratio of 0.9 confirms exponential decay.

Answer: Nonlinear (exponential decay with a common ratio of 0.9).

Problem 7: A retail store tracks daily sales revenue over 5 days: $200, $200, $200, $200, $200. Is revenue as a function of day number linear?

First differences: 0,0,0,00, 0, 0, 0. All first differences are equal (all zero).

Answer: Yes, this is linear β€” it is a constant function: R(d)=200R(d) = 200.

Key Takeaways

  • A linear function has a constant rate of change, graphs as a straight line, and can be written as f(x)=mx+bf(x) = mx + b
  • A nonlinear function has a variable rate of change, graphs as a curve, and includes quadratics, exponentials, radicals, and more
  • First differences test: compute the changes in yy for equal steps in xx β€” if all differences are equal, the function is linear
  • Second differences that are constant indicate a quadratic function
  • You need at least three data points to distinguish linear from nonlinear
  • In real-world settings, recognizing linearity (or the lack of it) determines which algebraic tools and predictions are appropriate

Return to Algebra for more topics in this section.

Last updated: March 29, 2026