# Nakafa Learning Content

> For AI agents: use [llms.txt](https://nakafa.com/llms.txt) for the site index. Markdown versions are available by appending `.md` to content URLs or sending `Accept: text/markdown`.

URL: https://nakafa.com/en/subjects/mathematics/function-composition-inverse-function/function-concept
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/mathematics/function-composition-inverse-function/function-concept/en.mdx

Understand functions as magic machines with interactive examples. Learn f(x) notation, input-output relationships, and the one-to-one rule.

---

## What is a Function?

Imagine you have a magic machine. This machine has a special task: every time you put something in (let's call it *input*), the machine will produce *exactly one* other item (let's call it *output*) according to a specific rule. Well, this magic machine is what we call a **function** in mathematics!

So, a function is a special rule that connects each member of one group (set) to **exactly one** member in another group. The key is the phrase "exactly one". Each input can only have one output.

## Function Notation

Usually, a function is written in the form $$f(x) = y$$.

Visible text: Usually, a function is written in the form .

-   $$f$$: This is the **name of the function** (think of it as the name of the machine). You can also use other letters like $$g$$ or $$h$$.

-   $$x$$: This is the **input variable**. Think of this as the item you put into the machine.

-   $$y$$: This is the **output variable**. This is the item that comes out of the machine after processing. The value of $$y$$ depends on the value of $$x$$ entered and the rule $$f$$. So, $$y$$ is often written as $$f(x)$$ (read: "f of x").

Visible text: - : This is the **name of the function** (think of it as the name of the machine). You can also use other letters like or .

- : This is the **input variable**. Think of this as the item you put into the machine.

- : This is the **output variable**. This is the item that comes out of the machine after processing. The value of depends on the value of entered and the rule . So, is often written as (read: "f of x").

## Function Machine

To make it easier to imagine, look at this machine.

Component: FunctionMachine
Props:
- title: Function Machine
- description: Input a number into the machine, and the machine will output the result.
- inputLabel: Function machine input

Above is an example of an interactive function machine. Try changing the input value ($$x$$) at the bottom, and observe how the output value ($$f(x)$$) changes according to the function rule $$f(x) = 2x + 1$$.

Visible text: Above is an example of an interactive function machine. Try changing the input value () at the bottom, and observe how the output value () changes according to the function rule .

### Simple Example

Suppose we have the function $$f(x) = x + 2$$. This means the rule of the machine $$f$$ is "add $$2$$" to every input $$x$$.

Visible text: Suppose we have the function . This means the rule of the machine is "add " to every input .

-   If the input is $$x=3$$, the output is $$f(3) = 3 + 2 = 5$$.
-   If the input is $$x=-1$$, the output is $$f(-1) = -1 + 2 = 1$$.
-   If the input is $$x=0$$, the output is $$f(0) = 0 + 2 = 2$$.

Visible text: - If the input is , the output is .
- If the input is , the output is .
- If the input is , the output is .

Each input $$(3, -1, 0)$$ has **exactly one** output $$(5, 1, 2)$$. This is the hallmark of a function!

Visible text: Each input has **exactly one** output . This is the hallmark of a function!