Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›IB Mathematics: Analysis and Approaches
  3. ›2 Functions
  4. ›2.1 Equations of straight lines

IB Mathematics: Analysis and Approaches · Topic 2 · Functions

2.1 Equations of straight lines

Find the equation of a straight line, read its gradient and intercept, test for parallel or perpendicular lines, and find where two lines meet.

  • 4 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5The gradient measures how steeply a line rises
  1. 1The gradient measures how steeply a line rises
  2. 2A line’s equation can show its gradient and intercept directly
  3. 3A point and a gradient fix exactly one line
  4. 4Gradients tell you if two lines are parallel or perpendicular
  5. 5Two lines meet where both equations give the same point
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: The gradient measures how steeply a line rises

A ramp that rises 1 m for every 4 m along the ground has a steady slope. A straight line works the same way. Its steepness is the gradient, and it is the same everywhere on the line.

To find it, choose two points on the line. Divide the change in yyy by the change in xxx, so that m=y2−y1x2−x1m=\frac{y_2-y_1}{x_2-x_1}m=x2​−x1​y2​−y1​​. A positive gradient rises to the right, and a negative gradient falls. A horizontal line has gradient 0.

Worked example

Find a gradient

Find the gradient of the line through (1,2)(1,2)(1,2) and (5,10)(5,10)(5,10).
  1. 1
    Label the points: (x1,y1)=(1,2)(x_1,y_1)=(1,2)(x1​,y1​)=(1,2) and (x2,y2)=(5,10)(x_2,y_2)=(5,10)(x2​,y2​)=(5,10).
  2. 2
    Substitute: m=10−25−1m=\frac{10-2}{5-1}m=5−110−2​.
  3. 3
    Simplify: m=84=2m=\frac{8}{4}=2m=48​=2.

Answer: The gradient is 2.

Common mistake

Subtract the coordinates in the same order on the top and the bottom. Mixing the order reverses the sign of the gradient.

Key term

gradient

The gradient of a line is the change in yyy divided by the change in xxx between any two points on it.

Part 1 done

2

Part 2 of 5: A line’s equation can show its gradient and intercept directly

Now that the gradient has a name, look for it in an equation. Most lines are written as y=mx+cy=mx+cy=mx+c. Here mmm is the gradient and ccc is the y-intercept.

The y-intercept is where the line crosses the yyy-axis, so x=0x=0x=0 there. For y=3x−5y=3x-5y=3x−5, the gradient is 3. The line crosses the yyy-axis at (0,−5)(0,-5)(0,−5). Putting x=0x=0x=0 into the equation gives the same point.

Equations are not always arranged this way. For 2x+3y=62x+3y=62x+3y=6, make yyy the subject first.

Worked example

Read a gradient and intercept

Find the gradient and yyy-intercept of 2x+3y=62x+3y=62x+3y=6.
  1. 1
    Subtract 2x2x2x from both sides: 3y=−2x+63y=-2x+63y=−2x+6.
  2. 2
    Divide every term by 3: y=−23x+2y=-\frac{2}{3}x+2y=−32​x+2.
  3. 3
    Compare with y=mx+cy=mx+cy=mx+c.

Answer: The gradient is −23-\frac{2}{3}−32​ and the yyy-intercept is 2.

Common mistake

In 2x+3y=62x+3y=62x+3y=6, the gradient is not 2. Always rearrange to y=mx+cy=mx+cy=mx+c before reading off mmm.

Key term

y-intercept

The y-intercept is the yyy-coordinate of the point where a line crosses the yyy-axis.

Part 2 done

Quick check

One question on the part you just read

Easy

Calculate the gradient of the line through (2,3)(2,3)(2,3) and (6,11)(6,11)(6,11).
Show answer and explanation

Answer: B · Worked explanation

The gradient is 11−36−2=84=2\frac{11-3}{6-2}=\frac{8}{4}=26−211−3​=48​=2. The value 12\frac{1}{2}21​ comes from dividing the change in xxx by the change in yyy, which inverts the formula. Always place the change in yyy on the top of the fraction and the change in xxx on the bottom.
3

Part 3 of 5: A point and a gradient fix exactly one line

Often you know a gradient and one point, not the intercept. Suppose a line has gradient mmm and passes through (x1,y1)(x_1,y_1)(x1​,y1​). Its equation is y−y1=m(x−x1)y-y_1=m(x-x_1)y−y1​=m(x−x1​).

This works because every point (x,y)(x,y)(x,y) on the line must give the same gradient mmm with (x1,y1)(x_1,y_1)(x1​,y1​). Expanding and rearranging gives y=mx+cy=mx+cy=mx+c. Some questions ask for the form ax+by+d=0ax+by+d=0ax+by+d=0, where aaa, bbb and ddd are integers.

If you are given two points instead, first find mmm from them. Then use either point in the same formula. The final equation does not depend on which point you choose.

Worked example

Equation from a point and gradient

Find the equation of the line with gradient -3 through (2,5)(2,5)(2,5). Give it in the form y=mx+cy=mx+cy=mx+c.
  1. 1
    Use y−y1=m(x−x1)y-y_1=m(x-x_1)y−y1​=m(x−x1​) with m=−3m=-3m=−3 and (x1,y1)=(2,5)(x_1,y_1)=(2,5)(x1​,y1​)=(2,5).
  2. 2
    Substitute: y−5=−3(x−2)y-5=-3(x-2)y−5=−3(x−2).
  3. 3
    Expand: y−5=−3x+6y-5=-3x+6y−5=−3x+6.
  4. 4
    Add 5 to both sides: y=−3x+11y=-3x+11y=−3x+11.

Answer: The equation is y=−3x+11y=-3x+11y=−3x+11.

Part 3 done

4

Part 4 of 5: Gradients tell you if two lines are parallel or perpendicular

Think of the two rails of a railway track. They run side by side and never meet. Parallel lines have equal gradients, so m1=m2m_1=m_2m1​=m2​.

Two lines at a right angle are different. Perpendicular lines meet at 90∘90^{\circ}90∘. Their gradients satisfy m1m2=−1m_1m_2=-1m1​m2​=−1, so m2=−1m1m_2=-\frac{1}{m_1}m2​=−m1​1​. Flip the fraction and change the sign.

For example, gradients 3 and −13-\frac{1}{3}−31​ give a product of -1. Those two lines are perpendicular. Vertical lines have no gradient, so these rules do not cover them. A vertical line is perpendicular to a horizontal line.

Worked example

Perpendicular line through a point

Find the equation of the line perpendicular to y=2x+1y=2x+1y=2x+1 that passes through (4,3)(4,3)(4,3).
  1. 1
    The given gradient is 2, so the perpendicular gradient is −12-\frac{1}{2}−21​.
  2. 2
    Use y−y1=m(x−x1)y-y_1=m(x-x_1)y−y1​=m(x−x1​): y−3=−12(x−4)y-3=-\frac{1}{2}(x-4)y−3=−21​(x−4).
  3. 3
    Expand: y−3=−12x+2y-3=-\frac{1}{2}x+2y−3=−21​x+2.
  4. 4
    Add 3: y=−12x+5y=-\frac{1}{2}x+5y=−21​x+5.

Answer: The equation is y=−12x+5y=-\frac{1}{2}x+5y=−21​x+5.

Exam tip

To prove two lines are perpendicular, multiply their gradients and show that the product is -1. Write this step out in full.

Key terms · tap one for its definition

parallel lines

Parallel lines are lines in the same plane that never meet; non-vertical parallel lines have equal gradients.

perpendicular lines

Perpendicular lines meet at a right angle; if neither is vertical, their gradients multiply to give -1.

Part 4 done

Quick check

One question on the part you just read

Easy

State the yyy-intercept of the line y=−3x+7y=-3x+7y=−3x+7.
Show answer and explanation

Answer: C · Worked explanation

In y=mx+cy=mx+cy=mx+c, the constant ccc is the yyy-intercept, so here it is 7. The value -3 is the gradient, not the intercept. It is the coefficient of xxx, which controls the steepness of the line rather than where the line crosses the yyy-axis.
5

Part 5 of 5: Two lines meet where both equations give the same point

Two lines that are not parallel cross at exactly one place. At that place, both equations share the same xxx and yyy. Where two graphs cross, the crossing places are called intersection points.

For two lines written as y=mx+cy=mx+cy=mx+c, set the right-hand sides equal. Solve for xxx. Then substitute back into either equation to find yyy. The pair of values you obtain is the intersection point.

Worked example

Intersection of two lines

Find the intersection point of y=2x+1y=2x+1y=2x+1 and y=−x+7y=-x+7y=−x+7.
  1. 1
    Set the expressions for yyy equal: 2x+1=−x+72x+1=-x+72x+1=−x+7.
  2. 2
    Add xxx to both sides: 3x+1=73x+1=73x+1=7.
  3. 3
    Subtract 1 and divide by 3: x=2x=2x=2.
  4. 4
    Substitute into y=2x+1y=2x+1y=2x+1: y=2(2)+1=5y=2(2)+1=5y=2(2)+1=5.

Answer: The lines meet at (2,5)(2,5)(2,5).

Figure 1. The two lines meet at a single point, which is where both equations are satisfied.

If the gradients are equal and the intercepts differ, the lines are parallel and never meet. If both equations describe the same line, every point is shared. Check by substituting xxx and yyy into the other equation.

Key term

intersection points

Intersection points are points where two curves have the same xxx- and yyy-coordinates.

Note read

Check your recall[16 marks]

6 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.Calculate[2 marks]

    Calculate the gradient of the line through (−1,4)(-1,4)(−1,4) and (3,−4)(3,-4)(3,−4).

    Show mark schemeHide mark scheme

    Model answer

    m=−4−43−(−1)=−84=−2m=\frac{-4-4}{3-(-1)}=\frac{-8}{4}=-2m=3−(−1)−4−4​=4−8​=−2.

    • 1 mark for substituting the coordinates into y2−y1x2−x1\frac{y_2-y_1}{x_2-x_1}x2​−x1​y2​−y1​​
    • 1 mark for obtaining a gradient of -2
  2. 2.Determine[3 marks]

    Determine the equation of the line with gradient 3 that passes through (2,−1)(2,-1)(2,−1). Give your answer in the form y=mx+cy=mx+cy=mx+c.

    Show mark schemeHide mark scheme

    Model answer

    y−(−1)=3(x−2)y-(-1)=3(x-2)y−(−1)=3(x−2), so y+1=3x−6y+1=3x-6y+1=3x−6 and y=3x−7y=3x-7y=3x−7.

    • 1 mark for using y−y1=m(x−x1)y-y_1=m(x-x_1)y−y1​=m(x−x1​) with the given values
    • 1 mark for expanding correctly
    • 1 mark for obtaining y=3x−7y=3x-7y=3x−7
  3. 3.Determine[3 marks]

    Determine the gradient and yyy-intercept of the line 2x+4y=122x+4y=122x+4y=12.

    Show mark schemeHide mark scheme

    Model answer

    Rearranging gives 4y=−2x+124y=-2x+124y=−2x+12, so y=−12x+3y=-\frac{1}{2}x+3y=−21​x+3. The gradient is −12-\frac{1}{2}−21​ and the yyy-intercept is 3.

    • 1 mark for rearranging to make yyy the subject
    • 1 mark for stating the gradient −12-\frac{1}{2}−21​
    • 1 mark for stating the yyy-intercept 3
  4. 4.Deduce[3 marks]

    Deduce whether the lines y=3x−2y=3x-2y=3x−2 and 6y=−2x+56y=-2x+56y=−2x+5 are perpendicular.

    Show mark schemeHide mark scheme

    Model answer

    The first gradient is 3. Rearranging the second gives y=−13x+56y=-\frac{1}{3}x+\frac{5}{6}y=−31​x+65​, so its gradient is −13-\frac{1}{3}−31​. The product is 3×(−13)=−13\times\left(-\frac{1}{3}\right)=-13×(−31​)=−1, so the lines are perpendicular.

    • 1 mark for finding the gradient 3 of the first line
    • 1 mark for rearranging the second line to find gradient −13-\frac{1}{3}−31​
    • 1 mark for showing the product is -1 and concluding the lines are perpendicular
  5. 5.Determine[3 marks]

    Determine the intersection point of y=x+3y=x+3y=x+3 and y=−2x+9y=-2x+9y=−2x+9.

    Show mark schemeHide mark scheme

    Model answer

    Set x+3=−2x+9x+3=-2x+9x+3=−2x+9, so 3x=63x=63x=6 and x=2x=2x=2. Then y=2+3=5y=2+3=5y=2+3=5. The intersection point is (2,5)(2,5)(2,5).

    • 1 mark for equating the two expressions for yyy
    • 1 mark for solving to obtain x=2x=2x=2
    • 1 mark for substituting to obtain y=5y=5y=5
  6. 6.Explain[2 marks]

    Explain why two different parallel lines have no intersection point.

    Show mark schemeHide mark scheme

    Model answer

    Parallel lines have equal gradients but different intercepts. They stay the same distance apart, so no point satisfies both equations.

    • 1 mark for stating that parallel lines have equal gradients and different intercepts
    • 1 mark for explaining that no xxx and yyy satisfy both equations, so the lines never meet

Practice this topic

10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)

0 right0 of 10 answered

Includes the 2 quick checks in the note above.

3.

Easy·State[1 mark]

State the gradient of any line parallel to y=5x−2y=5x-2y=5x−2.
Show answer and explanation

Answer: D · Worked explanation

Parallel lines have equal gradients, so the required gradient is 5. The value −15-\frac{1}{5}−51​ is the gradient of a perpendicular line, found by flipping the fraction and changing the sign. That rule applies to perpendicular lines, not to parallel lines.
4.

Medium·Determine[2 marks]

Determine the gradient of the line 4x+2y=104x+2y=104x+2y=10.
Show answer and explanation

Answer: A · Worked explanation

Subtract 4x4x4x to get 2y=−4x+102y=-4x+102y=−4x+10. Divide by 2 to get y=−2x+5y=-2x+5y=−2x+5. The gradient is -2. The value 4 is the coefficient of xxx in the original equation, but it is not the gradient until yyy has been made the subject of the equation.
5.

Medium·Determine[2 marks]

Determine the equation of the line with gradient 3 that passes through (1,4)(1,4)(1,4).
Show answer and explanation

Answer: B · Worked explanation

Use y−4=3(x−1)y-4=3(x-1)y−4=3(x−1). Expanding gives y−4=3x−3y-4=3x-3y−4=3x−3, so y=3x+1y=3x+1y=3x+1. The equation y=3x+4y=3x+4y=3x+4 wrongly uses the yyy-coordinate of the point as the intercept. That only works when the point has x=0x=0x=0, which is not true for (1,4)(1,4)(1,4). Checking the point in the final equation, 3(1)+1=43(1)+1=43(1)+1=4, confirms the answer.
6.

Medium·Determine[1 mark]

Determine the gradient of any line perpendicular to y=−23x+1y=-\frac{2}{3}x+1y=−32​x+1.
Show answer and explanation

Answer: C · Worked explanation

Flip the fraction to get −32-\frac{3}{2}−23​, then change the sign to get 32\frac{3}{2}23​. Check: −23×32=−1-\frac{2}{3}\times\frac{3}{2}=-1−32​×23​=−1. The value −32-\frac{3}{2}−23​ comes from flipping the fraction but keeping the original sign, so the product would be +1+1+1, not -1. Multiplying the two gradients is a quick way to check any answer.
7.

Medium·Determine[2 marks]

Determine the intersection point of y=2x−1y=2x-1y=2x−1 and y=x+3y=x+3y=x+3.
Show answer and explanation

Answer: D · Worked explanation

Set 2x−1=x+32x-1=x+32x−1=x+3, so x=4x=4x=4. Then y=4+3=7y=4+3=7y=4+3=7, giving (4,7)(4,7)(4,7). Check in the first line: 2(4)−1=72(4)-1=72(4)−1=7. The point (7,4)(7,4)(7,4) has the coordinates in the wrong order, because the xxx-coordinate is found first and the yyy-coordinate second. Substituting x=4x=4x=4 into the second equation also gives 7, so the point lies on both lines.
8.

Hard·Determine[2 marks]

Line LLL passes through (0,6)(0,6)(0,6) and (3,0)(3,0)(3,0). Determine the equation of the line perpendicular to LLL that passes through (2,1)(2,1)(2,1).
Show answer and explanation

Answer: A · Worked explanation

The gradient of LLL is 0−63−0=−2\frac{0-6}{3-0}=-23−00−6​=−2, so the perpendicular gradient is 12\frac{1}{2}21​. Then y−1=12(x−2)y-1=\frac{1}{2}(x-2)y−1=21​(x−2) gives y=12xy=\frac{1}{2}xy=21​x. The equation y=−2x+5y=-2x+5y=−2x+5 is the line parallel to LLL through (2,1)(2,1)(2,1), so it uses the wrong gradient. Check: −2×12=−1-2\times\frac{1}{2}=-1−2×21​=−1, and the line passes through (2,1)(2,1)(2,1) because 12(2)=1\frac{1}{2}(2)=121​(2)=1.
9.

Hard·Determine[2 marks]

The lines y=kx+3y=kx+3y=kx+3 and 3x+2y=83x+2y=83x+2y=8 are perpendicular. Determine the value of kkk.
Show answer and explanation

Answer: C · Worked explanation

Rearranging 3x+2y=83x+2y=83x+2y=8 gives y=−32x+4y=-\frac{3}{2}x+4y=−23​x+4, so its gradient is −32-\frac{3}{2}−23​. A perpendicular line has gradient 23\frac{2}{3}32​, because 23×(−32)=−1\frac{2}{3}\times\left(-\frac{3}{2}\right)=-132​×(−23​)=−1. The value −32-\frac{3}{2}−23​ would make the lines parallel, not perpendicular. Always multiply the two gradients at the end to confirm that the product is -1, which proves the lines are perpendicular.
10.

Hard·Determine[2 marks]

Determine how many intersection points the lines y=2x+3y=2x+3y=2x+3 and 4x−2y=−64x-2y=-64x−2y=−6 have.
Show answer and explanation

Answer: D · Worked explanation

Rearranging 4x−2y=−64x-2y=-64x−2y=−6 gives y=2x+3y=2x+3y=2x+3, the same equation as the first line. Every point on one line lies on the other, so there are infinitely many shared points. Equal gradients alone do not make lines parallel and distinct; the intercepts must also differ.

Keep going

Next topic2.2 Functions, domain and rangePrevious topic1.16 Systems of linear equations

More in Topic 2 · Functions

  1. 2.1Equations of straight linesNotes · 10 questions
  2. 2.2Functions, domain and rangeNotes · 10 questions
  3. 2.3Graphs of functionsNotes · 10 questions
  4. 2.4Key features of graphsNotes · 10 questions
  5. 2.5Composite and inverse functionsNotes · 10 questions
  6. 2.6Quadratic functionsNotes · 10 questions
  7. 2.7Quadratic equations and inequalitiesNotes · 10 questions
  8. 2.8Reciprocal and rational functionsNotes · 10 questions
  9. 2.9Exponential and logarithmic functionsNotes · 10 questions

All IB Mathematics: Analysis and Approaches topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by IB Diploma Programme or any exam board.

On this page

0/5 read

  1. 1The gradient measures how steeply a line rises
  2. 2A line’s equation can show its gradient and intercept directly
  3. 3A point and a gradient fix exactly one line
  4. 4Gradients tell you if two lines are parallel or perpendicular
  5. 5Two lines meet where both equations give the same point
  6. Check your recall
  7. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe

Two lines crossing at one point

y-20246-20246810x
  • y = 2x + 1
  • y = −x + 7
  • Intersection (2, 5)