What Are Functions?
What is y = 3x – 2? An equation? Or maybe a function? Could it possibly be both? Keep on reading to learn all about functions and to find out how they’re different from equations.
Jason Marshall, PhD
Listen
What Are Functions?
Over the past few weeks, we’ve talked a lot about functions. In particular, we’ve been learning all about everyone’s favorite trigonometric functions: sine, cosine, and tangent. But, I just realized, we’ve never actually talked about what makes something a “function” in the first place…until today, that is.
So sit back, relax, and prepare yourself to dive into the wonderful world of functions..
Quick Review of Equations
For reasons that will soon be apparent, before talking about functions, I’d like to spend a few minutes talking about the equation y = 3x – 2. Why this equation? Well, the most interesting thing about this equation is that unlike most that we’ve looked at before, this equation has not one but two variables: x and y.
When we first learned about what equations mean, we discovered that we can somewhat fancifully imagine that an equation like 3x – 6 = x is something that acts like an old-fashioned scale checking to see if both sides are balanced. For 3x – 6 = x, both sides of the scale equal 3 when x = 3—which means that the scale is balanced for this value of x.
Believe it or not, once you understand this idea about the meaning of an equation with one variable, you also understand what an equation with two variables means. By which I mean that just as we can think of a single variable equation as a scale that tests to see if both sides are balanced, we can also think of a two variable equation like y = 3x – 2 as a scale that tests to see if its sides are balanced.
The big difference here is that there isn’t a single number to plug into a variable to see if the equation is balanced. Instead, there are an infinite number of pairs of numbers that will balance the scale. For example, if we set x = 1 in y = 3x – 2, we find that y = 3 • 1 – 2 = 1. If we plug this pair of x and y values into the equation on our scale, we find that it’s balanced since both sides are equal to 1.
While that’s all well and good, there’s actually another way to think about an equation like this with two variables. And, somewhat surprisingly, that way is to not think about it as an equation at all!
What Is a Function?
Here’s what I mean: Instead of writing our two-variable equation as y = 3x – 2, let’s instead write this: y(x) = 3x – 2. What is this? It’s a function. What’s that?
Well, the fact that we’ve changed y into y(x) means that we’re now thinking of y as what’s called a function instead of a variable. In soft, squishy, non-rigorous mathematical language, you can think of this function, y, as a sort of machine that takes some input and in return gives you back a single unique piece of output. The input to the function is the variable x, which is why it appears in parenthesis after the name of the function. Here’s how it works:
On the left, you see a number of different values of the input variable, x. In this case we’re feeding positive integers into our function. And the function that we’re plugging these x values into is y(x) = x2. In other words, it’s the function that squares numbers. So this function—like all functions—takes some input, does some calculation with it, and then spits out the result.
Functions vs. Equations
If you’re still a bit unclear about the difference between an equation and a function, here’s another way for you to think about it:
- An equation is something that’s used to balance the “stuff” on either side of an equals sign.
- A function is something that’s fed input and in return gives output based upon a relationship.
Importantly, when it comes to describing what a function is and does, you’ll notice that we haven’t said a word about testing for equality. So although they might look similar—or indeed identical if, as is often the case, the function is written without its accompanying input variable in parenthesis—functions and equations really are quite different creatures.
What Makes a Function a Function?
But lest we get ahead of ourselves and start calling everything in sight a function, it’s extremely important to know that not every object that’s fed input and gives back output based upon some relationship is a function. And that’s because a function is only a function if two critical things are true:
- Functions must be able to provide output for every allowable input value.
- Functions cannot have more than one output value for each of these input values.
We’ll talk more about what all of this means next week, and we’ll talk about it in a more mathematical way. But for now the key thing you should understand is that something like y = x2 can be either:
- A good old-fashioned equation that checks whether or not its two sides are balanced.
- A function—more clearly written y(x) = x2—which returns a single value for each possible input.
But, as I said before, when it comes to functions, there’s a lot more to say. So be sure to check back next time for the rest of the story.
Wrap Up
Okay, that’s all the math we have time for today.
Please be sure to check out my book The Math Dude’s Quick and Dirty Guide to Algebra. And remember to become a fan of the Math Dude on Facebook where you’ll find lots of great math posted throughout the week. If you’re on Twitter, please follow me there, too.
Until next time, this is Jason Marshall with The Math Dude’s Quick and Dirty Tips to Make Math Easier. Thanks for reading, math fans!
Equation image courtesy of Shutterstock.
Betterment LLC is an SEC Registered Investment Advisor. Brokerage services are offered by Betterment Securities, an SEC registered broker-dealer and member FINRA/SIPC. Investments are not FDIC Insured. No Bank Guarantee. May Lose Value. Investing in securities involves risks, and there is always the potential of losing money when you invest in securities. Before investing, consider your investment objectives and Betterment’s charges and expenses. Not an offer, solicitation of an offer, or advice to buy or sell securities in jurisdictions where Betterment and Betterment Securities are not registered.