# if $f(g(x))=x^3$ and $g(f(x))=x^4$ find $f(x)$ and $g(x)$ [duplicate]

I am taking algebra two and questions like this popped into my head so I would like to learn how to solve them, I am currently working on composing functions.

• I would start by thinking there might be a solution of the form $f(x) = x^a$ and $g(x) = x^b$ and trying to find $a$ and $b$. (I haven't tried to see if this works. You can.) Jul 10, 2019 at 12:17
• @EthanBolker No, this doesn't work because $f\circ g=g \circ f$ in this case. Jul 10, 2019 at 12:18
• This is a very interesting question. I proved that no such functions exist here Jul 10, 2019 at 12:19
• @KaviRamaMurthy True. That is where I'd have begun, and would quickly have found that it doesn't work. Nothing will, as per other comments. Jul 10, 2019 at 12:22
• you can take a look at this: math.stackexchange.com/questions/3065170/… is asked by @MaximilianJanisch Jul 10, 2019 at 12:23

We have $$f(x^4) = f(g(f(x)) = (f(x))^3$$ Let $$F(y) := \log f(e^y)$$. We have $$F(4y) = \log f(e^{4y}) = \log \big((f(e^y))^3\big) = 3\log f(e^y) = 3F(y)$$ You can easily construct such functions. You can take any function $$F : (-4,-1]\cup[1,4) \rightarrow \mathbb R$$ and then define $$F(4^k y) = 3^k F(y)$$ for $$k\in\mathbb Z$$, which will define $$F: (-\infty,0)\cup(0,\infty)\rightarrow \mathbb R$$, and finally put $$F(0)=0$$.
You can take then $$f(x) = \exp F(\log x)$$ which will define $$f: (0,\infty) \rightarrow \mathbb (0,\infty)$$. If this function turns out to be invertible (which happens if $$F:\mathbb R\rightarrow\mathbb R$$ is invertible), then you can define $$g(x) = f^{-1}(x^3)$$
Example: $$F(y) = \left\{\begin{array}{ll} y^{\log_4 3} & \text{for }y>0 \\ 0 & \text{for }y=0 \\ -(-y)^{\log_4 3} &\text{for }y<0 \end{array}\right.$$ $$f(x) = \left\{\begin{array}{ll} \exp\big((\log x)^{\log_4 3}\big) & \text{for }x>1 \\ 1 & \text{for }x=1 \\ \exp\big(-(-\log x)^{\log_4 3}\big) &\text{for }0 $$g(x) = \left\{\begin{array}{ll} \exp\big((3\log x)^{\log_3 4}\big) & \text{for }x>1 \\ 1 & \text{for }x=1 \\ \exp\big(-(-3\log x)^{\log_3 4}\big) &\text{for }0
• +1 This is a nice construction; it is impossible to extend this to $\Bbb R$ though Jul 10, 2019 at 12:46