Linear and Quadratic Functions

Study constant-rate and curved models through slope, intercepts, roots, vertices, and parameters.

Learning objectives

After this lesson you should be able to:

  • interpret slope as constant rate of change;
  • construct a line from slope-intercept form, point-slope form, or two points;
  • identify linear model parameters in context;
  • move among standard, factored, and vertex forms of a quadratic;
  • use the discriminant to predict the number and type of real roots;
  • read roots, intercepts, vertex, and axis of symmetry from a quadratic graph.

Motivation

Linear and quadratic functions are the first two major modeling families.

Linear functions model constant change:

f(x) = mx + b

Quadratic functions model a rate of change that changes linearly:

f(x) = ax^2 + bx + c

They appear everywhere: cost models, trend lines, projectile motion, least squares, optimization, Taylor approximations, and numerical algorithms.

Linear functions: constant rate of change

A linear function has the form:

y = mx + b

where:

  • m is the slope;
  • b is the y-intercept;
  • the graph is a line.

Slope is change in output divided by change in input:

m = (change in y)/(change in x)

If a line passes through (0, 1) and (2, 5), then:

m = (5 - 1)/(2 - 0) = 2

The y-intercept is 1, so the line is:

y = 2x + 1

\(\displaystyle 2 x + 1\)

Visualizing slope and intercept

The point (3, 7) lies on the line. Moving one unit to the right increases the output by 2, because the slope is 2.

Linear modeling

Suppose a service costs a fixed setup fee of $25 plus $8 per hour. If h is the number of hours, the cost is:

C(h) = 8h + 25

Interpretation:

  • slope 8: each additional hour increases cost by $8;
  • intercept 25: the cost when h = 0.

In applied work, interpreting parameters is often more important than only plotting the line.

Quadratic functions

A quadratic function has degree 2:

f(x) = ax^2 + bx + c, where a != 0

Its graph is a parabola.

The sign of a determines whether the parabola opens up or down:

  • a > 0: opens upward;
  • a < 0: opens downward.

The magnitude of a affects width:

  • larger |a|: narrower;
  • smaller |a|: wider.

Three useful forms

Quadratics often appear in three forms.

Standard form

f(x) = ax^2 + bx + c

This makes the y-intercept visible: f(0)=c.

Factored form

f(x) = a(x-r1)(x-r2)

This makes roots visible: x = r1 and x = r2.

Vertex form

f(x) = a(x-h)^2 + k

This makes the vertex visible: (h, k).

Vertex and discriminant

For:

f(x) = ax^2 + bx + c

the vertex x-coordinate is:

h = -b/(2a)

The discriminant is:

D = b^2 - 4ac

It tells us how many real roots exist:

Discriminant Real roots Graph behavior
D > 0 two crosses the x-axis twice
D = 0 one repeated touches the x-axis at the vertex
D < 0 none does not cross the x-axis
(x**2 - 4*x + 3, 4, (2, -1), (1, 3))

Comparing quadratic parameters

Converting vertex form to standard form

The vertex form:

2(x - 3)^2 + 1

has vertex (3, 1) and opens upward. Expanding:

\(\displaystyle 2 x^{2} - 12 x + 19\)

So:

2(x - 3)^2 + 1 = 2x^2 - 12x + 19

Worked examples

Example 1: line from two points

Find the line through (1, 4) and (3, 10).

Slope:

m = (10 - 4)/(3 - 1) = 3

Use y = mx + b with point (1, 4):

4 = 3(1) + b
b = 1

Therefore:

y = 3x + 1

Example 2: solve a quadratic by factoring

Solve:

x^2 - 5x + 6 = 0

Factor:

(x - 2)(x - 3) = 0

So:

x = 2 or x = 3

Example 3: read the vertex

For:

f(x) = -2(x + 1)^2 + 5

the vertex is (-1, 5), and the parabola opens downward because a = -2.

Common mistakes

Treating the intercept as the slope

In y = 2x + 5, the slope is 2; the y-intercept is 5.

Forgetting that horizontal shifts look reversed

The vertex form (x - 3)^2 shifts right by 3, not left.

Assuming every quadratic has two real roots

If the discriminant is negative, the roots are complex and the real graph does not cross the x-axis.

Practice

  1. Find the slope of the line through (0, 2) and (4, 10).
  2. Find the equation of the line through (0, -3) with slope 5.
  3. Interpret the slope and intercept of C(h)=12h+40.
  4. Convert 3(x - 2)^2 - 1 to standard form.
  5. Find the vertex of f(x)=x^2 - 6x + 8.
  6. Find the roots of x^2 - 6x + 8.
  7. Compute the discriminant of 2x^2 + 4x + 5.
  8. Does 2x^2 + 4x + 5 have real roots?
  9. Write a quadratic with roots -1 and 4.
  10. Challenge: explain why the vertex x-coordinate is halfway between two real roots when a quadratic has two real roots.

Solutions

m = (10 - 2)/(4 - 0) = 8/4 = 2.

The y-intercept is -3, so the line is y = 5x - 3.

The slope 12 means each additional hour adds $12. The intercept 40 is the fixed starting cost.

3(x - 2)^2 - 1 = 3(x^2 - 4x + 4) - 1 = 3x^2 - 12x + 11.

For a=1 and b=-6, the vertex x-coordinate is -b/(2a)=3. Then f(3)=9-18+8=-1. The vertex is (3, -1).

x^2 - 6x + 8 = (x - 2)(x - 4), so the roots are 2 and 4.

D = b^2 - 4ac = 4^2 - 4(2)(5) = 16 - 40 = -24.

No. The discriminant is negative, so there are no real roots.

One answer is (x + 1)(x - 4), or expanded: x^2 - 3x - 4.

In factored form a(x-r1)(x-r2), the graph is symmetric around the axis halfway between the roots. The vertex lies on this axis, so its x-coordinate is (r1+r2)/2.

Why this matters later

  • Calculus: lines approximate functions locally; quadratics model curvature.
  • Statistics: linear regression fits lines to data.
  • Optimization: many first optimization examples reduce to finding a quadratic vertex.
  • Numerical methods: local polynomial approximations are central tools.

Subtopic guided practice and checkpoints

Linear functions tell constant-rate stories. Quadratic functions tell turning point stories. Use each form for the feature it reveals.

Lab 1: slope and intercept

Guess first. For y = -3x + 8, does the line rise or fall from left to right?

Guided exercise.

The slope is -3, so each time x increases by 1, y decreases by 3. The y-intercept is 8, so the graph crosses the y-axis at (0, 8).

Checkpoint. For y = (1/2)x - 4, identify the slope, y-intercept, and two points on the line.

Lab 2: build a line from two points

Guess first. Through (1, 5) and (4, 11), is the slope positive, negative, or zero?

Guided exercise.

m = (11 - 5)/(4 - 1) = 6/3 = 2
y - 5 = 2(x - 1)             point-slope form
y - 5 = 2x - 2
y = 2x + 3                   slope-intercept form

Checkpoint. Find the equation of the line through (-2, 1) and (2, 9). Check that both points satisfy your equation.

Lab 3: solve a quadratic by factoring

Guess first. For x^2 - 7x + 12 = 0, which pair of numbers multiplies to 12 and adds to -7?

Guided exercise.

x^2 - 7x + 12 = 0
(x - 3)(x - 4) = 0       factor
x - 3 = 0 or x - 4 = 0   zero-product property
x = 3 or x = 4

Checkpoint. Solve x^2 - 9x + 20 = 0 by factoring. Then check both roots in the original equation.

Lab 4: vertex form and the discriminant

Guess first. Does y = 2(x + 1)^2 - 8 open up or down? Where is its vertex?

Guided exercise.

In y = a(x - h)^2 + k, the vertex is (h, k). Here a = 2, h = -1, and k = -8, so the vertex is (-1, -8) and the parabola opens up.

For standard form ax^2 + bx + c, the discriminant b^2 - 4ac predicts real roots:

positive: two real roots
zero: one repeated real root
negative: no real roots

Checkpoint. For y = x^2 + 6x + 10, compute the discriminant and explain how many real x-intercepts the graph has.

Guessing game checkpoint

Before moving to the Python/SymPy appendix, practice the core moves from this lesson. This short quiz may show an expression, graph, equation, solution set, or description and ask you to choose the matching mathematical object.

Using this lesson with edumath and SymPy

Use edumath’s parser and solver to check equation-solving steps, then connect the answer back to the graph.

from edumath.core import parse_equation
from edumath.solvers import solve_equation_steps

quadratic_solution = solve_equation_steps(parse_equation("x^2 - 7x + 12 = 0"))
print(quadratic_solution.render_text())
Answer: x ∈ {3, 4}

Method: quadratic equation

Steps:

1. Original equation:
Eq(x**2 - 7*x + 12, 0)

2. Write in standard form:
Eq(x**2 - 7*x + 12, 0)
A quadratic equation is easiest to solve from ax^2 + bx + c = 0.

3. Factor:
Eq((x - 4)*(x - 3), 0)

4. Use the zero-product property:
x = 3, x = 4
If a product is zero, at least one factor must be zero.

Check:

x = 3: valid

x = 4: valid

Use the package helpers to compute line and quadratic facts exactly, then compare those facts with the graph you sketch by hand.

from edumath.algebra import QuadraticModel, line_from_points

line = line_from_points((0, 1), (2, 5))
line.expression

\(\displaystyle 2 x + 1\)

model = QuadraticModel(1, -4, 3)
model.expression, model.discriminant, model.vertex, model.roots
(x**2 - 4*x + 3, 4, (2, -1), (1, 3))

Further reading