{"id":65,"date":"2019-09-09T21:19:45","date_gmt":"2019-09-09T21:19:45","guid":{"rendered":"https:\/\/courses.lumenlearning.com\/mathmodeling\/?post_type=chapter&#038;p=65"},"modified":"2019-10-01T18:18:21","modified_gmt":"2019-10-01T18:18:21","slug":"piecewise-linear-functions","status":"publish","type":"chapter","link":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/chapter\/piecewise-linear-functions\/","title":{"raw":"Piecewise Linear Functions","rendered":"Piecewise Linear Functions"},"content":{"raw":"<div class=\"textbox learning-objectives\">\r\n<h3>Learning Objectives<\/h3>\r\n<ul>\r\n \t<li>Introduction to piecewise functions\r\n<ul>\r\n \t<li>Define piecewise function<\/li>\r\n \t<li>Evaluate a piecewise function<\/li>\r\n \t<li>Write a piecewise function given an application<\/li>\r\n<\/ul>\r\n<\/li>\r\n \t<li>Graph Piecewise Functions\r\n<ul>\r\n \t<li>Given a piecewise-defined function, sketch a graph<\/li>\r\n \t<li>Write the domain and range of a piecewise function given a graph<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<\/div>\r\nSome functions come in pieces. In this section, we will learn about how to define and graph functions that are essentially collections of discrete pieces. \u00a0Examples of something defined this way include designing the profile of a car, figuring out your mobile phone plan, and calculating\u00a0income tax rates. \u00a0For example, your tax rate depends on your income and is the same for a range of incomes, as is shown in the table below:\r\n<table class=\"wikitable\">\r\n<tbody>\r\n<tr>\r\n<th width=\"70\">Marginal Tax Rate<\/th>\r\n<th width=\"180\">Single Taxable Income<\/th>\r\n<th width=\"180\">Married Filing Jointly or Qualified Widow(er) Taxable Income<\/th>\r\n<th width=\"180\">Married Filing Separately Taxable Income<\/th>\r\n<th width=\"180\">Head of Household Taxable Income<\/th>\r\n<\/tr>\r\n<tr>\r\n<th>10%<\/th>\r\n<td>$0 \u2013 $9,275<\/td>\r\n<td>$0 \u2013 $18,550<\/td>\r\n<td>$0 \u2013 $9,275<\/td>\r\n<td>$0 \u2013 $13,250<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>15%<\/th>\r\n<td>$9,276 \u2013 $37,650<\/td>\r\n<td>$18,551 \u2013 $75,300<\/td>\r\n<td>$9,276 \u2013 $37,650<\/td>\r\n<td>$13,251 \u2013 $50,400<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>25%<\/th>\r\n<td>$37,651 \u2013 $91,150<\/td>\r\n<td>$75,301 \u2013 $151,900<\/td>\r\n<td>$37,651 \u2013 $75,950<\/td>\r\n<td>$50,401 \u2013 $130,150<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>28%<\/th>\r\n<td>$91,151 \u2013 $190,150<\/td>\r\n<td>$151,901 \u2013 $231,450<\/td>\r\n<td>$75,951 \u2013 $115,725<\/td>\r\n<td>$130,151 \u2013 $210,800<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>33%<\/th>\r\n<td>$190,151 \u2013 $413,350<\/td>\r\n<td>$231,451 \u2013 $413,350<\/td>\r\n<td>$115,726 \u2013 $206,675<\/td>\r\n<td>$210,801 \u2013 $413,350<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>35%<\/th>\r\n<td>$413,351 \u2013 $415,050<\/td>\r\n<td>$413,351 \u2013 $466,950<\/td>\r\n<td>$206,676 \u2013 $233,475<\/td>\r\n<td>$413,351 \u2013 $441,000<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>39.6%<\/th>\r\n<td>$415,051+<\/td>\r\n<td>$466,951+<\/td>\r\n<td>$233,476+<\/td>\r\n<td>$441,001+<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<p id=\"fs-id1165137863778\">A <strong>piecewise function<\/strong> is a function in which more than one formula is used to define the output over different pieces of the domain.<\/p>\r\n<p id=\"fs-id1165134042316\">We use piecewise functions to describe situations in which a rule or relationship changes as the input value crosses certain \"boundaries.\" For example, we often encounter situations in business for which the cost per piece of a certain item is discounted once the number ordered exceeds a certain value. Tax brackets are another real-world example of piecewise functions. For example, consider a simple tax system in which incomes up to $10,000 are taxed at 10%, and any additional income is taxed at 20%. The tax on a total income, S, would be\u00a00.1S if [latex]S\\le[\/latex] $10,000\u00a0and 1000 + 0.2 (S - $10,000),\u00a0if S&gt; $10,000.<\/p>\r\n\r\n<div class=\"textbox shaded\">\r\n<h3 class=\"title\" data-type=\"title\">Piecewise Function<\/h3>\r\n<p id=\"fs-id1165135504970\">A piecewise function is a function in which more than one formula is used to define the output. Each formula has its own domain, and the domain of the function is the union of all these smaller domains. We notate this idea like this:<\/p>\r\n[latex] f\\left(x\\right)=\\begin{cases}\\text{formula 1 if x is in domain 1}\\\\ \\text{formula 2 if x is in domain 2}\\\\ \\text{formula 3 if x is in domain 3}\\end{cases} [\/latex]\r\n\r\nIn piecewise notation, the absolute value function is\r\n<div id=\"fs-id1165135190749\" class=\"equation unnumbered\" data-type=\"equation\" data-label=\"\">[latex]|x|=\\begin{cases}x\\text{ if }x\\ge 0\\\\ -x\\text{ if }x&lt;0\\end{cases}[\/latex]<\/div>\r\n<\/div>\r\n<h2>Evaluate a Piecewise Defined Function<\/h2>\r\nIn the\u00a0first example, we will show how to evaluate a piecewise defined function. \u00a0Note how it is important to pay attention to the domain to determine which expression to use to evaluate the input.\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nGiven the function\r\n<p style=\"text-align: center;\">[latex]f(x)=\\begin{cases}7x+3\\text{ if }x&lt;0\\\\7x+6\\text{ if }x\\ge{0}\\end{cases}[\/latex],<\/p>\r\nevaluate:\r\n<ol>\r\n \t<li>[latex]f (-1)[\/latex]<\/li>\r\n \t<li>[latex]f (0)[\/latex]<\/li>\r\n \t<li>[latex]f (2)[\/latex]<\/li>\r\n<\/ol>\r\n[reveal-answer q=\"3861\"]Show Answer[\/reveal-answer]\r\n[hidden-answer a=\"3861\"]\r\n\r\n1.[latex]f(x)[\/latex] is defined as [latex]7x+3[\/latex] for [latex]x=-1\\text{ becuase }-1&lt;0[\/latex].<span style=\"line-height: 1.5;\">\u00a0\u00a0<\/span>\r\n\r\nEvaluate: [latex]f(-1)=7(-1)+3=-7+3=-4[\/latex]\r\n\r\n2. [latex]f(x)[\/latex] is defined as [latex]7x+6[\/latex] for [latex]x=0\\text{ becuase }0\\ge{0}[\/latex].\r\n\r\nEvaluate: [latex]f(0)=7(0)+6=0+6=6[\/latex]\r\n\r\n3.\u00a0[latex]f(x)[\/latex] is defined as [latex]7x+6[\/latex] for [latex]x=2\\text{ becuase }2\\ge{0}[\/latex].\r\n\r\nEvaluate: [latex]f(2)=7(2)+6=14+6=20[\/latex]\r\n\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\nIn the following video we show how to evaluate several values given a piecewise defined function.\r\n\r\nhttps:\/\/youtu.be\/E2F2-gP-2qU\r\n\r\nIn the next example we show how to evaluate a function that models the cost of data transfer for a phone company.\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\n<p id=\"fs-id1165137938645\">A cell phone company uses the function below to determine the cost, [latex]C[\/latex], in dollars for [latex]g[\/latex] gigabytes of data transfer.<\/p>\r\n\r\n<div id=\"fs-id1165137660470\" class=\"equation unnumbered\" data-type=\"equation\" data-label=\"\">[latex]C\\left(g\\right)=\\begin{cases}{25}\\text{ if }{ 0 }&lt;{ g }&lt;{ 2 }\\\\ 10g+5\\text{ if }{ g}\\ge{ 2 }\\end{cases}[\/latex]<\/div>\r\n<p id=\"fs-id1165135193798\">Find the cost of using 1.5 gigabytes of data and the cost of using 4 gigabytes of data.<\/p>\r\n[reveal-answer q=\"686763\"]Show Answer[\/reveal-answer]\r\n[hidden-answer a=\"686763\"]\r\n<p id=\"fs-id1165134373545\">To find the cost of using 1.5 gigabytes of data, C(1.5), we first look to see which part of the domain our input falls in. Because 1.5 is less than 2, we use the first formula.<\/p>\r\nC(1.5) = $25\r\n<p id=\"fs-id1165135440213\">To find the cost of using 4 gigabytes of data, C(4), we see that our input of 4 is greater than 2, so we use the second formula.<\/p>\r\n\r\n<div>[latex]C(4)=10(4)+5=45[\/latex]<\/div>\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<h3 data-type=\"title\">Analysis of the Solution<\/h3>\r\nThe function is represented in\u00a0the graph below. We can see where the function changes from a constant to a line with a positive slope\u00a0at [latex]g=2[\/latex]. We plot the graphs for the different formulas on a common set of axes, making sure each formula is applied on its proper domain.\r\n\r\n[caption id=\"\" align=\"aligncenter\" width=\"487\"]<img src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images-archive-read-only\/wp-content\/uploads\/sites\/924\/2015\/11\/25200643\/CNX_Precalc_Figure_01_02_0222.jpg\" alt=\"Graph of C(g)\" width=\"487\" height=\"296\" data-media-type=\"image\/jpg\" \/> <b>C(g) =\u00a0<\/b>[latex]C\\left(g\\right)=\\begin{cases}{25}\\text{ if }{ 0 }&lt;{ g }&lt;{ 2 }\\\\ 10g+5\\text{ if }{ g}\\ge{ 2 }\\end{cases}[\/latex][\/caption]\r\n<h2>\u00a0Write a Piecewise Defined Function<\/h2>\r\nIn the last\u00a0example we will show how to write a piecewise defined function that models the price of a guided museum tour.\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nA museum charges $5 per person for a guided tour with a group of 1 to 9 people or a fixed $50 fee for a group of 10 or more people. Write a <strong>function<\/strong> relating the number of people, [latex]n[\/latex], to the cost, [latex]C[\/latex].\r\n[reveal-answer q=\"177587\"]Show Answer[\/reveal-answer]\r\n[hidden-answer a=\"177587\"]\r\n\r\nTwo different formulas will be needed. For <em data-effect=\"italics\">n<\/em>-values under 10, C=5n. For values of n that are 10 or greater, C=50.\r\n\r\nC(n)=[latex]\\begin{cases}{5n}\\text{ if }{0}&lt;{n}&lt;{10}\\\\ 50\\text{ if }{n}\\ge 10\\end{cases}[\/latex]\r\n\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<h2>Analysis of the Solution<\/h2>\r\nThe function is represented in Figure 21. The graph is a diagonal line from [latex]n=0[\/latex] to [latex]n=10[\/latex] and a constant after that. In this example, the two formulas agree at the meeting point where [latex]n=10[\/latex], but not all piecewise functions have this property.\r\n\r\n<img class=\"aligncenter\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images-archive-read-only\/wp-content\/uploads\/sites\/924\/2015\/11\/25200641\/CNX_Precalc_Figure_01_02_0212.jpg\" alt=\"Graph of C(n).\" width=\"360\" height=\"294\" data-media-type=\"image\/jpg\" \/>\r\n\r\nIn the following video we show an example of writing a piecewise defined function given a scenario.\r\n\r\nhttps:\/\/youtu.be\/58mEZ4mEnUI\r\n<div class=\"textbox shaded\">\r\n<h3>Given a piecewise function, write the formula and identify the domain for each interval.<strong>\r\n<\/strong><\/h3>\r\n<ol id=\"fs-id1165135443772\" data-number-style=\"arabic\">\r\n \t<li>Identify the intervals for which different rules apply.<\/li>\r\n \t<li>Determine formulas that describe how to calculate an output from an input in each interval.<\/li>\r\n \t<li>Use braces and if-statements to write the function.<\/li>\r\n<\/ol>\r\n<\/div>\r\n<h2>Graph Piecewise Functions<\/h2>\r\nIn this section, we will plot piecewise functions. The function plotted below represents the cost to transfer data for a given cell phone company.\u00a0We can see where the function changes from a constant to a line with a positive slope\u00a0at [latex]g=2[\/latex]. When we plot piecewise functions, it is important to make sure each formula is applied on its proper domain.[latex]C\\left(g\\right)=\\begin{cases}{25} \\text{ if }{ 0 }&lt;{ g }&lt;{ 2 }\\\\10g+5\\text{ if }{ g}\\ge{ 2 }\\end{cases}[\/latex]\r\n\r\nIn this case, the output is 25 for any input between 0 and 2. \u00a0For values equal to or greater than 2, the output is defined as [latex]10g+5[\/latex].\r\n\r\n<img src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images-archive-read-only\/wp-content\/uploads\/sites\/924\/2015\/11\/25200643\/CNX_Precalc_Figure_01_02_0222.jpg\" alt=\"Graph of C(g)\" width=\"487\" height=\"296\" data-media-type=\"image\/jpg\" \/>\r\n<div class=\"textbox shaded\">\r\n<h3 id=\"fs-id1165135532516\">Given a piecewise function, sketch a graph.<\/h3>\r\n<ol id=\"fs-id1165137588539\" data-number-style=\"arabic\">\r\n \t<li>Indicate on the <em data-effect=\"italics\">x<\/em>-axis the boundaries defined by the intervals on each piece of the domain.<\/li>\r\n \t<li>For each piece of the domain, graph on that interval using the corresponding equation pertaining to that piece. Do not graph two functions over one interval because it would violate the criteria of a function.<\/li>\r\n<\/ol>\r\n<\/div>\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nSketch a graph of the function.\r\n\r\nGiven the piecewise definition [latex]f(x)=\\begin{cases}\u2212x \u2212 3\\text{ if }x &lt; \u22123\\\\ x + 3\\text{ if } x \\ge \u22123\\end{cases}[\/latex]\r\nDraw the graph of f.\r\nState the domain and range of the function.\r\n[reveal-answer q=\"895830\"]Show Answer[\/reveal-answer]\r\n[hidden-answer a=\"895830\"]\r\n\r\nFirst, graph the line [latex]f(x) = \u001a\u2212x\u22123[\/latex], erasing the part where x is greater than -3. Place an open circle at (-3,0).\r\n\r\n<img class=\"size-medium wp-image-2032 aligncenter\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/121\/2016\/07\/01000356\/Screen-Shot-2016-06-30-at-5.02.40-PM-300x212.png\" alt=\"Graph of the line f(x)=-3-x with the restriction x&lt;-3\" width=\"300\" height=\"212\" \/>\r\n\r\nNow place the line [latex]f(x) = \u001ax+3[\/latex] on the graph, starting at the point (-3,0). Note that for this portion of the graph, the point (-3,0) is included, so you can remove the open circle.\r\n\r\n<img class=\"size-medium wp-image-2034 aligncenter\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/121\/2016\/07\/01001119\/Screen-Shot-2016-06-30-at-5.10.38-PM-300x240.png\" alt=\"graph of the line f(x)=-x-3 and f(x) = x+3 \" width=\"300\" height=\"240\" \/>\r\n\r\nThe two graphs meet at the point (-3,0)\r\n\r\nThe domain of this function is all real numbers because (-3,0)is not included as the endpoint of [latex]f(x) = \u001a\u2212x\u22123[\/latex], but it is included as the endpoint for\u00a0[latex]f(x) = \u001ax+3[\/latex].\r\n\r\nThe range of this function starts at [latex]f(x)=0[\/latex] and includes 0, \u00a0and goes to infinity, so we would write this as [latex]x\\ge0[\/latex][\/hidden-answer]\r\n\r\n<\/div>\r\nIn the next example, we will graph a piecewise defined function that\u00a0models the cost of shipping for an online comic book retailer.\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\nAn on-line comic book retailer charges shipping costs according to the following formula\r\n\r\n[latex]S(n)=\\begin{cases}1.5n+2.5\\text{ if }1\\le{n}\\le14\\\\0\\text{ if }n\\ge15\\end{cases}[\/latex]\r\n\r\nDraw a graph of the cost function.\r\n[reveal-answer q=\"688588\"]Show Answer[\/reveal-answer]\r\n[hidden-answer a=\"688588\"]\r\n\r\nFirst, draw the line\u00a0[latex]S(n)=1.5n+2.5[\/latex]. \u00a0We can use transformations: this is a vertical stretch of the identity by a factor of 1.5, and a vertical shift by 2.5.\r\n\r\n[caption id=\"attachment_2265\" align=\"aligncenter\" width=\"415\"]<img class=\" wp-image-2265\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/121\/2016\/07\/07200231\/Screen-Shot-2016-07-07-at-12.58.26-PM-283x300.png\" alt=\"S(n)=1.5n+2.5\" width=\"415\" height=\"440\" \/> S(n)=1.5n+2.5[\/caption]\r\n\r\nNow we can eliminate the portions of the graph that are not in the domain based on [latex]1\\le{n}\\le14[\/latex]\r\n\r\n[caption id=\"attachment_2266\" align=\"aligncenter\" width=\"424\"]<img class=\" wp-image-2266\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/121\/2016\/07\/07200537\/Screen-Shot-2016-07-07-at-1.05.03-PM-261x300.png\" alt=\"S(n) = 1.5n+2.5 for 1&lt;=n&lt;=14\" width=\"424\" height=\"488\" \/> S(n) = 1.5n+2.5 for 1&lt;=n&lt;=14[\/caption]\r\n\r\nLast, add the constant function S(n)=0 for inputs greater than or equal to 15. Place closed dots on the ends of the graph to indicate the\u00a0inclusion of the end points.\r\n\r\n<img class=\"wp-image-2268 aligncenter\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/121\/2016\/07\/07201300\/Screen-Shot-2016-07-07-at-1.09.58-PM-272x300.png\" alt=\"Screen Shot 2016-07-07 at 1.09.58 PM\" width=\"439\" height=\"484\" \/>\r\n\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\nIn the following video we show how to graph a piecewise defined function which is linear over both domains.\r\n\r\nhttps:\/\/youtu.be\/B1jfpiI-QQ8\r\n<h2><\/h2>\r\n<h2>Summary<\/h2>\r\n<ul>\r\n \t<li>A <strong>piecewise function<\/strong> is a function in which more than one formula is used to define the output over different pieces of the domain.<\/li>\r\n \t<li>Evaluating a piecewise function means you need to pay close attention to the correct expression used for the given input<\/li>\r\n<\/ul>\r\nTo graph piecewise functions, first identify where the domain is divided. \u00a0Graph functions on the domain using tools such as plotting points, or transformations. Be careful to use open or closed circles on the endpoints of each domain based on whether the endpoint is included.\r\n\r\n&nbsp;\r\n<h2><\/h2>\r\n&nbsp;","rendered":"<div class=\"textbox learning-objectives\">\n<h3>Learning Objectives<\/h3>\n<ul>\n<li>Introduction to piecewise functions\n<ul>\n<li>Define piecewise function<\/li>\n<li>Evaluate a piecewise function<\/li>\n<li>Write a piecewise function given an application<\/li>\n<\/ul>\n<\/li>\n<li>Graph Piecewise Functions\n<ul>\n<li>Given a piecewise-defined function, sketch a graph<\/li>\n<li>Write the domain and range of a piecewise function given a graph<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<p>Some functions come in pieces. In this section, we will learn about how to define and graph functions that are essentially collections of discrete pieces. \u00a0Examples of something defined this way include designing the profile of a car, figuring out your mobile phone plan, and calculating\u00a0income tax rates. \u00a0For example, your tax rate depends on your income and is the same for a range of incomes, as is shown in the table below:<\/p>\n<table class=\"wikitable\">\n<tbody>\n<tr>\n<th style=\"width: 70px;\">Marginal Tax Rate<\/th>\n<th style=\"width: 180px;\">Single Taxable Income<\/th>\n<th style=\"width: 180px;\">Married Filing Jointly or Qualified Widow(er) Taxable Income<\/th>\n<th style=\"width: 180px;\">Married Filing Separately Taxable Income<\/th>\n<th style=\"width: 180px;\">Head of Household Taxable Income<\/th>\n<\/tr>\n<tr>\n<th>10%<\/th>\n<td>$0 \u2013 $9,275<\/td>\n<td>$0 \u2013 $18,550<\/td>\n<td>$0 \u2013 $9,275<\/td>\n<td>$0 \u2013 $13,250<\/td>\n<\/tr>\n<tr>\n<th>15%<\/th>\n<td>$9,276 \u2013 $37,650<\/td>\n<td>$18,551 \u2013 $75,300<\/td>\n<td>$9,276 \u2013 $37,650<\/td>\n<td>$13,251 \u2013 $50,400<\/td>\n<\/tr>\n<tr>\n<th>25%<\/th>\n<td>$37,651 \u2013 $91,150<\/td>\n<td>$75,301 \u2013 $151,900<\/td>\n<td>$37,651 \u2013 $75,950<\/td>\n<td>$50,401 \u2013 $130,150<\/td>\n<\/tr>\n<tr>\n<th>28%<\/th>\n<td>$91,151 \u2013 $190,150<\/td>\n<td>$151,901 \u2013 $231,450<\/td>\n<td>$75,951 \u2013 $115,725<\/td>\n<td>$130,151 \u2013 $210,800<\/td>\n<\/tr>\n<tr>\n<th>33%<\/th>\n<td>$190,151 \u2013 $413,350<\/td>\n<td>$231,451 \u2013 $413,350<\/td>\n<td>$115,726 \u2013 $206,675<\/td>\n<td>$210,801 \u2013 $413,350<\/td>\n<\/tr>\n<tr>\n<th>35%<\/th>\n<td>$413,351 \u2013 $415,050<\/td>\n<td>$413,351 \u2013 $466,950<\/td>\n<td>$206,676 \u2013 $233,475<\/td>\n<td>$413,351 \u2013 $441,000<\/td>\n<\/tr>\n<tr>\n<th>39.6%<\/th>\n<td>$415,051+<\/td>\n<td>$466,951+<\/td>\n<td>$233,476+<\/td>\n<td>$441,001+<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p id=\"fs-id1165137863778\">A <strong>piecewise function<\/strong> is a function in which more than one formula is used to define the output over different pieces of the domain.<\/p>\n<p id=\"fs-id1165134042316\">We use piecewise functions to describe situations in which a rule or relationship changes as the input value crosses certain &#8220;boundaries.&#8221; For example, we often encounter situations in business for which the cost per piece of a certain item is discounted once the number ordered exceeds a certain value. Tax brackets are another real-world example of piecewise functions. For example, consider a simple tax system in which incomes up to $10,000 are taxed at 10%, and any additional income is taxed at 20%. The tax on a total income, S, would be\u00a00.1S if [latex]S\\le[\/latex] $10,000\u00a0and 1000 + 0.2 (S &#8211; $10,000),\u00a0if S&gt; $10,000.<\/p>\n<div class=\"textbox shaded\">\n<h3 class=\"title\" data-type=\"title\">Piecewise Function<\/h3>\n<p id=\"fs-id1165135504970\">A piecewise function is a function in which more than one formula is used to define the output. Each formula has its own domain, and the domain of the function is the union of all these smaller domains. We notate this idea like this:<\/p>\n<p>[latex]f\\left(x\\right)=\\begin{cases}\\text{formula 1 if x is in domain 1}\\\\ \\text{formula 2 if x is in domain 2}\\\\ \\text{formula 3 if x is in domain 3}\\end{cases}[\/latex]<\/p>\n<p>In piecewise notation, the absolute value function is<\/p>\n<div id=\"fs-id1165135190749\" class=\"equation unnumbered\" data-type=\"equation\" data-label=\"\">[latex]|x|=\\begin{cases}x\\text{ if }x\\ge 0\\\\ -x\\text{ if }x<0\\end{cases}[\/latex]<\/div>\n<\/div>\n<h2>Evaluate a Piecewise Defined Function<\/h2>\n<p>In the\u00a0first example, we will show how to evaluate a piecewise defined function. \u00a0Note how it is important to pay attention to the domain to determine which expression to use to evaluate the input.<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>Given the function<\/p>\n<p style=\"text-align: center;\">[latex]f(x)=\\begin{cases}7x+3\\text{ if }x<0\\\\7x+6\\text{ if }x\\ge{0}\\end{cases}[\/latex],<\/p>\n<p>evaluate:<\/p>\n<ol>\n<li>[latex]f (-1)[\/latex]<\/li>\n<li>[latex]f (0)[\/latex]<\/li>\n<li>[latex]f (2)[\/latex]<\/li>\n<\/ol>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q3861\">Show Answer<\/span><\/p>\n<div id=\"q3861\" class=\"hidden-answer\" style=\"display: none\">\n<p>1.[latex]f(x)[\/latex] is defined as [latex]7x+3[\/latex] for [latex]x=-1\\text{ becuase }-1<0[\/latex].<span style=\"line-height: 1.5;\">\u00a0\u00a0<\/span><\/p>\n<p>Evaluate: [latex]f(-1)=7(-1)+3=-7+3=-4[\/latex]<\/p>\n<p>2. [latex]f(x)[\/latex] is defined as [latex]7x+6[\/latex] for [latex]x=0\\text{ becuase }0\\ge{0}[\/latex].<\/p>\n<p>Evaluate: [latex]f(0)=7(0)+6=0+6=6[\/latex]<\/p>\n<p>3.\u00a0[latex]f(x)[\/latex] is defined as [latex]7x+6[\/latex] for [latex]x=2\\text{ becuase }2\\ge{0}[\/latex].<\/p>\n<p>Evaluate: [latex]f(2)=7(2)+6=14+6=20[\/latex]<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>In the following video we show how to evaluate several values given a piecewise defined function.<\/p>\n<p><iframe loading=\"lazy\" id=\"oembed-1\" title=\"Ex:  Determine Function Values for a Piecewise Defined Function\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/E2F2-gP-2qU?feature=oembed&#38;rel=0\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>In the next example we show how to evaluate a function that models the cost of data transfer for a phone company.<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p id=\"fs-id1165137938645\">A cell phone company uses the function below to determine the cost, [latex]C[\/latex], in dollars for [latex]g[\/latex] gigabytes of data transfer.<\/p>\n<div id=\"fs-id1165137660470\" class=\"equation unnumbered\" data-type=\"equation\" data-label=\"\">[latex]C\\left(g\\right)=\\begin{cases}{25}\\text{ if }{ 0 }<{ g }<{ 2 }\\\\ 10g+5\\text{ if }{ g}\\ge{ 2 }\\end{cases}[\/latex]<\/div>\n<p id=\"fs-id1165135193798\">Find the cost of using 1.5 gigabytes of data and the cost of using 4 gigabytes of data.<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q686763\">Show Answer<\/span><\/p>\n<div id=\"q686763\" class=\"hidden-answer\" style=\"display: none\">\n<p id=\"fs-id1165134373545\">To find the cost of using 1.5 gigabytes of data, C(1.5), we first look to see which part of the domain our input falls in. Because 1.5 is less than 2, we use the first formula.<\/p>\n<p>C(1.5) = $25<\/p>\n<p id=\"fs-id1165135440213\">To find the cost of using 4 gigabytes of data, C(4), we see that our input of 4 is greater than 2, so we use the second formula.<\/p>\n<div>[latex]C(4)=10(4)+5=45[\/latex]<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 data-type=\"title\">Analysis of the Solution<\/h3>\n<p>The function is represented in\u00a0the graph below. We can see where the function changes from a constant to a line with a positive slope\u00a0at [latex]g=2[\/latex]. We plot the graphs for the different formulas on a common set of axes, making sure each formula is applied on its proper domain.<\/p>\n<div style=\"width: 497px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images-archive-read-only\/wp-content\/uploads\/sites\/924\/2015\/11\/25200643\/CNX_Precalc_Figure_01_02_0222.jpg\" alt=\"Graph of C(g)\" width=\"487\" height=\"296\" data-media-type=\"image\/jpg\" \/><\/p>\n<p class=\"wp-caption-text\"><b>C(g) =\u00a0<\/b>[latex]C\\left(g\\right)=\\begin{cases}{25}\\text{ if }{ 0 }&lt;{ g }&lt;{ 2 }\\\\ 10g+5\\text{ if }{ g}\\ge{ 2 }\\end{cases}[\/latex]<\/p>\n<\/div>\n<h2>\u00a0Write a Piecewise Defined Function<\/h2>\n<p>In the last\u00a0example we will show how to write a piecewise defined function that models the price of a guided museum tour.<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>A museum charges $5 per person for a guided tour with a group of 1 to 9 people or a fixed $50 fee for a group of 10 or more people. Write a <strong>function<\/strong> relating the number of people, [latex]n[\/latex], to the cost, [latex]C[\/latex].<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q177587\">Show Answer<\/span><\/p>\n<div id=\"q177587\" class=\"hidden-answer\" style=\"display: none\">\n<p>Two different formulas will be needed. For <em data-effect=\"italics\">n<\/em>-values under 10, C=5n. For values of n that are 10 or greater, C=50.<\/p>\n<p>C(n)=[latex]\\begin{cases}{5n}\\text{ if }{0}<{n}<{10}\\\\ 50\\text{ if }{n}\\ge 10\\end{cases}[\/latex]\n\n<\/div>\n<\/div>\n<\/div>\n<h2>Analysis of the Solution<\/h2>\n<p>The function is represented in Figure 21. The graph is a diagonal line from [latex]n=0[\/latex] to [latex]n=10[\/latex] and a constant after that. In this example, the two formulas agree at the meeting point where [latex]n=10[\/latex], but not all piecewise functions have this property.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images-archive-read-only\/wp-content\/uploads\/sites\/924\/2015\/11\/25200641\/CNX_Precalc_Figure_01_02_0212.jpg\" alt=\"Graph of C(n).\" width=\"360\" height=\"294\" data-media-type=\"image\/jpg\" \/><\/p>\n<p>In the following video we show an example of writing a piecewise defined function given a scenario.<\/p>\n<p><iframe loading=\"lazy\" id=\"oembed-2\" title=\"Determine a Basic Piecewise Defined Function\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/58mEZ4mEnUI?feature=oembed&#38;rel=0\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<div class=\"textbox shaded\">\n<h3>Given a piecewise function, write the formula and identify the domain for each interval.<strong><br \/>\n<\/strong><\/h3>\n<ol id=\"fs-id1165135443772\" data-number-style=\"arabic\">\n<li>Identify the intervals for which different rules apply.<\/li>\n<li>Determine formulas that describe how to calculate an output from an input in each interval.<\/li>\n<li>Use braces and if-statements to write the function.<\/li>\n<\/ol>\n<\/div>\n<h2>Graph Piecewise Functions<\/h2>\n<p>In this section, we will plot piecewise functions. The function plotted below represents the cost to transfer data for a given cell phone company.\u00a0We can see where the function changes from a constant to a line with a positive slope\u00a0at [latex]g=2[\/latex]. When we plot piecewise functions, it is important to make sure each formula is applied on its proper domain.[latex]C\\left(g\\right)=\\begin{cases}{25} \\text{ if }{ 0 }<{ g }<{ 2 }\\\\10g+5\\text{ if }{ g}\\ge{ 2 }\\end{cases}[\/latex]\n\nIn this case, the output is 25 for any input between 0 and 2. \u00a0For values equal to or greater than 2, the output is defined as [latex]10g+5[\/latex].\n\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images-archive-read-only\/wp-content\/uploads\/sites\/924\/2015\/11\/25200643\/CNX_Precalc_Figure_01_02_0222.jpg\" alt=\"Graph of C(g)\" width=\"487\" height=\"296\" data-media-type=\"image\/jpg\" \/><\/p>\n<div class=\"textbox shaded\">\n<h3 id=\"fs-id1165135532516\">Given a piecewise function, sketch a graph.<\/h3>\n<ol id=\"fs-id1165137588539\" data-number-style=\"arabic\">\n<li>Indicate on the <em data-effect=\"italics\">x<\/em>-axis the boundaries defined by the intervals on each piece of the domain.<\/li>\n<li>For each piece of the domain, graph on that interval using the corresponding equation pertaining to that piece. Do not graph two functions over one interval because it would violate the criteria of a function.<\/li>\n<\/ol>\n<\/div>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>Sketch a graph of the function.<\/p>\n<p>Given the piecewise definition [latex]f(x)=\\begin{cases}\u2212x \u2212 3\\text{ if }x < \u22123\\\\ x + 3\\text{ if } x \\ge \u22123\\end{cases}[\/latex]\nDraw the graph of f.\nState the domain and range of the function.\n\n\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q895830\">Show Answer<\/span><\/p>\n<div id=\"q895830\" class=\"hidden-answer\" style=\"display: none\">\n<p>First, graph the line [latex]f(x) = \u2212x\u22123[\/latex], erasing the part where x is greater than -3. Place an open circle at (-3,0).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2032 aligncenter\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/121\/2016\/07\/01000356\/Screen-Shot-2016-06-30-at-5.02.40-PM-300x212.png\" alt=\"Graph of the line f(x)=-3-x with the restriction x&lt;-3\" width=\"300\" height=\"212\" \/><\/p>\n<p>Now place the line [latex]f(x) = x+3[\/latex] on the graph, starting at the point (-3,0). Note that for this portion of the graph, the point (-3,0) is included, so you can remove the open circle.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2034 aligncenter\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/121\/2016\/07\/01001119\/Screen-Shot-2016-06-30-at-5.10.38-PM-300x240.png\" alt=\"graph of the line f(x)=-x-3 and f(x) = x+3\" width=\"300\" height=\"240\" \/><\/p>\n<p>The two graphs meet at the point (-3,0)<\/p>\n<p>The domain of this function is all real numbers because (-3,0)is not included as the endpoint of [latex]f(x) = \u2212x\u22123[\/latex], but it is included as the endpoint for\u00a0[latex]f(x) = x+3[\/latex].<\/p>\n<p>The range of this function starts at [latex]f(x)=0[\/latex] and includes 0, \u00a0and goes to infinity, so we would write this as [latex]x\\ge0[\/latex]<\/p><\/div>\n<\/div>\n<\/div>\n<p>In the next example, we will graph a piecewise defined function that\u00a0models the cost of shipping for an online comic book retailer.<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<p>An on-line comic book retailer charges shipping costs according to the following formula<\/p>\n<p>[latex]S(n)=\\begin{cases}1.5n+2.5\\text{ if }1\\le{n}\\le14\\\\0\\text{ if }n\\ge15\\end{cases}[\/latex]<\/p>\n<p>Draw a graph of the cost function.<\/p>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q688588\">Show Answer<\/span><\/p>\n<div id=\"q688588\" class=\"hidden-answer\" style=\"display: none\">\n<p>First, draw the line\u00a0[latex]S(n)=1.5n+2.5[\/latex]. \u00a0We can use transformations: this is a vertical stretch of the identity by a factor of 1.5, and a vertical shift by 2.5.<\/p>\n<div id=\"attachment_2265\" style=\"width: 425px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2265\" class=\"wp-image-2265\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/121\/2016\/07\/07200231\/Screen-Shot-2016-07-07-at-12.58.26-PM-283x300.png\" alt=\"S(n)=1.5n+2.5\" width=\"415\" height=\"440\" \/><\/p>\n<p id=\"caption-attachment-2265\" class=\"wp-caption-text\">S(n)=1.5n+2.5<\/p>\n<\/div>\n<p>Now we can eliminate the portions of the graph that are not in the domain based on [latex]1\\le{n}\\le14[\/latex]<\/p>\n<div id=\"attachment_2266\" style=\"width: 434px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2266\" class=\"wp-image-2266\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/121\/2016\/07\/07200537\/Screen-Shot-2016-07-07-at-1.05.03-PM-261x300.png\" alt=\"S(n) = 1.5n+2.5 for 1&lt;=n&lt;=14\" width=\"424\" height=\"488\" \/><\/p>\n<p id=\"caption-attachment-2266\" class=\"wp-caption-text\">S(n) = 1.5n+2.5 for 1&lt;=n&lt;=14<\/p>\n<\/div>\n<p>Last, add the constant function S(n)=0 for inputs greater than or equal to 15. Place closed dots on the ends of the graph to indicate the\u00a0inclusion of the end points.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2268 aligncenter\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/121\/2016\/07\/07201300\/Screen-Shot-2016-07-07-at-1.09.58-PM-272x300.png\" alt=\"Screen Shot 2016-07-07 at 1.09.58 PM\" width=\"439\" height=\"484\" \/><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>In the following video we show how to graph a piecewise defined function which is linear over both domains.<\/p>\n<p><iframe loading=\"lazy\" id=\"oembed-3\" title=\"Ex 2:  Graph a Piecewise Defined Function\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/B1jfpiI-QQ8?feature=oembed&#38;rel=0\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h2><\/h2>\n<h2>Summary<\/h2>\n<ul>\n<li>A <strong>piecewise function<\/strong> is a function in which more than one formula is used to define the output over different pieces of the domain.<\/li>\n<li>Evaluating a piecewise function means you need to pay close attention to the correct expression used for the given input<\/li>\n<\/ul>\n<p>To graph piecewise functions, first identify where the domain is divided. \u00a0Graph functions on the domain using tools such as plotting points, or transformations. Be careful to use open or closed circles on the endpoints of each domain based on whether the endpoint is included.<\/p>\n<p>&nbsp;<\/p>\n<h2><\/h2>\n<p>&nbsp;<\/p>\n","protected":false},"author":141992,"menu_order":4,"template":"","meta":{"_candela_citation":"[]","CANDELA_OUTCOMES_GUID":"","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-65","chapter","type-chapter","status-publish","hentry"],"part":3,"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/pressbooks\/v2\/chapters\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/wp\/v2\/users\/141992"}],"version-history":[{"count":3,"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/pressbooks\/v2\/chapters\/65\/revisions"}],"predecessor-version":[{"id":107,"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/pressbooks\/v2\/chapters\/65\/revisions\/107"}],"part":[{"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/pressbooks\/v2\/chapters\/65\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/pressbooks\/v2\/chapter-type?post=65"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/wp\/v2\/contributor?post=65"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/albanytech-mathmodeling\/wp-json\/wp\/v2\/license?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}