Functions
VIDEO COMING SOON…
In this post, we are going to be discussing the joys of Functions.
The best place to begin would be to give you some sort of idea of what a function actually is. The way I like to think of functions is as if they were some sort of machine – you put something into the machine, it processes the information and spits a value out the other end. Our machine in this example is our function.
Functions are typically expressed as’\(f(x)\) = …’ → an example of one would be \(f(x) = x+2\).
The \(x\) in \(f(x)\) represents the ‘opening’ of our metaphorical machine. We sub our value in as \(x\) and it runs the value through the equation.
Say we want to input the number \(4\) into our function – it would look something like this → \(f(4) = (4) +2 = 6\).
That covers the foundations – lets move onto something a little more challenging.
Combining Functions
These are also known as ‘composite functions’ – they are essentially where we put our \(f(x)\) function together with a second function, usually referred to as \(g(x)\).
To write these composite functions, we just put the 2 outer letters together. So if we combine \(f(x)\) and \(g(x)\) together, we will have \(fg(x)\). The rule when using composite functions is to perform the function of the letter closest to the \(x\) → in this case it would be \(g(x)\).
A good way to look at \(fg(x)\) is \(f(g(x))\) – this might make it easier to understand the flow of the function. Essentially, we sub in our whole \(g(x)\) function as our \(x\) value in our \(f(x)\) function. It’s easier than it sounds so let’s look at a quick example:
Say we have \(f(x) = 3x+2\) and \(g(x) = 2x\):
Let’s find what \(fg(x)\) would be:
- We re-write the function as \(f(g(x))\) so it’s easy to see that we are subbing \(g(x)\) into our \(f(x)\) function.
- Sub in \(g(x)\) into \(f(x)\) like so: \(fg(x)=3(2x) +2 = 6x+2\)
Now, let’s have a look at what \(gf(x)\) would be :
- Re-write the function as \(g(f(x))\) as above.
- Sub in \(f(x)\) into \(g(x)\): \(gf(x) = 2(3x+2) = 6x + 6\)
This also demonstrates that \(gf(x)\) does NOT equal \(fg(x)\).
Inverse Functions
The final part of Functions we need to cover is inverse functions. These are written as \(f^{-1}(x)\) and all it does is just reverse the normal \(f(x)\) function.
This is a bit more complicated than combining functions but bare with me. In order to find the inverse of a function, you write out the function as normal and make the \(x\) of the equation, the subject.
Again, sounds a bit complicated so let’s use an example to illustrate what we’re talking about:
‘If \(f(x) = \frac{6+2x}{4}\), find \(f^{-1}(x)\)’ → to solve this, we need to make the \(x\) in the \(\frac{6+2x}{4}\), the subject of the function. For the sake of the example, lets refer to our \(f(x)\) as \(y\).
So we’ve got \(y=\frac{6+2x}{4}\), we can get ride of the 4 by multiplying both side by 4 to leave us with \(4y = 6+2x\).
We can minus both sides by 6 to give us \(2x=4y-6\).
Finally, we can divide by 2 to give us \(x=\frac{4y-6}{2}\).
Now we just swap our \(y\) for an \(x\) we have our inverse function of \(f^{-1}(x) = \frac{4x-6}{2}\).
Hopefully, this all made sense. If you have any questions on this, please leave them in the comments section below and I’ll get back to you as soon as possible!
If you’re feeling confident – please go ahead and give the Question Practice section a go.