As you may know, graphs of functions come in many different shapes. It is intuitive that functions which graphs look alike share similar properties and behave in a similar manner. So we distinguish different classes of functions based on their graphs. In this topic, we will learn about the basic class of functions – linear functions, which graph is, well, a straight line. Even though they aren't all that complicated, we use them on a daily basis in various situations without knowing it. From Hooke's law in physics or computation of an annual salary to a simple discount in a shop – all these are linear functions. We will learn what properties they have, how their graphs look, and how one can spot them.
Definition and graph
The formal definition states that a linear function has a form: where and . Pay attention that a function is linear only if has the degree of . Meanwhile, the value of and could also be equal to . The graph of is a straight line, therefore this function is linear, test it yourself!
As an example consider a function that calculates the age of a person depending on a current year. For example, we know that if a person was born in the year , then in the year he or she would be years old. Let's write this as a function where is the year: in year the person would be years old. In this particular linear function and take values: and .
Consider another example. Let's say Bob is a recent graduate, who just got his dream job. Previously, in order to pay for his studies, Bob has borrowed 25000 from a bank, which he now must pay back. Bob's monthly salary is 7000 but after paying all the taxes and bills he is left with 1500. This money goes to repaying Bob's debt. How many months will it take for Bob to completely repay his debt if his salary and expenses stay the same for the whole period? We can express the debt as a function of months that Bob has worked: . Initial debt is static and is equal to 25000, the monthly payments are 1500, we get: . Values this function takes correspond to Bob's remaining debt after months.
Properties
Now let's take a look at the more complicated properties of linear functions. The first one would be the slope of the line which shows the rate of the function's value change ( value) in correspondence with the argument's change ( value). The slope of a function represents the quotient of the difference of values of the function at points divided by the difference of these points . To put it simpler: it shows, how fast the function changes at a given interval between arbitrary points . And because the graph of a linear function is a straight line, the slope of such function would be the same for any and , i.e. the function changes at a constant rate. If we represent the given linear functions as and insert this value into our formula, we will get that:
– the slope is equal to the coefficient .
Also, if a function is not constant, i.e. the value of , the graph of this function would cross the and axis at some point.
A constant function would only cross the axis, as its value doesn't change. It will either be equal to In case or would never cross the axis.
We call such points the –intercept and –intercept for and axis respectively. Finding the coordinates of –intercept is pretty straightforward: the linear function must take as an argument and the point's coordinates will be . The –intercept is a bit trickier. we are looking for an argument at which the function's value is . To find it we must solve the equation . For a linear function the -intercept would be the point and to find the –intercept we must solve: ;
;
So the coordinates of the –intercept are .
Linear functions of two or more variables
Up until this point, we have only spoken about the linear functions of one variable. But as you may know, a function may have not only , but or variables. For a function with variables to be linear, it must have a constant rate of change with regard to all its variables. What does it mean exactly? Well, consider a function that depends on two variables: and , and describes a household's weekly income. There are people in the family – earns 150 dollars per day and who earns 200 dollars per day. The arguments and show how many days did and work respectively. If both partners worked 5 days each, the family will get dollars. Then, if worked only days, the family would get dollars, and if worked the income would be dollars. Now you may wonder, we reduced each argument by one, but got different results in the end, which means that the function has a different rate of change, no? How is it linear? Now, for a multivariable function to be linear we take into account only the change rate with respect to each argument individually, we don't inspect the functions as a whole. If would work only days instead of , the result would be less by 150 dollars. If he or she worked days instead of it again would diminish by 150 dollars – the rate of change with respect to the first argument stays the same, which is also true for the second argument.
Let's take a look at a non-linear multivariable function. Consider a student Bob who is very lazy. Bob loves staying in bed for many hours and hates going to school. For each schoolday that he misses he should catch up with all the classes and hand in all the missed homeworks. If Bob misses many days in a row, his debt grows and it becomes exponentially harder for him to catch up. Let's say that to do any homework Bob requires 2 hours. And if he misses school days he needs hours of work to catch up with the study material. The function calculates, how many hours in total Bob needs to finish all homeworks and catch up with others. The function is calculated as follows: . The function is linear with respect to the argument – its rate of change is constant and isn't linear for argument . If Bob misses day, he needs hours to catch up, if he misses days, he needs hours – the rate of change so far is . But if he misses days, he would need hours and the rate of change would grow to be . So basically you may perceive a multivariable function as a composition of functions with one variable, and each of those functions must be linear for the whole multivariable function to be linear.
Lastly, let's talk about graphs of multivariable linear functions. In the 2D case (function of variable) the graph was a straight line. If the function has variables the graphs lie in 3D space. Now we have 2 sub-functions (with respect to each argument) and their graphs are straight lines, which gives us a plane as a result. Here is the graph of a linear multivariable function :
But if we plot the non-linear function from the previous example: . Its graph will be curved:
It is important to understand that number of dimensions doesn't change how linear functions behave. You may still find the slope in or any other direction as well as corresponding intercepts. If the number of variables in a function is more than we can no longer picture its graph, but we can still describe it as it preserves all properties from 2D and 3D cases.
Conclusion
In this topic, you have learned about one of the simpler and more common classes of functions – linear functions. Let's now quickly go over the main features of this type of function:
Graph of a linear function can be represented as a straight line in 2D, or as a plane in 3D space.
Linear functions all have the same form: . Where both the slope and the position of the function depend on parameters and .
We can find a slope of a linear function by using this formula: .
If the rate of change for each variable in a multivariable function is constant on the whole domain that means that our function is linear.