# How to Define a Function

From the previous article we know what is a function. Now we’re going to learn how to define functions the most standard way.

Although you can use a table to define a function, it’s not always adequate. Usually we need stronger tool for defining more complex functions. One of the tools can be plain english. We can define a function using a sentence:

Let the function f assign for each real number the square of that number.

That’s perfectly fine, but it’s still not very flexible when defining even more complex functions. The most convenient way is to use standard mathematical expressions. Let us start with an example:

f(x) = x2, for all x.

This is the exact same function f as we’ve defined before using plain english. It defines a function called f that assigns for all input x the output x2. We can use different name function, e. g.

g(x) = x2, for all x.

This is the exact same function except for the name: this function is called g. The same goes for the letter x: it denotes the input variable or function argument. It doesn’t matter if it is x or a. This is still the exact same function

g(a) = a2, for all a.

It still defines function g and it assigns for each number a the number a2. There are no limitation, basically we can use anything for function name or for input variable, see example:

αβγ(eminem) = eminem + 10, for all eminem.

We’ve just defined the function αβγ and we’ve used “eminem” as an input variable. That’s perfectly fine! It’s definitely very uncommon function but hey, still better Eminem than Kayne West!

OK, now we understand the left part of the function, the function name and the input variable. What about the right part? It defines the assignments. It tells you, what to do with the input variable. Let us go back to the first example:

f(x) = x2, for all x.

It tells us, that for each number x we get the output if we compute x2. If e. g. the input is x = 3 then the output is f(3) = 32 = 9. As you can see, you just take the value 3 and you substitute every occurrence of x for 3. Another example:

g(x) = x2 + x + 1

What is the value of g at x = 6? I. e. what is g(6)? We replace each occurrence of x for 6:

g(6) = 62 + 6 + 1 = 36 + 6 + 1 = 43.

The value of g at point x = 6 is equal to 43.