Maths dictionary

What is a function?

By Viktor Lassen6 min readUpdated 3 September 2026

A function is like a machine in a factory. We put a number in, the machine applies its rule, and a different number comes out. That one picture carries everything else about functions.

A function is like a machine in a factory. We put something into it, and something else comes out on the other side.

That's the whole idea, and it's worth holding on to, because everything else about functions is just this machine looked at from different angles.

The machine

Depending on what the function looks like, different things will of course come out. When we talk about functions in maths, we call the thing we put in the x-value and the thing that comes out the y-value.

A function as a machine: the x-value goes in, the rule 2ร—x is applied, the y-value comes out

So an x-value goes into the function, and a y-value comes out on the other side. The y-value that comes out depends on the x-value.

Let's look at an example: a function called 2ร—x2 \times x. That means that when we put an x-value (a number) into the function, we multiply our x-value by 2, and that becomes the y-value. Let's try putting 3 into the function:

2ร—3=62 \times 3 = 6

We put 3 into the function, and since the function is called 2ร—x2 \times x, we put 3 in x's place and work it out. So we get a y-value, and it's 6. Notice how the y-value depends on the x-value. If we'd put 5 in x's place instead, we'd have got a different y-value:

2ร—5=102 \times 5 = 10

Writing a function as y = 2 ร— x

When we write functions in maths, we can't be bothered to draw the machine every time, so we write it like this:

y=2ร—xy = 2 \times x

That's a lot easier to write, and it means exactly the same as our machine. It just says that we find our y-value by saying 2 times the x-value. So if we try putting 3 into the function again, it says

y=2ร—3y = 2 \times 3

which we can work out to

y=6y = 6

In the exam the multiplication is usually written with a cross, y=2ร—xy = 2 \times x, or with nothing at all, y=2xy = 2x. It's the same function.

Why x and y are called variables

xx and yy are what we call variables, because they vary, that is, they change. We can choose our x-value ourselves, and depending on which x-value we put into the function, the y-value changes too, so it isn't the same two values all the time. You can see it as xx and yy just being placeholders for some numbers we haven't chosen yet.

Because the y-value depends on which x-value we choose, we call yy the dependent variable, and xx, which depends on nothing except what we pick, the independent variable. We see that all the time in the real world: in a taxi the price depends on how far you drive. There's a guide on dependent and independent variables that takes this properly.

Where functions live: the coordinate system

When we want to visualise functions, we need somewhere to do it. Just like when you paint, you need a canvas. In maths we also have a kind of canvas, which we call a coordinate system. It's two axes at right angles to each other, the horizontal x-axis and the vertical y-axis, meeting in the middle at the origin. A point in it is described by how far along the x-axis and how far up the y-axis we have to go, written as (x,y)(x, y). The guide on coordinates and the coordinate system builds that picture up one step at a time.

From the machine to a graph

There's actually a close connection between functions and the coordinate system. When we put an x-value into the function, we actually get a point. Put 3 into y=2ร—xy = 2 \times x and the y-value turns out to be 6, so

x=3andy=6x = 3 \quad \text{and} \quad y = 6

which, after all, is just like the coordinates of a point:

(3,6)(3, 6)

So when we work out particular values in a function, we can visualise them as points in a coordinate system. Let's take the x-values 1, 2, 3, 4 and 5 and work out the y-values:

y=2ร—1=2y = 2 \times 1 = 2

y=2ร—2=4y = 2 \times 2 = 4

y=2ร—3=6y = 2 \times 3 = 6

y=2ร—4=8y = 2 \times 4 = 8

y=2ร—5=10y = 2 \times 5 = 10

All we've done is put the different x-values we chose into the function and worked out the y-value for each one. So we get five points: (1,2)(1, 2), (2,4)(2, 4), (3,6)(3, 6), (4,8)(4, 8) and (5,10)(5, 10).

The five points (1, 2), (2, 4), (3, 6), (4, 8) and (5, 10) from y = 2ร—x

As we can see, the function y=2ร—xy = 2 \times x makes a pattern. It's as if, no matter which x-value we put into the function, the point always ends up lying on one line.

The same five points with the line through them: the graph of y = 2ร—x

That line is actually what we call the function's graph. If we pretend that we plotted points for infinitely many x-values, we'd get exactly this line. So when we visualise a function, we do it with a graph, and every function has one. We can use it to see how the connection develops, and even read values straight off it. The guide on plotting a graph from an equation goes through the whole thing, including a real-life example.

Another way to write a function: f(x)

There are many ways to write functions. You probably already know yy, which is the one we typically use, but there are also lots of other names we can use. Instead of

y=2x+5y = 2x + 5

we often write

f(x)=2x+5f(x) = 2x + 5

It means exactly the same. ff is really just what we name our function, and with the bracket (x)(x) we show which variable our function depends on. The advantage is that we can write f(3)f(3) to mean the function value when xx is 3. That gets its own guide on function notation.

Where this leads

Once the machine picture sits right, a few more moves come naturally:

Functions whose graph is a straight line, like y=2ร—xy = 2 \times x, get their own article on linear functions and straight-line graphs.

Common misunderstandings

  • "A function is just an equation." A function is the machine. y=2ร—xy = 2 \times x is the label on its box: it tells you what the machine does to whatever you put in.
  • "f(x) means f times x." No. ff is only the name we give the function, and the bracket (x)(x) shows which variable the function depends on. f(3)f(3) is the function value when xx is 3, not fร—3f \times 3.

Guides on this topic

Frequently asked questions

Read next

Want to get good at maths?

Mathara explains every topic step by step with videos, exercises and personal feedback.

๐Ÿ‘‰ Get started for free