13

Is there a (non-piecewise, non-trivial) function where $f(x) = f(\frac{1}{x})$?

Why?

It would be nice to compare ratios without worrying about the ordering of numerator and denominator. For example, I might want to know whether the "magnitude" of the ratio (maybe the "absolute ratio") of the widths of two objects is greater than $2$, but not care which is larger.

It occurred to me that there's a common solution for this problem when comparing the difference of two numbers: the square of a number is the same as the square of its opposite - $(a-b)^2=(b-a)^2$. This is really useful with Euclidean distances, because you don't have to worry about the order of subtraction or use absolute values. Can we get the same elegance for ratios?

Difference: $g(a-b)=g(b-a) \rightarrow g(x)=x^2$

Ratio: $f(\frac{a}{b})=f(\frac{b}{a}) \rightarrow f(x)=\ ?$

Nolan Amy
  • 233

6 Answers6

12

$$ \frac{x}{x^2+1} $$ the inverse of Will Jagy's $x + \frac{1}{x}$.

I like $$x - \frac{1}{x} = \frac{x^2-1}{x}$$ because it contains sign information (input magnitude greater or less than one) that you may choose to ignore, and gives a nice zero for $x = \frac{1}{x} = \pm 1$. If you choose to take the absolute value of it (ignoring the sign) it gives you the desired $f(x) = f(\frac{1}{x})$

adam W
  • 5,565
11

For lack of a better idea, $f(x)=|\ln x|$.

Lucian
  • 48,334
  • 2
  • 83
  • 154
8

$$ \frac{1}{1 + x + \frac{1}{x}} = \frac{x}{x^2 + x + 1} $$ extends to the real analytic function written on the right. Notice that $x^2 + x + 1 = (x + \frac{1}{2})^2 + \frac{3}{4} \geq \frac{3}{4}. $

Will Jagy
  • 139,541
2

For lack of anything worse than this, $f(x)=(x - \frac{1}{x})^2$.

Jardine
  • 121
2

Let $f(x)$ be arbitrary for $-1\leqslant x\leqslant 1,$ and define $f(x):=f(1/x)$ otherwise.

John Bentin
  • 18,454
  • The question specifies "non-piecewise" – Sparr Nov 25 '13 at 16:17
  • @Sparr: This definition includes the "non-piecewise" function specified in Will Jagy's answer as well as the first function in adam W's answer. (The other functions require a second statement to define them at $0.$) In fact, it includes all functions $f$ that satisfy $f(x)=f(1/x)$ for $x\neq 0.$ – John Bentin Nov 25 '13 at 18:18
  • 1
    one of the pieces of your function being non-piecewise does not make your function non-piecewise. pretty much the opposite, actually – Sparr Nov 25 '13 at 19:30
  • @Sparr: Agreed. – John Bentin Nov 25 '13 at 21:26
1

It works for any function $f(x) = g(x, \frac{1}{x})$ where $g$ is symmetric (i.e., $g(x, y) = g(y, x)$).

A simple example is to have $g$ be the addition operator, so $f(x) = x + \frac{1}{x}$.

Dan
  • 14,978