# Finding an $f(x)$ that satisfies $f(f(x)) = 4 - 3x$

I need to find $f(f(x)) = 4 - 3x$

In other examples, such as $f(2)$, I can see that the result equates to $-2$ or $f(x^2)$ becomes $-3x^2 + 4$.

Do I really just substitute $f(x)$ for $x$ and simplify?

-
If I do the substitution I end up with f(x) = 4/3, so the function of the function of x = 4/3. Is this the right direction? –  erimar77 Oct 11 '11 at 22:05
What you are asking is not fully clear. But if you are given that $f(x)=4-3x$, and you are asked what is $f(f(x))$, yes, you substitute. So $f(f(x))=4-3(4-3x)$. Simplify. –  André Nicolas Oct 11 '11 at 22:09
Please note that in your title $f(x)=4-3x$, and in the text you write $f(f(x))=4-3x$. I am guessing that you mean "I need to find $f(f(x))$ if $f(x)=4-3x$." But that is not what you actually wrote. –  André Nicolas Oct 11 '11 at 22:16
As André Nicolas said, yes you substitute $f(x)$ for $x$ and simplify, but make sure you do it on both sides of the $=$ sign. –  Ross Millikan Oct 11 '11 at 22:28
(+1), to compensate for an anonymous downvote, and because this poor guy is actually demonstrating his thought process and explaining where he is stuck... –  The Chaz 2.0 Oct 11 '11 at 22:35

1) There are many solutions to $f(f(x))=4-3x$, if that is your question. Note $f(f(1))=1$.

Here is one using complex numbers: $$f(x)=1+i(x-1)\sqrt{3}$$ where $i$ is $\sqrt{-1}$.

Here is another in real numbers: $$f(x)=1+(-1)^{\lfloor 2\log_3(|x-1|) \rfloor}(x-1)\sqrt{3}$$ and with the special case of $f(1)=1$.

2) Perhaps your question is simpler than this and you are starting with $f(x)=4-3x$ and you want to know what $f(f(x))$ is. Then yes, you do the substitution and get $$f(f(x))=4-3f(x) = 4-3(4-3x)=4-12+9x = 9x-8$$ as Unreasonable Sin said before deleting that answer.

-
I think just giving the results is quite boring, of course we can verify that they are correct by putting it in but how did you get there? –  Listing Oct 11 '11 at 22:39
@Listing: $4-3x$ is in effect a stretch by a magnitude of $3$ and a reversal of sign about $1$ ($0$ would be simpler to deal with so subtract 1 at the start and add it back at the end). So in a sense to get halfway there, you need to stretch by a magnitude of $\sqrt{3}$ and either half reverse the sign on all numbers (multiply by $i$) or reverse the sign for half the numbers (sometimes multiply by $-1$). –  Henry Oct 11 '11 at 22:50

Here is @Henry's solution, slightly rephrased, to find a square root of every affine function.

First the trivial case: for every $a\geqslant0$, a square root of $x\mapsto ax+b$ is $x\mapsto\sqrt{a}x+b/(1+\sqrt{a})$. Obviously this trick fails for $x\mapsto -ax+b$ with $a$ positive, which has no affine function as a square root. A solution is to partition the real line into a countable number of intervals and to consider a function $f$ cleverly subordinated to this partition and affine on each of these intervals. Hence $f$ will be far from being affine globally (and not even continuous) but $f\circ f$ will be, miraculously.

Consider a point $x_0$ and two doubly infinite strictly increasing sequences $(a_n)_{n\in\mathbb Z}$ and $(b_n)_{n\in\mathbb Z}$ such that $a_n\to+\infty$ and $b_n\to+\infty$ when $n\to+\infty$, and $a_n\to x_0$ and $b_n\to x_0$ when $n\to-\infty$. Define some intervals $A_n$ and $B_n$ by $A_n=[a_n,a_{n+1}[$ and $B_n=]-b_{n+1},-b_n]$. Hence every $A_n$ is on the right of $x_0$ and every $B_i$ is on the left of $x_0$, the intervals $A_n$ partition $(x_0,+\infty)$ and the intervals $B_i$ partition $(-\infty,x_0)$. Furthermore, every continuous bijection between $A_n$ and $B_i$ is a decreasing function which sends $a_n$ on $-b_i$ and has limit $-b_{i+1}$ at $a_{n+1}$.

Consider an integer $k$ and a function $f$ such that $f(x_0)=x_0$. Assume that:

For every integer $n$, $f$ sends continuously and bijectively $A_{2n}$ on $A_{2n+1+2k}$, $B_{2n}$ on $B_{2n+1+2k}$, $A_{2n+1}$ on $B_{2n}$ and $B_{2n+1}$ on $A_{2n}$.

Then $f\circ f$ is such that $f\circ f(x_0)=x_0$ and $f\circ f$ sends, for every integer $n$, $A_n$ on $B_{n+2k}$ and $B_n$ on $A_{n+2k}$. If the restrictions of $f$ to each $A_n$ and $B_n$ are affine, the function $f\circ f$ is affine on each $A_n$ and $B_n$ as well.

Choose finally $c>1$ and define $a_n=b_n=x_0+c^n$ for every $n$. Then $f\circ f$ sends each $x_0\pm c^n$ on $x_0\mp c^{2k}c^n$ hence $f\circ f(x_0+x)=x_0-c^{2k}x$ for every real number $x$. In other words, $f\circ f$ is the function $x\mapsto-c^{2k}x+(1+c^{2k})x_0$.

This yields a square root of $x\mapsto-ax+b$ for every positive $a\ne1$ (choose $x_0=b/(1+a)$, any $k\ne0$ and solve $c^{2k}=a$) and for $a=1$ (choose any $c>1$, $k=0$ and $x_0=b/2$).

-

Assume a rowvector $\small V(x) = [1,x]$ which you understand as symbolical or as containing a concrete value in x.

Then consider a matrix G, which contains the coefficients of $\small g(x)= f(f(x)) = 4 - 3x$ as $\small G= \left[ \begin{smallmatrix} 1 & 4 \\ 0 & -3 \end{smallmatrix} \right]$ . With this we have $\small V(x) \cdot G = V(g(x))$ and $\small V(x) \cdot G^h = V(g^{\circ h}(x))$ where the $\small \circ h$ means h'fold iteration.

Now $\small g(x) = f^{\circ 2} (x)$ so $\small f(x) = g^{\circ 1/2} (x)$ and you need the squareroot of G:

$\qquad \small V(x) \cdot G^{1/2} = V(g^{\circ 1/2}(x)) = V(f(x))$

Since $\small G (= F ^2)$ is a 2 x 2 matrix only and the first column of F is again [1,0] the solution of $\small F\cdot F = G$ or explicitely

$\qquad \small \left[ \begin{smallmatrix} 1 & a \\ 0 & b \end{smallmatrix} \right] \cdot \left[ \begin{smallmatrix} 1 & a \\ 0 & b \end{smallmatrix} \right] = \left[ \begin{smallmatrix} 1 & 4 \\ 0 & -3 \end{smallmatrix} \right]$

is simply the solution of two equations where one has a quadratic expression (with a complex solution here).

(For the generalization of that concept see for instance Carlemanmatrix in wikipedia)

-