# How are the equations of $f(x)$ and $f(kx+c)$ related?

We have $$f(x) = \frac{5x}{2}+9$$ .

The graph of $$f(x)$$ is the green line. The graphs of $$f(2x)$$ and $$f(x-1)$$ are the blue and red lines, respectively. We see that $$f(2x)= 5x+9$$ and $$f(x-1) = \frac{5}{2}(x-1)+9$$ which are just putting $$2x$$ and $$(x-1)$$ in $$f(x)$$.

But when we graph $$f(2x-1)$$ (the purple line) we see something like the below.

It is horizontally compressed by a factor of $$\frac{1}{2}$$ and shifted horizontally by $$1$$ unit. And its equation isn't just what we'll get by putting $$2x-1$$ in $$f(x)$$. Moreover, if we horizontally shift $$f(x)$$ by $$1$$ unit and then compress it by a factor of $$\frac{1}{2}$$ we do not get the same graph as $$f(2x-1)$$. Why?

If we try to graph $$f(2x-1)$$ by letting $$x$$ = some value and plotting the points on a cartesian plane, we also don't get the same graph as $$f(2x-1)$$, my question is why is this difference and how are the equations of $$f(x)$$ and $$f(kx+c)$$ related?

Edit: Here's an article related to my question: https://brilliant.org/wiki/graph-transformation/

This question is from the book introduction to algebra by Richard rusczyk page no: 482. The transformation given there is wrong.

• Does this answer your question? Mechanics of Horizontal Stretching and Shrinking Commented Nov 8, 2022 at 14:29
• @EthanBolker That does not address the combination of the two operations as far as I can see. Commented Nov 8, 2022 at 14:33

It is true that the substitution $$x\mapsto 2x$$ results in horizontal compression of the graph and the substitution $$x\mapsto x-1$$ corresponds to a horizontal shift.

If we try to do them both, the function expression we get is $$f(2x-1) = \frac{5(2x-1)}2 + 9 = 5x - \frac{13}2$$ which indeed isn't what your purple graph shows. So what is happening?

The simple answer is that your purple graph is wrong. This is what I got when I graphed $$f(2x-1)$$:

and indeed we see that the purple line corresponds nicely with the above function expression.

The order of compressing and shifting corresponds to the (opposite of the) arithmetic order of operations in the expression $$2x-1$$. In your work, try changing the arithmetic order of operations by instead inserting $$2(x-1)$$ into the expression for $$f$$, and you will see that you get the correct function expression for your purple graph.

Or change the geometric order of operations by first shifting, then compressing, and see that you get the same as my purple graph.

So the full answer is that the substitution $$x\mapsto kx + c$$ will first shift the graph $$c$$ units to the left, and then compress the graph by a factor of $$k$$ (keeping the $$y$$-intercept fixed).

• Thank you for the answer. But here is an ss of a page of a book [imgur.com/a/q6I3s07 ] (there are two lines,y = $\frac{5}{2}x + 9$ is the first line, left one, and ignore the transformation $f(2x-1)+3$). If you see the transformation of $f(x)$ to $f(2x−1)$ then their graph and your and isn't the same. The compressed the graph first and then shifted it, so I don't understand what is the correct way?? Commented Nov 8, 2022 at 14:59
• @SayemRahman Your book is mistaken. The fact that the $x$ has a $2$ in front of it makes the shifting in step 2 only half as powerful. Consider this: What would $x$ have to be to get the function value 9 (which is to say, $f(0)$)? For $f(x)$ it's $0$, while for $f(x-1)$ it's $1$, so the graphs here are 1 apart vertically. For $f(2x)$ it's $0$ and for $f(2x-1)$ it's $\frac12$, so these two graphs are $\frac12$ apart horizontally. This is why I say to do the shift first, because then the amount of shift is equal to the actual number that's there. Commented Nov 8, 2022 at 15:19

I think the confusion comes from the canonical form you are using $$f(kx+c)$$, which corresponds to stretching the domain, and then translating $$c$$ units after the stretch (note that stretching changes the meaning of "$$1$$ unit", but $$c$$ is still referring to our natural understanding of "$$1$$ unit").

Usually, and I think for good intuitive reason, the following form is used $$f(k(x+c))$$. This means that we translate the domain by $$c$$ units (where "$$1$$ unit" has it's original/natural meaning), and then we stretch the domain.

Note that you can always switch between the 2 forms via $$f(kx+c)=f(k(x+c/k))$$.

Using the form $$f(k(x+c))$$, we can work backwards to see the effect on $$f$$. Namely, horizontal stretch by a factor of $$1/k$$ (because $$f$$ is reporting the value of any point $$kx_0$$ early, namely at the point $$x_0=(1/k)(kx_0)$$) and horizontal translation by $$-c$$ units (because $$f$$ is reporting the value of any point $$x_0+c$$ early, namely at the point $$x_0=(x_0+c)-c$$).