I know that if we have some function $f(x)$ we can transform it like doing, say, $f(x) + a$ to shift it $a$ units up/down or even $f(x-a)$ which shifts the graph $a$ units left or right. The confusion starts when you squash the graph, say I found $f(2x)$, obviously I did not say $x=2x$ as this is just rubbish that only holds for $x=0$, yet we know $x$ can take any real (or perhaps complex if we allow it) value. What is the right line of reasoning between the lines $y=f(x)$ and $y=f(2x)$, because its definitely not $x=2x$
-
If the point $(c,d)$ lies on the graph of $y=f(x)$, then the point $(c/2,d)$ lies on the graph of $y=f(2x)$. So the graph transformation corresponds to halving all of the $x$-coordinates, i.e. a horizontal "squash" of scale factor $2$. – Joe Jul 05 '23 at 15:21
-
Yes I know that, very well. What I am asking is that if I have $f(x)$ then I want to do say, $f(y/2)$ it is perfectly valid to say $ x = y/2$, but when I am working with the same variable, what is the correct line of reasoning, as I cannot write $x=2x$ – Nav Bhatthal Jul 05 '23 at 15:22
-
1Would you have the same trouble with $f(x+1)$? – Lee Mosher Jul 05 '23 at 15:22
-
Yes as you cannot say $x=x+1$ unless you are a computer scientist. – Nav Bhatthal Jul 05 '23 at 15:23
-
Have you learned about composition of functions? – Lee Mosher Jul 05 '23 at 15:24
-
I am not quite sure what you mean by that, like $f(g(x))$ for some functions $f$ and $g$? – Nav Bhatthal Jul 05 '23 at 15:25
-
That's exactly what I mean. – Lee Mosher Jul 05 '23 at 15:26
-
Let us continue this discussion in chat. – Nav Bhatthal Jul 05 '23 at 15:26
-
1Yes, that's right. We could also let $g(x)=f(2x)$ for all $x$ , then "$g$" is the name of the function which takes in a number, say $x$, and spits out the value $f(2x)$. The function $g$ is known as the composition of the function $f$ and the function $x\mapsto 2x$. In general, if $p$ and $q$ are functions, then their composition is called $p\circ q$: it is the function with the property that $(p\circ q)(x)=p(q(x))$ for all $x$. – Joe Jul 05 '23 at 15:39
4 Answers
You correctly understand that the plot of $f(x-a)$ is the plot of $f(x)$ shifted $a$ units to the right.
In a similar way, the plot of $f(ax)$ is the plot of $f(x)$ compressed by a scale factor of $a$.
In no case are we asserting that $x=x-a$ or $x=ax$.
I think what you are trying to express is a composition of functions. For example, let $g(x)=ax$, then we can write $$ f(ax)=f(g(x)). $$ In other words, the function $g$ modifies $x$ by scaling it, then passes its output into $f$.
- 1,566
The idea is that we are applying the operation of composition. Suppose we have $f$ a function with real domain, such that we can write $f = f(x)$. We can now write, for instance $g(x) = f(2x)$, meanning $g$ is the composition of $f$ with the multiplication of $x$ by $2$. In other words, we know that the multiplication by $2$ is also a real function and we can compose it with $f$. To visualize this we can simply name that multiplication as $h(x)$, yiedling $h(x) = 2x$ and then obtaining $g(x) = (f \circ h)(x) = f(h(x)) = f(2x)$. What cannot be done is assigning both $f(x)$ and $f(2x)$ to the same literal in the same context, as in your example $y = f(x)$ and $y = f(2x)$. In that case, that would only hold true if $f(x) = f(2x)$. A proper way to write it would be $y_1 = f(x)$ and $y_2 = f(2x)$, for instance.
- 431
The variable $x$ in the expression $f(x)$ is a dummy variable, and you should not regard it as being identical to the $x$ in the expression $f(2x)$.
One way to keep this all straight is to make good use of function composition notation, and to introduce an extra dummy variable.
First write $f(2x)=f(g(x))$, where we define the new function $g$ by the formula $g(x)=2x$.
Now introduce a new dummy variable $y$ as the input variable for the function $f$ (in place of the old dummy variable $x$ that you started with). Let this variable $y$ also serve as the output variable of the function $g$, and so $y=g(x)$ or $y=2x$. You can then write $$f(y)=f(g(x))=f(2x) $$
Generally speaking, mathematicians are not always as careful with their variables as is required in computer science. So, you have to get used to this somewhat ambiguous concept of a "dummy variable".
- 120,280
This is a very good question.
So the transformation $f(x - a)$ is a right horizontal shift by a units. The transformation $f(x) + a$ is an upwards vertical shift by a units. Now what does the transformation $f(2x)$ do?
There are many ways of describing the behavior of $f(2x)$. Here are some ways:
- The transformation $f(2x)$ compresses the graph towards the y-axis by a factor of 2.
- The transformation $f(2x)$ is a horizontal scaling (relative to the y-axis) by a factor of $1/2$.
- The distance between $f(2x)$ and the y-axis is half the distance between $f(x)$ and the y-axis (which becomes more apparent when you trace a horizontal line through both of the graphs).
It helps to get out a graphing calculator and graph the functions $f(x) = x^2$ and $y = f(2x)$. You can see how the graph of $f(2x)$ is compressed towards the y-axis by a factor of 2.
In the general case, where $y = f(kx)$ for some real number $k \neq 0$, we say that $y$ is a horizontal scaling of $f$ by a factor of $1/k$. If $k > 1$, then the graph of $f$ gets compressed towards the y-axis.
- 429