In the previous section we discussed how mathematical models are sketches of the natural world. While we can never "get over" on this fundamental fact and make a mathematical model that is reality, that doesn't mean we can't learn a few tools for improving our sketches. [br][br]To that end, we're going to study the concept of the [b]domain[/b] of a function, which offers one way of improving functional models such as the ones you created earlier in this book. For instance, in the previous section we talked about how our model of the height of a projectile from the [url=https://www.geogebra.org/m/x39ys4d7#material/aayx7rmz]start[/url] and the [url=https://www.geogebra.org/m/x39ys4d7#material/yqenataa]end[/url] of the book really shouldn't extend to the left of the y-axis, or below the x-axis. The concept of a [b]domain[/b] will help us amend this. Similarly, when we studied [url=https://www.geogebra.org/m/x39ys4d7#material/mfrgtcpe]absolute maximums and minimums on a closed interval[/url], we were restricting the function to a certain [b]domain[/b]. [br][br][b]Definition:[/b] The [b]domain[/b] of a function is a restriction of the possible inputs of the function. [br][br]So in the last applet in [url=https://www.geogebra.org/m/x39ys4d7#material/yqenataa]Falling Stuff on Earth[/url], the [b]domain[/b] of [code]s(x)[/code] should be only those x values that are greater than 0 and less than the x-coordinate of [code]SPLAT![/code] [br][br]You can specify domain in Geogebra by using an [code]if([/code] conditional statement. For instance, you can restrict [code]s(x)=-4.9x^2+297.85x+616.06[/code] to those x values greater than 0 and less than 62.79 with the following code:[br][br][code]If(0 < x < 62.79, -4.9x^2 + 297.85x + 616.06)[/code][br][br]Try it out below.
The best way to think of this code is as you should think about any function: as a computer program (you can go back and review this way of thinking about functions [url=https://www.geogebra.org/m/x39ys4d7#material/w6bgqy3u]here[/url] and [url=https://www.geogebra.org/m/x39ys4d7#material/ftvamrcu]here[/url]). [br][br][list][*]On the left,[code] s(x)[/code] is giving the function the name [code]s[/code].[br][/*][*]On the right is the code for how the function works[/*][*]In the code on the right, the "[code]if("[/code] is computer programming construct called a conditional. [/*][/list]The way[code] if([/code] conditionals work is that if the statement before the first comma is true, then the computer will do whatever is instructed after the comma. So in our case, if x is greater than 0 and less than 62.79, then the if command will plot [code]-4.9x^2+297.85x+616.06[/code]. [br][br]As you can see in the applet, this has the effect of plotting only the desired portion of [code]s(x)[/code] which is above the x-axis and right of the y-axis. [br][br]You can read more about the [code]if( [/code]conditional in Geogebra in the [url=https://wiki.geogebra.org/en/If_Command]Geogebra manual[/url].[br][br]If you ever want to restrict a function, for example [code]f(x)=x^2[/code] to a domain, just use an [code]if([/code] conditional as we did above.[br][br]You may remember a similar concept from your earlier math classes called the [b]range[/b]. We won't be discussing range in this book. I'm on a crusade against that topic. The correct concepts of range and codomain show up in advanced math classes, but the simplification of just the range has no place in an introductory calculus course.