welcome to lecture 1.4 equations of lines and modeling and to again give you a little insight into me this is another picture from the wall called the via francine which is from london to rome i did from france to rome and this was a lovely lady that rescued me in a downpour in a small village in switzerland i couldn't i didn't have a map again i had no technology it was raining and cold when i got into this small village and i had no map to find the church which was supposed to be providing housing for pilgrims and hikers and this lady was walking down the street with a bag of groceries and i asked her for some help and directions and she agreed to take me to the church it was a catholic church but she warned me that the town was so small that the preacher only came once a month and she didn't think it would be open and so we got there and indeed it wasn't open there were no beds and i planned on just sleeping in the church on a pew and she just wouldn't allow that and so she called around and she found someone who would rent me a bed for the night um you know and it just is amazing to me that you know we hear all this darkness in the world but here i am a stinky guy hiking through this small village approaching this uh elderly lady and asking for help and she just put me right in her car and took me to the church and then took me to the other house and and was just one of the angels along the way so let's be in this chapter we're going to look at equations of lines and linear equations are some of the simplest equations to solve because there are no exponents and so we often try to use these linear equations to model behavior growth or decay or shrinking because it's easier to kind of use a linear model to predict obviously not everything falls into a linear model but a lot of things can and give us at least some kind of indication of where things are headed to in the future so we're going to determine equations of lines we're going to given two different equations or equations of two lines we can determine whether their graphs are parallel or perpendicular and then we're going to model what happens in the real world so from our last section we know that the slope intercept linear equation is y equals mx plus b or f of x equals mx plus b again m is the slope and b is the y coordinate of the y-intercept and so if we know the slope and the y-intercept of a line we can then find the equation of the line using this formula so we're going to go backwards last time we had an equation and we figured out the slope and the intercept now we're going to go the other so we have a line that has a slope of negative 7 9 and the y-intercept of 0 16. [Music] find the equation of a line well remember um we know that the slope is negative 7 9. so we substitute that in for m we know the y value of the intercept is 16. so we substitute that in for b and into our point-slope formula and now we're done this is the equation of the line if we wanted the functional equation we would just substitute in f of x for y so we're just going the other direction from what we did before i went through that pretty quickly so you can rewind if you need i'm not going to stop [Music] because they can get a little more complicated for example let's say a line has a slope of negative two thirds and contains the point negative three six so now we have a slope and a point we don't have the y-intercept and so that's really what we're going to try to figure out we can use the slope for m in our equation but notice we still have to figure out the the b and we now have three variables in there we have an x a y and a b well since we were given a point we have an x value which is negative 3 which we can plug in here we have a y value which is 6 which we can plug in for y and then calculate the value of b so it's pretty straightforward instead of just it's not as easy as the last one but it's not so difficult so now let's plug in negative 3 for x and 6 for y and let's solve this for b so we get 6 equals 2 plus b i'm not going to do the algebra here you can look at that and if you have questions contact me and so we get the value of b is 4. so now we go back to our original point-slope equation and just substitute this 4 in for b and we have our equation of the line okay so if we have the slope and the y-intercept that's the easiest form to get an equation of the line that was the first example but if we also have a slope and a point we can use this same formula plugging in the slope the x and the y and calculating b and then using the slope and the calculated b to do the equation of the line the slope to figure out what the slope is and also to figure out the equation of so if we want to find the equation of the line and we're given two points the first thing we want to do is to is to find the slope well that's pretty simple right the difference in y's over the difference in x's y2 minus y1 over x2 minus x1 or um rise over run okay and again i'm not going to do this calculation you can look at the two points we've done enough of these hopefully that you can see that and so we get a slope of seven okay now we could do what we did in the last example and just use the slope of seven and one point it didn't matter which one we could use either a point and put it into our slope intercept formula calculate b and then substitute it back in but we can also just use the point-slope equation y minus y1 equals m times x minus x1 and substitute one point either one it doesn't matter into this equation and the slope and we'll already have the equation of the line so we get y minus 3 so we're using this first point there's our y our x is going to be 2 equals 7 which is the slope times x minus 2. now we're going to go ahead and simplify this and to solve for y so we get by doing distribution 7x minus 14 and then add 3 to both sides and we get y equals 7x minus 11. which again is a good way to check because we can see that our slope is 7 and indeed our slope is 7 here so we're in good shape okay so if we're given two points we first find the slope and then we can use this point slope equation just plug it in and solve for y and we can get the equation of the line again or we can find the slope and then go back to the slope-intercept use one point solve for b and then plug that in like we did in the last example if i'm talking too fast remember you can watch it again you can pause you can try these problems etc [Music] so vertical lines are parallel right we know that and non-vertical lines like the example you see on the right are parallel if and only if they have the same slope and different y-intercepts so you can see here these two equations 2x and 2x so they both have a slope of 2 but they have different y-intercepts the top one in in red crosses at 4 the bottom one in green crosses at negative three so non-vertical lines are parallel if and only if they have the same slope and different y interce okay two lines with slopes m1 and m2 are perpendicular if and only if the product of their slopes is negative one so the slope of here is negative one-half the slope here is two two times negative one-half equals negative one another thing you might notice which might make it a little bit easier is notice that the slopes are opposite reciprocals two and negative one half perpendicular lines have slopes which are opposite reciprocals perpendicular lines have slopes which are opposite reciprocal of course lines are also perpendicular if one is vertical x equals a constant and the other is horizontal y equals a constant and you can see that here determine whether each of the following pair of lines is parallel perpendicular or neither so probably the easiest thing for us to do here is we have to figure out the slope is so to rewrite both of these equations in terms of y so solve the equations for y the first equation is pretty easy because all we have to do is subtract two from both sides and we get y equals five x minus two and we can see here that we have a slope of five on the other equation we're first going to subtract x from both sides we get negative x minus 15 and then we're going to multiply both sides by one-fifth and so i get negative one-fifth x minus 1 5 times 15 is negative 3 okay and so here i have a slope of negative one-fifth so i compare the slopes a slope of 5 a slope of negative one-fifth they are not the same so they are not parallel if they're perpendicular they are opposite signs positive negative indeed and reciprocals five and one-fifth indeed so these two lines are perpendicular okay because the slope of 5 and negative 1 5th is are negative reciprocals okay and so when you're given these equations and trying to figure out whether they're parallel perpendicular or not solve for y and find the slope solve the y and find the slope you're always comparing slopes to determine parallel so let's try it again this is a good place for you to pause and try this on your own and see what you come up with so just hit the pause solve both of these equations for y and see how you do just a good practice shouldn't take you more than a minute or two i'm not going to go through the algebra here i'm going to let you do it and so here i can see i have a slope of the first equation is negative 2. the slope of the second equation is also negative two since the slopes are the same the lines are parallel let's try it again again pause and do it on your own i'm not going to go through the algebra i'm just going to walk through this pretty quickly so if you want to try this problem which is a good idea go ahead and pause and do it on your paper and then hit play again i have a slope of 2 in the first equation i have a slope of negative 3 in the second equation they are not the same so they're not parallel they are opposites positive and negative but they are not reciprocals so these lines um the slopes aren't the same the product is not negative one they're not opposite reciprocals so they are neither parallel nor perpendicular so another way to do this another type of problem that you're going to see in this section is when we want to find a line perpendicular or parallel to a given line so we have a given line 4y minus x equals 20 and also we have a point on this other line and it contains the point 2 negative 3. we want to find two different lines we want to find one line that's parallel and we want to find one line that's perpendicular both of those going through this point 2 negative 3. okay so the first thing we need to do is to figure out the slope of this line and then we know that the slope of the parallel line is the same the slope of the perpendicular line will be the opposite reciprocal so let's first again solve this equation for y we add x to both sides we divide or multiply both sides by 1 4 and we get this equation so the slope of our original equation is 1 4 okay so the slope of our parallel line will also be 1 4 and then we have an x and a y remember we just did this exercise so with a slope and a point we can find the parallel line the equation of the parallel line the slope of the perpendicular line will be the opposite so it'll be negative and it'll be the reciprocal so it'll be negative 4. again we have negative 4 in the same x and y and we'll figure out that sorry now let's do the same thing i keep doing that i apologize and we have the equation of the perpendicular line okay again i've gone through those because we've done several examples i went through the math part pretty quickly but the joy of the video is you can go back rewind and listen again or you can even slow me down so that i talk like this although i have a lot of students who tell me they do the exact opposite especially when it's a long lecture they speed it up and i sound like a gopher all right now why do we do all this stuff and i know you say you have that question all the time and i even see shirts like hey another day has gone by and i didn't use algebra that's oh excuse me that's bull we use math all the time and we use algebra a lot when we're trying to figure out an unknown quantity you will use this in business you will use this in engineering and science and prediction etc and one way we do that is what's called mathematical modeling when we can create an equation to model what's happening with data over time or over some kind of input that allows us to predict um what will happen later at a later date or when we produce so many more widgets or whatever if the predictions are inaccurate or the results of experimentation do not conform to the model then we have to either get rid of the model or change the model okay and modeling typically is a very much of an ongoing process because things are changing constantly and very rarely do linear models for a long period of time in general we try to find a function that fits as well as possible we look at observations or the data we use some common sense and and some thoughtful reasoning to how we can find a model and we call this curve fitting it is one aspect of mathematical model here we're going to do the simplest version which is just using a linear model we can get to you know as you go up in your math ability and in fact math majors are one of the um most likely to get hired out of a four-year bachelor's degree because of things like modeling and and because of technology data is so rich there's so much data that companies need people who can figure out how to make that data make sense for other people okay so we're going to look at something specifically called a scatter plot and see if a linear model will work so a scatter plot is just when you plot all the points of data and then you kind of see what kind of shape it's taking is it going up and down like a mountain range is it just kind of sliding up etc this scatter plot on the right here is pretty linear you know it's pretty it's increasing consistently it's not exactly a straight line but a linear model would be a good model for this a linear equation would be a good model for this so this is the model of the gross domestic product of a country and this is the market value of final goods and service produced okay the market value depends on the quantity of goods and services and their price okay and so what we have here is the gross domestic products over a number of years and specifically from 1980 to 2008 and instead of putting those on there 1980 we're going to use an index this is called an index so we're saying when x equals 0 that equals 1980. five years later x would be five but that represents the year 1985. this allows us to have a much simpler equation when we're just doing the number of years from 1980 and that's very very common in modeling to have an index that 1980 equals zero it's also very common for students to make a mistake and instead of plugging in 0 for 1980 they plug in 1980 instead of using the index okay so what are we going to do here we want to model the data in the table below on the u.s gross domestic product that's here over here we want to model this data using a linear function okay so all this is asking me to do or you to do is to create a linear equation based upon this chart and notice what we have here is an x value and a y value and what have we been doing we've been figuring out how to find make a linear equation if we have two points okay and then we're going to estimate the gross domestic product in 2012. well our model only goes up our data excuse me only goes up to 2008 so we need the data from four years later 2008 is 28 2012 would be four years later or x equals 32. so be careful with that don't plug in 2012 when you get your equation remember that we're using an index so we can really choose any two data points to make the linear equation in this case we're going to use 5 4.2 which is the the data in 1985 5 4.2 and we're also going to use data from later on uh 25 and 12.6 this is the data from 2005. so notice we have an x and a y and an x and a y and now all we're going to do is write that linear equation our model is the linear equation okay so just like we did before we're going to find the slope y2 minus y1 from those points over x2 minus x1 and then we're going to use the slope and one of the points we're going to use the 5 4.2 why do we use that it's smaller numbers they're easier to calculate we won't have such a big calculation potentially okay so we plug it into our point-slope formula y minus y1 from the last example equals m the slope times x minus x1 we do the math we multiply by .42 we add 4.2 and we get our equation okay we do not forget that x is the number of years after 1980 and y is in trillions of dollars and so you can see here here's the equation of our line superimposed on the scatter plot you can see it's a pretty good representation sometimes they're below sometimes they're above etcetera but we're going in a general linear fashion this is the model this is the answer to the question this is our linear model y equals 0.42x plus 2.1 okay so if i wanted to figure out the gross domestic product remember in 2012 i'm going to use the linear equation that we figured out and simply plug in 32 okay it's 15.54 if you leave that as the answer on the test you will get it wrong 15.54 what 15.54 trillion dollars is our gross national product in 2012. this is the end of our lecture for uh 1.4 i hope you enjoyed that and saw some real life applications here and don't wear that t-shirt that says you don't use algebra have a great day oh sorry there's some