Sub topic 6
Standard form: Ax + By = C
This chapter assumes you can plot points, find slope as rise over run, work with y = mx + b, solve a linear equation for one variable, and do arithmetic with fractions and negative numbers. You will learn what standard form requires, how to reach it from the other forms, and what it shows about a line.
What standard form says
A line is in standard form when it is written as
Ax + By = C
with these conventions:
- A, B and C are integers, so there are no fractions or decimals.
- A is not negative. If A is 0, then B is positive.
- A, B and C have no common factor greater than 1.
- A and B are not both zero.
The last three conventions give each line exactly one standard form. Without them, 2x - y = -1, 4x - 2y = -2 and -2x + y = 1 would all look like different equations, although they describe the same line.
| Equation | In standard form? | Reason |
|---|---|---|
| 2x - y = -1 | Yes | Integers, A is positive, no common factor |
| -2x + y = 1 | No | A is negative |
| 4x - 2y = -2 | No | Common factor 2 |
| x/2 + y = 3 | No | Contains a fraction |
| y = 2x + 1 | No | The variables are not both on the left |
Textbooks differ on small details, such as whether to insist on a positive A. Use the convention your course states. This chapter uses the one above.
Reaching standard form
The procedure is the same from any starting form:
- Collect the x term and the y term on the left and the constant on the right.
- Multiply through by the least common denominator to clear fractions.
- Divide by the greatest common factor of A, B and C.
- If A is negative, multiply the whole equation by -1.
From point-slope form
Start with y - 3 = 2(x - 1).
- Distribute: y - 3 = 2x - 2.
- Move the x term left and the constant right: -2x + y = 1.
- There are no fractions and no common factor.
- A is -2, so multiply by -1: 2x - y = -1.
From slope-intercept form with a fraction
Start with y = (2/3)x - 4.
- Multiply by 3: 3y = 2x - 12.
- Move the x term: -2x + 3y = -12.
- Multiply by -1: 2x - 3y = 12.
From a fraction in the constant term
Start with y = -(3/4)x + 5/2. The denominators are 4 and 2, so multiply by 4: 4y = -3x + 10. Then 3x + 4y = 10. A is already positive and the three numbers share no factor.
Check each result by substituting a point you know is on the line. In the last example, (0, 5/2) gives 3(0) + 4(5/2) = 10, which matches C.
Doing the conversion in code
The function below converts point-slope data to standard form. It follows the same steps: collect terms, clear denominators, divide by the common factor, and fix the sign.
from fractions import Fraction
from math import gcd
def point_slope_to_standard(m, x1, y1):
"""Convert y - y1 = m(x - x1) to Ax + By = C with integer A, B, C and A >= 0."""
m, x1, y1 = Fraction(m), Fraction(x1), Fraction(y1)
# y - y1 = m(x - x1) -> -m*x + y = y1 - m*x1
a, b, c = -m, Fraction(1), y1 - m * x1
# Clear denominators, then divide out the common factor.
den = a.denominator * c.denominator
a, b, c = int(a * den), int(b * den), int(c * den)
g = gcd(gcd(a, b), c)
a, b, c = a // g, b // g, c // g
if a < 0 or (a == 0 and b < 0):
a, b, c = -a, -b, -c
return a, b, c
print(point_slope_to_standard(2, 1, 3)) # (2, -1, -1) -> 2x - y = -1
print(point_slope_to_standard(Fraction(1, 2), 4, 1)) # (1, -2, 2) -> x - 2y = 2The code uses Fraction instead of floating-point numbers so that a slope like 1/3 stays exact. A decimal such as 0.333... would never clear to clean integers.
The second call shows a slope of 1/2 through (4, 1). After clearing, the equation is -x + 2y = -2. A is negative, so the sign flip gives x - 2y = 2.
What standard form shows directly
Standard form does not display the slope the way y = mx + b does. A short derivation recovers it. Solve Ax + By = C for y, assuming B is not 0:
By = -Ax + C
y = -(A/B)x + C/B
So for a line in standard form:
- The slope is -A/B.
- The y-intercept is C/B.
- The x-intercept is C/A. This comes from setting y = 0, which gives Ax = C.
The intercepts are the quickest thing to read. To find the x-intercept, cover the By term and solve Ax = C. To find the y-intercept, cover the Ax term and solve By = C.
For 2x - 3y = 12 the slope is -2/(-3) = 2/3, the x-intercept is 12/2 = 6, and the y-intercept is 12/(-3) = -4. These match the slope-intercept example above, y = (2/3)x - 4.
from fractions import Fraction
def describe(a, b, c):
"""Return (slope, x_intercept, y_intercept) for Ax + By = C.
A value is None where it does not exist.
"""
if a == 0 and b == 0:
raise ValueError("A and B cannot both be zero")
slope = None if b == 0 else Fraction(-a, b)
x_int = None if a == 0 else Fraction(c, a)
y_int = None if b == 0 else Fraction(c, b)
return slope, x_int, y_int
print(describe(2, -3, 12)) # (Fraction(2, 3), Fraction(6, 1), Fraction(-4, 1))
print(describe(0, 2, 6)) # (Fraction(0, 1), None, Fraction(3, 1)) y = 3
print(describe(5, 0, 10)) # (None, Fraction(2, 1), None) x = 2The last two calls show why None is needed. A line with A = 0 never crosses the x-axis unless it is the x-axis itself, and a line with B = 0 has no slope. The next section covers both.
Special cases
Standard form handles every straight line, including the one that y = mx + b cannot write.
- If B = 0, the equation is Ax = C, so x = C/A. This is a vertical line. It has no slope, and the formula -A/B would divide by zero.
- If A = 0, the equation is By = C, so y = C/B. This is a horizontal line with slope 0.
- If C = 0 and A and B are both nonzero, the line passes through the origin. Both intercepts are 0, so the intercepts give only one point. Find a second point by choosing another x value.
Why use standard form
Standard form is not the best choice for every task, but it has clear strengths:
- The equation has integer coefficients, so the arithmetic stays clean.
- The intercepts take one division each.
- It can describe vertical lines.
- Two equations in standard form line up column by column, which suits solving a system by elimination.
- A single normalized form makes it easy to tell whether two equations describe the same line.
Its weakness is that the slope and a specific point on the line are not obvious at a glance. Point-slope form is better for that, and a later chapter compares the forms in detail.
Common mistakes
- Changing the sign of only some terms. When you multiply by -1 to make A positive, change A, B and C. Changing only A turns the equation into a different line.
- Leaving a fraction in place. An equation like x + (1/2)y = 3 is not in standard form. Multiply every term by 2 to get 2x + y = 6.
- Forgetting to divide by the common factor. 6x + 9y = 12 is correct but not standard. Divide by 3 to get 2x + 3y = 4.
- Reading the slope as A/B. The slope is -A/B. The minus sign comes from moving the Ax term to the other side. For 3x + 4y = 10 the slope is -3/4, not 3/4.
- Checking only one point. One matching point does not prove the equation is right, because many lines pass through it. Check two known points on the line.
Exercise
Write y - 1 = -(2/3)(x + 3) in standard form, then give its slope, x-intercept and y-intercept.
Show answer
Distribute: y - 1 = -(2/3)x - 2. Add 1: y = -(2/3)x - 1. Multiply by 3: 3y = -2x - 3. Move the x term: 2x + 3y = -3. A is positive and the numbers share no factor, so the standard form is 2x + 3y = -3. The slope is -A/B = -2/3. The x-intercept is C/A = -3/2. The y-intercept is C/B = -3/3 = -1. Check with the given point (-3, 1): 2(-3) + 3(1) = -3, which matches C.
Exercise
A line is written 6x - 4y = 10. Is it in standard form? If not, fix it. Then explain what -A/B gives you and what it equals here.
Show answer
It is not in standard form, because 6, -4 and 10 share the common factor 2. Dividing by 2 gives 3x - 2y = 5. A is positive and the three numbers now share no factor. The value -A/B is the slope, and here it is -3/(-2) = 3/2. You get the same slope from the unreduced form, -6/(-4) = 3/2, because dividing by a common factor does not change the line.