# How to find the analytical expression of function f [x] for such a composite function?

The known analytical formula for composite functions is:

f[Sqrt[x] + 1/Sqrt[x]] == x + 1/x


The analytical formula for f [x] cannot be obtained through this method：

In:= Clear["Global*"]
RSolve[{f[Sqrt[x] + 1/Sqrt[x]] == x + 1/x}, f[x], x] // FullSimplify

Out= RSolve[{1/x + x == f[(1 + x)/Sqrt[x]]}, f[x], x]


and this method is also cannot

Clear["Global*"]
Simplify /@ (f[Sqrt[x] + 1/Sqrt[x]] == x + 1/x /.
Solve[y == Sqrt[x] + 1/Sqrt[x], x][]) /. {y -> x,
Equal -> Rule} • Could you explain what The known analytical formula for composite functions is: f[Sqrt[x] + 1/Sqrt[x]] == x + 1/x mean? According to Reduce, Reduce[Sqrt[x] + 1/Sqrt[x] == x + 1/x] is true when x=1 only. What is f role here? I am not reading your question right it seems. Jun 6 at 3:28
• fF represents the corresponding relationship of the function Jun 6 at 3:31
• What is the analytical expression required for f [x]. Known conditions are f[Sqrt[x] + 1/Sqrt[x]] == x + 1/x Jun 6 at 3:32
• Well, according to reduce, if you give me Sqrt[x] + 1/Sqrt[x] and want me to return back x + 1/x then only when x=1 this is possible. I am not sure what you mean by how to represent f in this case. Hopefully someone will have an answer. Jun 6 at 3:34

Clear["Global*"]

eqn1 = f[Sqrt[x] + 1/Sqrt[x]] == x + 1/x;

sol = Solve[y == Sqrt[x] + 1/Sqrt[x], x] // Quiet

(* {{x -> 1/2 (-2 + y^2 - y Sqrt[-4 + y^2])},
{x -> 1/2 (-2 + y^2 + y Sqrt[-4 + y^2])}} *)


Using first solution,

eqn2 = f[y] == Simplify[x + 1/x /. sol[]] /.
{y -> x, Equal -> Rule}

(* f[x] -> -2 + x^2 *)


Verifying,

eqn1 /. f -> Function[{x}, x^2 - 2] // Simplify

(* True *)


Using the second solution,

eqn3 = f[y] == Simplify[x + 1/x /. sol[]] /.
{y -> x, Equal -> Rule}

(* f[x] -> -2 + x^2 *)


This is identical to the first result.

Assuming f is invertible:

eqn = f[y] == f[Sqrt[x] + 1/Sqrt[x]] == x + 1/x;
Solve[Eliminate[eqn, {x}], f[y]]


InverseFunction::ifun: Inverse functions are being used. Values may be lost for multivalued inverses.

{{f[y] -> -2 + y^2}}


Note: The solution f is invertible on the implicit domain, which is the range of the argument Sqrt[x] + 1/Sqrt[x] (Re[y] >= 0). However, the method works on Solve[Eliminate[f[y] == f[Sqrt[x] + 1/Sqrt[x]] == 2, {x}], f[y]], even though f[y] -> 2 is not invertible. The warning arises because Solve uses InverseFunction[f][f[u]] to extract the argument u`, which is what you see others (in the OP and other answer) doing by hand.