{"id":961,"date":"2024-04-09T17:12:20","date_gmt":"2024-04-09T17:12:20","guid":{"rendered":"https:\/\/content.one.lumenlearning.com\/calculus1\/?post_type=chapter&#038;p=961"},"modified":"2025-08-17T15:46:57","modified_gmt":"2025-08-17T15:46:57","slug":"basic-classes-of-functions-learn-it-4","status":"publish","type":"chapter","link":"https:\/\/content.one.lumenlearning.com\/calculus1\/chapter\/basic-classes-of-functions-learn-it-4\/","title":{"raw":"Basic Classes of Functions: Learn It 4","rendered":"Basic Classes of Functions: Learn It 4"},"content":{"raw":"<h2>Piecewise-Defined Functions<\/h2>\r\n<p id=\"fs-id1170573534045\">Sometimes a function is defined by different formulas on different parts of its domain. A function with this property is known as a <strong>piecewise-defined function<\/strong>.<\/p>\r\n<section class=\"textbox keyTakeaway\">\r\n<h3>piecewise-defined function<\/h3>\r\n<p>A piecewise-defined function is composed of several sub-functions, each with its own formula and domain. These segments work together to form a complete function.<\/p>\r\n<\/section>\r\n<p>The absolute value function is an example of a piecewise-defined function because the formula changes with the sign of [latex]x[\/latex]:<\/p>\r\n<div id=\"fs-id1170573534060\" class=\"equation unnumbered\" style=\"text-align: center;\">[latex]f(x)=\\begin{cases} x, &amp; x \\ge 0 \\\\ -x, &amp; x &lt; 0 \\end{cases}[\/latex]<\/div>\r\n<div>\u00a0<\/div>\r\n<p id=\"fs-id1170573439264\">Other piecewise-defined functions may be represented by completely different formulas, depending on the part of the domain in which a point falls.<\/p>\r\n<h3>Graphing Piecewise-Defined Functions<\/h3>\r\n<p>To graph a piecewise-defined function, we graph each part of the function in its respective domain, on the same coordinate system. If the formula for a function is different for [latex]x &lt; a[\/latex] and [latex]x &gt; a[\/latex], we need to pay special attention to what happens at [latex]x=a[\/latex] when we graph the function. Sometimes the graph needs to include an open or closed circle to indicate the value of the function at [latex]x=a[\/latex].<\/p>\r\n<section class=\"textbox questionHelp\">\r\n<p><b>How to: Given a Piecewise Function, Sketch a Graph.<\/b><\/p>\r\n<ol>\r\n\t<li>Split the function into its parts, one for each interval.<\/li>\r\n\t<li>Plot each section on the graph within its designated interval.<\/li>\r\n\t<li>Use open or closed circles to indicate whether the endpoints are included (closed) or excluded (open) for each interval.<\/li>\r\n\t<li>Check for smooth transitions or intentional breaks between the function\u2019s pieces. Make sure the points where the function changes are correct and that the graph matches the function\u2019s rules for those spots.<\/li>\r\n<\/ol>\r\n<\/section>\r\n<section class=\"textbox example\">\r\n<p id=\"fs-id1170573574379\">Sketch a graph of the following piecewise-defined function:<\/p>\r\n<p>[latex]f(x)=\\begin{cases} x+3, &amp; x &lt; 1 \\\\ (x-2)^2 &amp; x \\ge 1 \\end{cases}[\/latex]<\/p>\r\n<p>[reveal-answer q=\"fs-id1170573569585\"]Show Solution[\/reveal-answer]<br \/>\r\n[hidden-answer a=\"fs-id1170573569585\"]<\/p>\r\n<p id=\"fs-id1170573569585\">Graph the linear function [latex]y=x+3[\/latex] on the interval [latex](-\\infty,1)[\/latex] and graph the quadratic function [latex]y=(x-2)^2[\/latex] on the interval [latex][1,\\infty )[\/latex]. Since the value of the function at [latex]x=1[\/latex] is given by the formula [latex]f(x)=(x-2)^2[\/latex], we see that [latex]f(1)=1[\/latex]. To indicate this on the graph, we draw a closed circle at the point [latex](1,1)[\/latex]. The value of the function is given by [latex]f(x)=x+2[\/latex] for all [latex]x&lt;1[\/latex], but not at [latex]x=1[\/latex]. To indicate this on the graph, we draw an open circle at [latex](1,4)[\/latex].<\/p>\r\n\r\n[caption id=\"\" align=\"alignnone\" width=\"487\"]<img src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/2332\/2018\/01\/11202254\/CNX_Calc_Figure_01_02_011.jpg\" alt=\"&quot;An\" width=\"487\" height=\"425\" \/> Graph of f(x)[\/caption]\r\n\r\n<div class=\"wp-caption-text\">\u00a0<\/div>\r\n<p>[\/hidden-answer]<\/p>\r\n<\/section>\r\n<section class=\"textbox example\">\r\n<p id=\"fs-id1170573351805\">In a big city, drivers are charged variable rates for parking in a parking garage. They are charged [latex]$10[\/latex] for the first hour or any part of the first hour and an additional [latex]$2[\/latex] for each hour or part thereof up to a maximum of [latex]$30[\/latex] for the day. The parking garage is open from 6 a.m. to 12 midnight.<\/p>\r\n<ol id=\"fs-id1170573419044\" style=\"list-style-type: lower-alpha;\">\r\n\t<li>Write a piecewise-defined function that describes the cost [latex]C[\/latex] to park in the parking garage as a function of hours parked [latex]x[\/latex].<\/li>\r\n\t<li>Sketch a graph of this function [latex]C(x)[\/latex].<\/li>\r\n<\/ol>\r\n<p>[reveal-answer q=\"fs-id1170573583337\"]Show Solution[\/reveal-answer]<br \/>\r\n[hidden-answer a=\"fs-id1170573583337\"]<\/p>\r\n<ol id=\"fs-id1170573583337\" style=\"list-style-type: lower-alpha;\">\r\n\t<li>Since the parking garage is open [latex]18[\/latex] hours each day, the domain for this function is [latex]\\{x|0 &lt; x \\le 18\\}[\/latex]. The cost to park a car at this parking garage can be described piecewise by the function<br \/>\r\n<div id=\"fs-id1170573583373\" class=\"equation unnumbered\">[latex]C(x)=\\begin{cases} \\\\ 10, &amp; 0 &lt; x \\le 1 \\\\ 12, &amp; 1 &lt; x \\le 2 \\\\ 14, &amp; 2 &lt; x \\le 3 \\\\ 16, &amp; 3 &lt; x \\le 4 \\\\ &amp; \\vdots \\\\ 30, &amp; 10 &lt; x \\le 18 \\end{cases}[\/latex]<\/div>\r\n<\/li>\r\n\t<li>The graph of the function consists of several horizontal line segments.\r\n[caption id=\"\" align=\"aligncenter\" width=\"731\"]<img src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/2332\/2018\/01\/11202300\/CNX_Calc_Figure_01_02_013.jpg\" alt=\"An image of a graph. The x axis runs from 0 to 18 and is labeled \u201cx, hours\u201d. The y axis runs from 0 to 32 and is labeled \u201cy, cost in dollars\u201d. The function consists 11 pieces, all horizontal line segments that begin with an open circle and end with a closed circle. The first piece starts at x = 0 and ends at x = 1 and is at y = 10. The second piece starts at x = 1 and ends at x = 2 and is at y = 12. The third piece starts at x = 2 and ends at x = 3 and is at y = 14. The fourth piece starts at x = 3 and ends at x = 4 and is at y = 16. The fifth piece starts at x = 4 and ends at x = 5 and is at y = 18. The sixth piece starts at x = 5 and ends at x = 6 and is at y = 20. The seventh piece starts at x = 6 and ends at x = 7 and is at y = 22. The eighth piece starts at x = 7 and ends at x = 8 and is at y = 24. The ninth piece starts at x = 8 and ends at x = 9 and is at y = 26. The tenth piece starts at x = 9 and ends at x = 10 and is at y = 28. The eleventh piece starts at x = 10 and ends at x = 18 and is at y = 30.\" width=\"731\" height=\"457\" \/> Figure 14. Graph of parking fees vs. hours spent parked in garage.[\/caption]\r\n<\/li>\r\n<\/ol>\r\n\r\nWatch the following video to see the worked solution to this example.<center><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/iiBBHtVIk9U?controls=0&amp;start=1535&amp;end=1630&amp;autoplay=0\" width=\"750\" height=\"450\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/center>For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.\r\n\r\n<p>You can view the transcript for this video using <a href=\"https:\/\/oerfiles.s3-us-west-2.amazonaws.com\/Calculus\/Calculus1+Videos\/1.2BasicClassesOfFunctions1535to1630_transcript.txt\" target=\"_blank\" rel=\"noopener\">this link<\/a> (opens in new window).<\/p>\r\n<p>[\/hidden-answer]<\/p>\r\n<\/section>\r\n<section class=\"textbox tryIt\">\r\n<p>[ohm_question hide_question_numbers=1]287053[\/ohm_question]<\/p>\r\n<\/section>","rendered":"<h2>Piecewise-Defined Functions<\/h2>\n<p id=\"fs-id1170573534045\">Sometimes a function is defined by different formulas on different parts of its domain. A function with this property is known as a <strong>piecewise-defined function<\/strong>.<\/p>\n<section class=\"textbox keyTakeaway\">\n<h3>piecewise-defined function<\/h3>\n<p>A piecewise-defined function is composed of several sub-functions, each with its own formula and domain. These segments work together to form a complete function.<\/p>\n<\/section>\n<p>The absolute value function is an example of a piecewise-defined function because the formula changes with the sign of [latex]x[\/latex]:<\/p>\n<div id=\"fs-id1170573534060\" class=\"equation unnumbered\" style=\"text-align: center;\">[latex]f(x)=\\begin{cases} x, & x \\ge 0 \\\\ -x, & x < 0 \\end{cases}[\/latex]<\/div>\n<div>\u00a0<\/div>\n<p id=\"fs-id1170573439264\">Other piecewise-defined functions may be represented by completely different formulas, depending on the part of the domain in which a point falls.<\/p>\n<h3>Graphing Piecewise-Defined Functions<\/h3>\n<p>To graph a piecewise-defined function, we graph each part of the function in its respective domain, on the same coordinate system. If the formula for a function is different for [latex]x < a[\/latex] and [latex]x > a[\/latex], we need to pay special attention to what happens at [latex]x=a[\/latex] when we graph the function. Sometimes the graph needs to include an open or closed circle to indicate the value of the function at [latex]x=a[\/latex].<\/p>\n<section class=\"textbox questionHelp\">\n<p><b>How to: Given a Piecewise Function, Sketch a Graph.<\/b><\/p>\n<ol>\n<li>Split the function into its parts, one for each interval.<\/li>\n<li>Plot each section on the graph within its designated interval.<\/li>\n<li>Use open or closed circles to indicate whether the endpoints are included (closed) or excluded (open) for each interval.<\/li>\n<li>Check for smooth transitions or intentional breaks between the function\u2019s pieces. Make sure the points where the function changes are correct and that the graph matches the function\u2019s rules for those spots.<\/li>\n<\/ol>\n<\/section>\n<section class=\"textbox example\">\n<p id=\"fs-id1170573574379\">Sketch a graph of the following piecewise-defined function:<\/p>\n<p>[latex]f(x)=\\begin{cases} x+3, & x < 1 \\\\ (x-2)^2 & x \\ge 1 \\end{cases}[\/latex]\n\n \n\n<div class=\"qa-wrapper\" style=\"display: block\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"qfs-id1170573569585\">Show Solution<\/button><\/p>\n<div id=\"qfs-id1170573569585\" class=\"hidden-answer\" style=\"display: none\">\n<p id=\"fs-id1170573569585\">Graph the linear function [latex]y=x+3[\/latex] on the interval [latex](-\\infty,1)[\/latex] and graph the quadratic function [latex]y=(x-2)^2[\/latex] on the interval [latex][1,\\infty )[\/latex]. Since the value of the function at [latex]x=1[\/latex] is given by the formula [latex]f(x)=(x-2)^2[\/latex], we see that [latex]f(1)=1[\/latex]. To indicate this on the graph, we draw a closed circle at the point [latex](1,1)[\/latex]. The value of the function is given by [latex]f(x)=x+2[\/latex] for all [latex]x<1[\/latex], but not at [latex]x=1[\/latex]. To indicate this on the graph, we draw an open circle at [latex](1,4)[\/latex].<\/p>\n<figure style=\"width: 487px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/2332\/2018\/01\/11202254\/CNX_Calc_Figure_01_02_011.jpg\" alt=\"&quot;An\" width=\"487\" height=\"425\" \/><figcaption class=\"wp-caption-text\">Graph of f(x)<\/figcaption><\/figure>\n<div class=\"wp-caption-text\">\u00a0<\/div>\n<\/div>\n<\/div>\n<\/section>\n<section class=\"textbox example\">\n<p id=\"fs-id1170573351805\">In a big city, drivers are charged variable rates for parking in a parking garage. They are charged [latex]$10[\/latex] for the first hour or any part of the first hour and an additional [latex]$2[\/latex] for each hour or part thereof up to a maximum of [latex]$30[\/latex] for the day. The parking garage is open from 6 a.m. to 12 midnight.<\/p>\n<ol id=\"fs-id1170573419044\" style=\"list-style-type: lower-alpha;\">\n<li>Write a piecewise-defined function that describes the cost [latex]C[\/latex] to park in the parking garage as a function of hours parked [latex]x[\/latex].<\/li>\n<li>Sketch a graph of this function [latex]C(x)[\/latex].<\/li>\n<\/ol>\n<p><div class=\"qa-wrapper\" style=\"display: block\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"qfs-id1170573583337\">Show Solution<\/button><\/p>\n<div id=\"qfs-id1170573583337\" class=\"hidden-answer\" style=\"display: none\">\n<ol id=\"fs-id1170573583337\" style=\"list-style-type: lower-alpha;\">\n<li>Since the parking garage is open [latex]18[\/latex] hours each day, the domain for this function is [latex]\\{x|0 < x \\le 18\\}[\/latex]. The cost to park a car at this parking garage can be described piecewise by the function\n<div id=\"fs-id1170573583373\" class=\"equation unnumbered\">[latex]C(x)=\\begin{cases} \\\\ 10, & 0 < x \\le 1 \\\\ 12, & 1 < x \\le 2 \\\\ 14, & 2 < x \\le 3 \\\\ 16, & 3 < x \\le 4 \\\\ & \\vdots \\\\ 30, & 10 < x \\le 18 \\end{cases}[\/latex]<\/div>\n<\/li>\n<li>The graph of the function consists of several horizontal line segments.<br \/>\n<figure style=\"width: 731px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/2332\/2018\/01\/11202300\/CNX_Calc_Figure_01_02_013.jpg\" alt=\"An image of a graph. The x axis runs from 0 to 18 and is labeled \u201cx, hours\u201d. The y axis runs from 0 to 32 and is labeled \u201cy, cost in dollars\u201d. The function consists 11 pieces, all horizontal line segments that begin with an open circle and end with a closed circle. The first piece starts at x = 0 and ends at x = 1 and is at y = 10. The second piece starts at x = 1 and ends at x = 2 and is at y = 12. The third piece starts at x = 2 and ends at x = 3 and is at y = 14. The fourth piece starts at x = 3 and ends at x = 4 and is at y = 16. The fifth piece starts at x = 4 and ends at x = 5 and is at y = 18. The sixth piece starts at x = 5 and ends at x = 6 and is at y = 20. The seventh piece starts at x = 6 and ends at x = 7 and is at y = 22. The eighth piece starts at x = 7 and ends at x = 8 and is at y = 24. The ninth piece starts at x = 8 and ends at x = 9 and is at y = 26. The tenth piece starts at x = 9 and ends at x = 10 and is at y = 28. The eleventh piece starts at x = 10 and ends at x = 18 and is at y = 30.\" width=\"731\" height=\"457\" \/><figcaption class=\"wp-caption-text\">Figure 14. Graph of parking fees vs. hours spent parked in garage.<\/figcaption><\/figure>\n<\/li>\n<\/ol>\n<p>Watch the following video to see the worked solution to this example.<\/p>\n<div style=\"text-align: center;\"><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/iiBBHtVIk9U?controls=0&amp;start=1535&amp;end=1630&amp;autoplay=0\" width=\"750\" height=\"450\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n<p>For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.<\/p>\n<p>You can view the transcript for this video using <a href=\"https:\/\/oerfiles.s3-us-west-2.amazonaws.com\/Calculus\/Calculus1+Videos\/1.2BasicClassesOfFunctions1535to1630_transcript.txt\" target=\"_blank\" rel=\"noopener\">this link<\/a> (opens in new window).<\/p>\n<\/div>\n<\/div>\n<\/section>\n<section class=\"textbox tryIt\">\n<iframe loading=\"lazy\" id=\"ohm287053\" class=\"resizable\" src=\"https:\/\/ohm.lumenlearning.com\/multiembedq.php?id=287053&theme=lumen&iframe_resize_id=ohm287053&source=tnh\" width=\"100%\" height=\"150\"><\/iframe><br \/>\n<\/section>\n","protected":false},"author":15,"menu_order":14,"template":"","meta":{"_candela_citation":"[]","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"part":143,"module-header":"learn_it","content_attributions":[],"internal_book_links":[],"video_content":null,"cc_video_embed_content":{"cc_scripts":"","media_targets":[]},"try_it_collection":null,"_links":{"self":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/pressbooks\/v2\/chapters\/961"}],"collection":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/wp\/v2\/users\/15"}],"version-history":[{"count":13,"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/pressbooks\/v2\/chapters\/961\/revisions"}],"predecessor-version":[{"id":4731,"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/pressbooks\/v2\/chapters\/961\/revisions\/4731"}],"part":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/pressbooks\/v2\/parts\/143"}],"metadata":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/pressbooks\/v2\/chapters\/961\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/wp\/v2\/media?parent=961"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/pressbooks\/v2\/chapter-type?post=961"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/wp\/v2\/contributor?post=961"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus1\/wp-json\/wp\/v2\/license?post=961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}