edits
This commit is contained in:
@@ -15,10 +15,17 @@ plotly()
|
||||
---
|
||||
|
||||
|
||||
A (univariate) mathematical function relates or associates values of $x$ to values $y$ using the notation $y=f(x)$. A key point is a given $x$ is associated with just one $y$ value, though a given $y$ value may be associated with several different $x$ values. (Graphically, this is the vertical line test.)
|
||||
A (univariate) mathematical function relates or associates values of $x$ to values $y$ using the notation $y=f(x)$. A key point is a given $x$ is associated with just one $y$ value, though a given $y$ value may be associated with several different $x$ values. (Graphically, this is the horizontal line test.)
|
||||
|
||||
|
||||
We may conceptualize such a relation in many ways: through an algebraic rule; through the graph of $f;$ through a description of what $f$ does; or through a table of paired values, say. For the moment, let's consider a function as a rule that takes in a value of $x$ and outputs a value $y$. If a rule is given defining the function, the computation of $y$ is straightforward. A different question is not so easy: for a given value $y$ what value - or *values* - of $x$ (if any) produce an output of $y$? That is, what $x$ value(s) satisfy $f(x)=y$?
|
||||
We may conceptualize such a relation in many ways:
|
||||
|
||||
* through an algebraic rule;
|
||||
* through the graph of $f$;
|
||||
* through a description of what $f$ does;
|
||||
* or through a table of paired values, say.
|
||||
|
||||
For the moment, let's consider a function as a rule that takes in a value of $x$ and outputs a value $y$. If a rule is given defining the function, the computation of $y$ is straightforward. A different question is not so easy: for a given value $y$ what value--or *values*--of $x$ (if any) produce an output of $y$? That is, what $x$ value(s) satisfy $f(x)=y$?
|
||||
|
||||
|
||||
*If* for each $y$ in some set of values there is just one $x$ value, then this operation associates to each value $y$ a single value $x$, so it too is a function. When that is the case we call this an *inverse* function.
|
||||
@@ -80,7 +87,7 @@ p
|
||||
The graph of a function is a representation of points $(x,f(x))$, so to *find* $y = f(c)$ from the graph, we begin on the $x$ axis at $c$, move vertically to the graph (the point $(c, f(c))$), and then move horizontally to the $y$ axis, intersecting it at $y = f(c)$. The figure shows this for $c=2$, from which we can read that $f(c)$ is about $4$. This is how an $x$ is associated to a single $y$.
|
||||
|
||||
|
||||
If we were to *reverse* the direction, starting at $y = f(d)$ on the $y$ axis and then moving horizontally to the graph, and then vertically to the $x$-axis we end up at a value $d$ with the correct $f(d)$. This allows solving for $x$ knowing $y$ in $y=f(x)$.
|
||||
If we were to *reverse* the direction, starting at $y = f(d)$ on the $y$ axis and then moving horizontally to the graph, and then vertically to the $x$-axis we end up at a value $d$ with the correct value of $f(d)$. This allows solving for $x$ knowing $y$ in $y=f(x)$.
|
||||
|
||||
The operation described will form a function **if** the initial movement horizontally is guaranteed to find *no more than one* value on the graph. That is, to have an inverse function, there can not be two $x$ values corresponding to a given $y$ value. This observation is often visualized through the "horizontal line test" - the graph of a function with an inverse function can only intersect a horizontal line at most in one place.
|
||||
|
||||
@@ -195,7 +202,7 @@ In the section on the [intermediate value theorem](../limits/intermediate_value_
|
||||
## Functions which are not always invertible
|
||||
|
||||
|
||||
Consider the function $f(x) = x^2$. The graph - a parabola - is clearly not *monotonic*. Hence no inverse function exists. Yet, we can solve equations $y=x^2$ quite easily: $y=\sqrt{x}$ *or* $y=-\sqrt{x}$. We know the square root undoes the squaring, but we need to be a little more careful to say the square root is the inverse of the squaring function.
|
||||
Consider the function $f(x) = x^2$. The graph--a parabola--is clearly not *monotonic*. Hence no inverse function exists. Yet, we can solve equations $y=x^2$ quite easily: $y=\sqrt{x}$ *or* $y=-\sqrt{x}$. We know the square root undoes the squaring, but we need to be a little more careful to say the square root is the inverse of the squaring function.
|
||||
|
||||
|
||||
The issue is there are generally *two* possible answers. To avoid this, we might choose to only take the *non-negative* answer. To make this all work as above, we restrict the domain of $f(x)$ and now consider the related function $f(x)=x^2, x \geq 0$. This is now a monotonic function, so will have an inverse function. This is clearly $f^{-1}(x) = \sqrt{x}$. (The $\sqrt{x}$ being defined as the principle square root or the unique *non-negative* answer to $u^2-x=0$.)
|
||||
@@ -231,8 +238,9 @@ Consider again the graph of a monotonic function, in this case $f(x) = x^2 + 2,
|
||||
```{julia}
|
||||
#| hold: true
|
||||
f(x) = x^2 + 2
|
||||
plot(f, 0, 4, legend=false)
|
||||
plot!([2,2,0], [0,f(2),f(2)])
|
||||
plot(f, 0, 4; yticks=[2,4,8,16],
|
||||
legend=false, framestyle=:origin)
|
||||
plot!([(2,0), (2, f(2)), (0, f(2))])
|
||||
```
|
||||
|
||||
The graph is shown over the interval $(0,4)$, but the *domain* of $f(x)$ is all $x \geq 0$. The *range* of $f(x)$ is clearly $2 \leq y \leq \infty$.
|
||||
@@ -241,24 +249,18 @@ The graph is shown over the interval $(0,4)$, but the *domain* of $f(x)$ is all
|
||||
The lines layered on the plot show how to associate an $x$ value to a $y$ value or vice versa (as $f(x)$ is one-to-one). The domain then of the inverse function is all the $y$ values for which a corresponding $x$ value exists: this is clearly all values bigger or equal to $2$. The *range* of the inverse function can be seen to be all the images for the values of $y$, which would be all $x \geq 0$. This gives the relationship:
|
||||
|
||||
|
||||
> the *range* of $f(x)$ is the *domain* of $f^{-1}(x)$; furthermore the *domain* of $f(x)$ is the *range* for $f^{-1}(x)$;
|
||||
|
||||
|
||||
> * the *domain* of $f^{-1}(x)$ is the *range* of $f(x)$;
|
||||
> * the *range* of $f^{-1}(x)$ is the *domain* of $f(x)$;
|
||||
|
||||
From this we can see if we start at $x$, apply $f$ we get $y$, if we then apply $f^{-1}$ we will get back to $x$ so we have:
|
||||
|
||||
|
||||
> For all $x$ in the domain of $f$: $f^{-1}(f(x)) = x$.
|
||||
|
||||
|
||||
|
||||
Similarly, were we to start on the $y$ axis, we would see:
|
||||
|
||||
|
||||
> For all $x$ in the domain of $f^{-1}$: $f(f^{-1}(x)) = x$.
|
||||
|
||||
|
||||
|
||||
In short $f^{-1} \circ f$ and $f \circ f^{-1}$ are both identity functions, though on possibly different domains.
|
||||
|
||||
|
||||
@@ -280,11 +282,12 @@ Let's see this in action. Take the function $2^x$. We can plot it by generating
|
||||
f(x) = 2^x
|
||||
xs = range(0, 2, length=50)
|
||||
ys = f.(xs)
|
||||
plot(xs, ys, color=:blue, label="f")
|
||||
plot!(ys, xs, color=:red, label="f⁻¹") # the inverse
|
||||
plot(xs, ys; color=:blue, label="f",
|
||||
aspect_ratio=:equal, framestyle=:origin, xlims=(0,4))
|
||||
plot!(ys, xs; color=:red, label="f⁻¹") # the inverse
|
||||
```
|
||||
|
||||
By flipping around the $x$ and $y$ values in the `plot!` command, we produce the graph of the inverse function - when viewed as a function of $x$. We can see that the domain of the inverse function (in red) is clearly different from that of the function (in blue).
|
||||
By flipping around the $x$ and $y$ values in the `plot!` command, we produce the graph of the inverse function--when viewed as a function of $x$. We can see that the domain of the inverse function (in red) is clearly different from that of the function (in blue).
|
||||
|
||||
|
||||
The inverse function graph can be viewed as a symmetry of the graph of the function. Flipping the graph for $f(x)$ around the line $y=x$ will produce the graph of the inverse function: Here we see for the graph of $f(x) = x^{1/3}$ and its inverse function:
|
||||
@@ -295,15 +298,16 @@ The inverse function graph can be viewed as a symmetry of the graph of the funct
|
||||
f(x) = cbrt(x)
|
||||
xs = range(-2, 2, length=150)
|
||||
ys = f.(xs)
|
||||
plot(xs, ys, color=:blue, aspect_ratio=:equal, legend=false)
|
||||
plot!(ys, xs, color=:red)
|
||||
plot!(identity, color=:green, linestyle=:dash)
|
||||
x, y = 1/2, f(1/2)
|
||||
plot!([x,y], [y,x], color=:green, linestyle=:dot)
|
||||
plot(xs, ys; color=:blue,
|
||||
aspect_ratio=:equal, legend=false)
|
||||
plot!(ys, xs; line=(:red,))
|
||||
plot!(identity; line=(:green, :dash))
|
||||
x = 1/4
|
||||
y = f(x)
|
||||
plot!([(x,y), (y,x)]; line=(:green, :dot))
|
||||
```
|
||||
|
||||
We drew a line connecting $(1/2, f(1/2))$ to $(f(1/2),1/2)$. We can see that it crosses the line $y=x$ perpendicularly, indicating that points are symmetric about this line. (The plotting argument `aspect_ratio=:equal` ensures that the $x$ and $y$ axes are on the same scale, so that this type of line will look perpendicular.)
|
||||
|
||||
We drew a line connecting $(1/4, f(1/4))$ to $(f(1/4),1/4)$. We can see that it crosses the line $y=x$ perpendicularly, indicating that points are symmetric about this line. (The plotting argument `aspect_ratio=:equal` ensures that the $x$ and $y$ axes are on the same scale, so that this type of line will look perpendicular.)
|
||||
|
||||
One consequence of this symmetry, is that if $f$ is strictly increasing, then so is its inverse.
|
||||
|
||||
@@ -472,7 +476,7 @@ plotly()
|
||||
nothing
|
||||
```
|
||||
|
||||
The key here is that the shape of $f(x)$ near $x=c$ is somewhat related to the shape of $f^{-1}(x)$ at $f(c)$. In this case, if we use the tangent line as a fill in for how steep a function is, we see from the relationship that if $f(x)$ is "steep" at $x=c$, then $f^{-1}(x)$ will be "shallow" at $x=f(c)$.
|
||||
The key here is that the shape of $f(x)$ near $x=c$ is directly related to the shape of $f^{-1}(x)$ at $f(c)$. In this case, if we use the tangent line as a fill in for how steep a function is, we see from the relationship that if $f(x)$ is "steep" at $x=c$, then $f^{-1}(x)$ will be "shallow" at $x=f(c)$.
|
||||
|
||||
|
||||
## Questions
|
||||
|
||||
Reference in New Issue
Block a user