quot;. ### Interval Notation We can also use interval notation to express the domain of a function: - $(-\infty, \infty)$ reads "from negative infinity (excluded) to positive infinity (excluded)"; - $(-\infty, 5]$ reads "from negative infinity (excluded) to $5$ (included)"; - $(-\infty, 5)\cup(-\infty, 5)$ reads "from negative infinity (excluded) to $5$ (excluded)" AND "from 5 (excluded) to positive infinity (excluded)". $()$ are used to define exclusions, $[]$ to define inclusions, and $\cup$ to define unions. ### Common Pitfalls #### Square Roots One of the cases where we know to pay attention, because it affects the domain, is that of square roots and all other even roots such as $\sqrt[4]{x}$, $\sqrt[6]{x}$,... Inputs that would make the radicant (the expression under the root) be negative cannot be part of that function's domain. For instance, taking $\sqrt{5-4x}$, we know the radicant must be equal or superior to zero, such that $5-4x\geq 0$. Solving this inequality leaves us with $x \leq \frac{-5}{-4}$. Therefore the domain of our function is $D=\left\{x | x \leq \frac{5}{4} \right\}$. #### Denominators Denominators are another kind of troublemakers when it comes to determining the domain of a function. Inputs that would make the denominator equal zero cannot be part of that function's domain, since the whole fraction expression would resolve to $undefined$, i.e. not a real number, leading the output of the function to be $undefined$ as well. ##### $f(x)=\frac{7x}{x-2}$ Here, we see the denominator must satisfy the property of $x-2 \ne 0$. Solving the inequality leaves us with the domain $D=\left\{x | x \ne 2 \right\}$. ##### $g(t)=\frac{5t}{t^3-16t}$ Since our concern is with the denominator, we write the inequality $t^3-16t \neq 0$, which can be factored as $t(t^2-16)$ and a second time as $t(t-4)(t+4)$. By the zero product property, any of the terms being $0$ would result in the whole expression evaluating to $0$, so we really need to solve $3$ inequalities, one for each factor. $ \begin{align} t \neq 0 \\ t-4 \neq 0 \Rightarrow t \neq 4 \\ t+4 \neq 0 \Rightarrow t \neq -4 \end{align} $ We are now able to write our function's domain. $ \begin{align} D=\left\{x | x \neq 0, x \neq 4, x \neq -4\right\} \end{align} $ >👉 On a side note, expressions such as $t(t^2-16)$ can always be factored further when the operation within the parentheses is a subtraction, even if the subtracted number is not a perfect square. For instance, $t(t^2-5)$ can be rewritten as $t(t-\sqrt{5})(t+\sqrt{5})$. ## Even & Odd Functions Functions can be even, odd or neither. Even functions satisfy the property that $f(-x)=f(x)$, like $x^2$, as $-1^2=1$. Odd functions satisfy $f(-x) = -f(x)$. For example, $f(x)=x^3$, as $f(−1)=(−1)^3=−1=−f(1)$. Many functions are neither, like $f(x)=x+1$, where $-f(x)\ne f(-x)$ and $f(-x)\ne f(x)$. Indeed, plugging in $-3$, we see that $-f(3) = -4 \ne -2 = f(-3)$, and that $f(-3) = -2 \ne 4 = f(3)$. Knowing a function is even or odd helps us visualize what its graph looks like. More precisely, it tells us what kind of symmetry the graph must have. Even functions have symmetry about the y-axis, while odd functions have symmetry about the origin. ## Evaluation Functions can be **evaluated**, meaning you can replace the independent variable with either a number or an expression. For a function $f(x)=x^2+2$, for instance, you can input the number $5$, which gives us $f(5)=5^2+2=27$, or input the expression $x+h$, so that $ f(x+h)=(x+h)^2+2=(x+h)\cdot(x+h)+2=x^2+h^2+2xh+2 $ Inputing another expression to a function is also called **function composition**. ^function-composition ## Piecewise Functions Piecewise functions are a special type of function that apply different expressions to input values depending on which part of the function's domain they fall into. For instance, $ f(x) = \begin{cases} x^3, & x < 1 \\ 3x-2, & x \geq 1 \end{cases} $ Upon evaluating $f(-1)$, we look at the right-hand side of the function. Since $-1 \lt 1$, we pick the expression $x^3$, leaving us with $f(-1) = -1$. Evaluating $f(7)$ gives us $f(7)=3\cdot7-2=19$. Note that while the domains of expressions of piecewise functions can never overlap, they are more often than not discontinuous. ## Operation of functions Functions can be subjected to operations, like any other expression. Let's define two functions, $f(x)= \frac{2x+3}{3x-2}$, and $g(x)=\frac{4x}{3x-2}$. We can for instance divide them, which takes the following form: $ (f/g)(x) =\frac{\frac{2x+3}{3x-2}}{\frac{4x}{3x-2}} =\frac{2x+3}{3x-2}\cdot\frac{3x-2}{4x} =\frac{2x+3}{4x} $ >⚠️ As for any function, the domain of the resulting function must satisfy the constraint of never allowing a denominator of $0$. But it is also the fact that **the domains of the original functions $f(x)$ and $g(x)$ must carry into the new domain**. Using domain notation, we can combine them to write the domain of $(f/g)(x)$ like so: $D: \left\{x | x \ne 0, x \ne \frac{2}{3}\right\}$. ## Slopes ### Average Rate of Change The average rate of change of a function over an interval describes the slope between two points on the graph of a function. This slope is that of the secant line passing through those two points. Given a function $f(x)$, and two points on its graph $(a,f(a))$ and $(b,f(b))$, the average rate of change is: $ \frac{f(b)-f(a)}{b-a} $ As the value of $b$ approaches $a$, the average rate of the function comes closer to the slope of the tangent at point $a$ until it functionally equals it as the difference between the two points becomes negligibly different. For instance, given a function $f(x)=x^2-2x$, and two input values $x=3$ and $x=5$, we calculate the average rate of change (or slope of the secant line between the two corresponding points) like so: $ \frac{f(5)-f(3)}{5-3} = \frac{(5^2-2\cdot5) - (3^2-2\cdot3)}{2} = \frac{15-3}{2} = \frac{12}{2} = 6 $ This method allows us to find the average slope of a graph over an interval. Interestingly, there will be one point on that interval where the instantaneous slope equals this average slope. As we make the two points closer and closer, the average slope becomes closer until equivalent to the tangent of the graph at that point. ### Difference Quotient To express the relationship between $\Delta y$ and $\Delta x$ in terms of $f(x)$, we can use the difference quotient of $f(x)$ given by the formula $ \frac{f(x+h)-f(x)}{h} $ where $h$, or $\Delta x$, represents the difference between $x$ and another sampled value along the $x$ axis. Essentially, we're subtracting $y$, or $f(x)$, from $y + \Delta y$, $\Delta y$ being the difference between $f(x+h)$ and $f(x)$, meaning $ \frac{f(x+h)-f(x)}{h} = \frac{\Delta y}{\Delta x} $ For instance, given a function $f(x) = x^2 + 1$, then, following the rules of [[Functions#^function-composition|function composition]], we can infer that $ f(x+h)=x^2+h^2+2xh+1 $ Therefore, $ \frac{f(x+h)-f(x)}{h} = \frac{(x^2+h^2+2xh+1)-(x^2+1)}{h} = h + 2x $ The difference quotient is therefore $h + 2x$. With the difference quotient, we are now able to compute the slope of a curve at any given point on the function graph as $h$ approaches $0$. To do so, we can substitute $h$ with $0$, meaning we're computing the slope at an *instant*. This slope gives us the direction in which we need to go to find the next point on the graph, which requires of us to think of a curve or a line as an infinite collection of points. I find the [[Cantor Set]] to be a good proxy to visually represent this idea. From our previous example, this gives us a slope of $2x$ at any given point (instant) on the graph. ### Difference between Average Rate of Change and Difference Quotient The average rate of change and the difference quotient are functionally equivalent. Let's prove it by comparing their respective formulas: $ \frac{f(b)-f(a)}{b-a} = \frac{f(x+h)-f(x)}{h} $ As $h$ represents the difference between the two input values $x$ and $x+h$, and as $b-a$ also gives us the difference between those two inputs on the left formula, we see that $b=x+h$ and $b-a=h$, therefore producing the exact same output and making the formulas interchangeable. The difference between them lies in the context where they're used: The average rate of change of a function focuses on finding the average slope of its graph over an interval, while the difference quotient is typically used in calculus to define the derivative of the function by replacing $h$ with $0$, thus making it possible to find the slope at an instant on the graph. ## Graphing Functions ### Common Graphs #### $f(x)=2$  #### $f(x)=x$  #### $f(x)=|x|$  #### $f(x)=\frac{1}{x}$  #### $f(x)=x^2$  #### $f(x)=x^3$  #### $f(x)=\sqrt{x}$  ### $f(x)=\sqrt[3]{x}$  ### Transformations We can think of the various operations applied to the input as transformations to the graph of the function that manipulates it. Understanding how those transformations affect the graph of a function helps us build an intuition of the relationship between the function's input and its output. #### Vertical Shift Let us consider the function $f(x)+k$. Because $k$ is added *after* the manipulation of the input value, the graph will be shifted up. We're adding a constant to the output value of the function. This is for instance the case of $f(x)=x^2+3$. The graph of this function will look like exactly like that of $x^2$, shifted up by three units. #### Horizontal Shift If now we apply a change *before* manipulating the input value, then the graph will be moved horizontally in the opposite direction of the change. This is the case because whatever happened at $x=0$ now happens at $x=-2$, since for the same $x$ input value, we now have the output of what would have been the output of $x+2$ before applying the transformation. So $f(x+h)$ moves the graph to the left by $h$ units, while $f(x-h)$ moves it the right. For example, $f(x)=|x+2|$ produces a left shift of the graph $f(x)=|x|$, because the constant $2$ is added to the input value before applying any other changes. #### Combining Shifts It is of course possible to combine those two types of transformations. Taking the function $f(x)=(x+1)^3-1$, we see that it produces both a left shift, as we add $1$ to the input value before manipulating it further, and a down shift, since we remove $1$ from the output at the end. #### Vertical Stretch / Compression Consider the expression $a \cdot f(x)$. The output value is multiplied by $a$, which means, if $a>1$, that the graph will be stretched vertically, as output values grow faster than they used to by a factor of $a$. If, on the other hand, $0<a<1$, the graph will be compressed vertically as output values are now a fraction of what they used to be before this transformation. Looking at the function $f(x)=2x^2$, we now understand that $a=2$, which will result effectively in stretching the graph upward, the output values now growing two times faster. #### Horizontal Stretch / Compression A horizontal stretch or compression has the form $f(ax)$. It's usually the case that a horizontal stretch or compression can be changed into a vertical one. If $a>1$, the graph will be compressed horizontally. If $0<a<1$, the graph will be stretched horizontally. Again, what happens within parentheses produces a result that seemingly goes against intuition. Yet this is logical, because what it means is that for the same output, we now have an input smaller by a factor of $a$ when $a>1$. Taking the function $f(x)=(3x)^2$, we see that $f(2)=36$, when if we do not multiply by $9$ (because $3^2=9$), $f(2)=4$. The reverse is also true: For the same input, we now have an output bigger by a factor of $a$, which in essence is the same as a vertical stretch, which stretches by compressing horizontally to make the graph narrower. #### Reflection Changing the sign of the output, i.e. $-f(x)$, reflects the graph about the $x$-axis, as positive output now becomes negative. This is the case for instance of $f(x)=-\sqrt[3]{x}$. Changing the sign of the input, i.e. $f(-x)$, flips the graph along the $y$-axis, as positive input now becomes negative, like $f(x)=\sqrt{-x}$. #### Examples ##### $f(x)=-\frac{1}{2}|x-3|+2$ - We start from an even-looking graph, $|x|$, with symmetry about the $y$ axis; - We shift up the graph by $2$ units with $+2$; - We shift right the graph by $3$ units with $-3$; - We compress the graph vertically (or stretch it horizontally), multiplying by $\frac{1}{2}$; - We reflect the graph horizontally with the negative sign in front of $-\frac{1}{2}$.  ##### $g(x)=-\frac{1}{3}(x+1)^3-1$ - The base function $x^3$ gives us an S-shaped graph; - The $-1$ at the end shifts the graph down by $1$ unit; - The $+1$ applied to the input before any other transformations creates us a left shift by $1$ unit; - $\frac{1}{3}$ compresses the graph vertically, effectively flattening it - The negative sign of $-\frac{1}{3}$ causes it to be reflected vertically  ##### $f(x)=\frac{3}{x-2}+1$ - We can rewrite it to better understand the transformations: $f(x)=3\cdot\frac{1}{x-2}+1$; - We now see the base function dictating the shape of the graph is $\frac{1}{x}$; - $+1$ causes a shift up by $1$ units; - $-2$ causes a shift right by $2$ units; - Multiplying by $3$ creates a vertical stretch.  ##### $g(x)=2\cdot\sqrt{1-x}+3$ - Rewriting the expression to make the transformations clearer: $g(x)=2\cdot\sqrt{-(x-1)}+3$; - The graph's shape is defined by the function $\sqrt{x}$; - We see a shift up by $+3$ units; - A shift right by $1$ unit; - A vertical stretch by a factor of $2$; - A vertical reflection of the graph applied by the minus sign. 