How do I invert this exponential function?

Click For Summary

Discussion Overview

The discussion revolves around the challenge of finding the inverse of an exponential function defined as f(x) = (x*e^(x-1))^(x/(x+1)). Participants explore the function's properties, its behavior at various points, and the implications of its structure for determining an inverse.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant describes their process of creating a function for a game mechanic, initially starting with a linear function and transitioning to an exponential form.
  • They propose a modified function f2 = (fL*fe)^p, where p>0.5, leading to interesting growth characteristics.
  • Another participant notes that there is no "closed form" for the inverse function and suggests the use of the Lambert W-function as a potential solution.
  • A different participant mentions reaching the expression y=x+ln(x) but finds it unsolvable in simpler terms, indicating the complexity of the inverse function.
  • Graphs are shared to illustrate the behavior of the function, highlighting specific points and noting that the inverse function may be two-valued in certain ranges.

Areas of Agreement / Disagreement

Participants express uncertainty regarding the existence of a simple inverse function and the applicability of the Lambert W-function. There is no consensus on a definitive method to find the inverse, and multiple viewpoints on the function's properties are presented.

Contextual Notes

The discussion highlights limitations in finding a closed form for the inverse function and the complexity introduced by the exponential and logarithmic components involved.

martix
Messages
167
Reaction score
5
TL;DR
How to inverse f(x) = (x*e^(x-1))^(x/(x+1))
Preface: I have not done serious math in years. Today I tried to do something fancy for a game mechanic I'm designing.

I've got an item with a variable power level. It uses x amount of ammo to produce f(x) amount of kaboom. Initially it was linear, e.g. fL(x) = x, but I didn't like the scaling. So I figure I'd make it scale exponentially.
Something like fe(x) = ex-1.
That way it's still 1 at x=1. The low-end values look weird though. Like x=0 is not 0.
So I figure multiply both: fL*fe
f2 is now 0 at x=0 and 1 at x=1
But I am multiplying to very similar values, so a square root seemed in order: f2 = √fL*fe
It's higher than the linear function below 1, but that's fine for now. Above 1, with the square root it's not quite exponential, but it's close enough and certainly above linear.

And normally that would have been the end of the story. But then I started tinkering with the function. At this point I'm just in it for the math and (re)learning things long forgotten.

Interesting things happen when you mess with the power. f2 = (fL*fe)p, p>0.5
This makes it go above exponential growth for a while, and then dip below, depending on how close p is to 1.

The item has a max power level, it can't go to infinity. So I started thinking, can I somehow align this max level with the inflection point of f2?

I made a new function, to look at how and when this happens: fratio = f2/fe, which has a very interesting shape and properties. More specifically, it's global minimum is the point where f2 goes from above exponential, to below. Which immediately got me thinking calculus and derivatives.

An hour or two of struggle with WolframAlpha later, I arrive at the following function of power as a function of ammo: f(x) = (x*ex-1)x/(x+1)
But I don't know how to find the inverse. Or to be more explicit I want an f(y) = x function. I tried some algebra, but that got me nowhere. It seems to me the inverse function should exist, but I'm stumped at this point.(Step-by-step in the spoiler below, should anyone feel the need to double-check my work. I plopped everything in an excel sheet to verify my results, so I'm reasonably certain it's correct, even if I don't know why. Explanations appreciated tho.)

1. We're looking for the minima of fratio, so derivatives ahoy! With WolframAlpha as a substitute for my non-existent calculus skills.
2. Our function has 2 variables x (ammo) and p (exponent). I mess around with both partial derivatives, looking for anything useful to fall out. Turns out ∂fr/∂x = e^(p (-x) + p + x - 1) x^(-p - 1) (x - p (x + 1)) is the one I need (I have no idea why); We have 3 multiplicands here, so for the derivative to be 0, either one should be 0. Not the e^ part and x^ is only 0 when x=0, which is not what we're looking for. So the only working part left is (x - p (x + 1)) = 0 which gives us a relation between x and p: p = x / (x+1)
3. Substitute: f2 = (fL*fe)p => f2 = (x*ex-1)x/(x+1)
 
Physics news on Phys.org
martix said:
TL;DR Summary: How to inverse f(x) = (x*e^(x-1))^(x/(x+1))

Preface: I have not done serious math in years. Today I tried to do something fancy for a game mechanic I'm designing.

I've got an item with a variable power level. It uses x amount of ammo to produce f(x) amount of kaboom. Initially it was linear, e.g. fL(x) = x, but I didn't like the scaling. So I figure I'd make it scale exponentially.
Something like fe(x) = ex-1.
That way it's still 1 at x=1. The low-end values look weird though. Like x=0 is not 0.
So I figure multiply both: fL*fe
f2 is now 0 at x=0 and 1 at x=1
But I am multiplying to very similar values, so a square root seemed in order: f2 = √fL*fe
It's higher than the linear function below 1, but that's fine for now. Above 1, with the square root it's not quite exponential, but it's close enough and certainly above linear.

And normally that would have been the end of the story. But then I started tinkering with the function. At this point I'm just in it for the math and (re)learning things long forgotten.

Interesting things happen when you mess with the power. f2 = (fL*fe)p, p>0.5
This makes it go above exponential growth for a while, and then dip below, depending on how close p is to 1.

The item has a max power level, it can't go to infinity. So I started thinking, can I somehow align this max level with the inflection point of f2?

I made a new function, to look at how and when this happens: fratio = f2/fe, which has a very interesting shape and properties. More specifically, it's global minimum is the point where f2 goes from above exponential, to below. Which immediately got me thinking calculus and derivatives.

An hour or two of struggle with WolframAlpha later, I arrive at the following function of power as a function of ammo: f(x) = (x*ex-1)x/(x+1)
But I don't know how to find the inverse. Or to be more explicit I want an f(y) = x function. I tried some algebra, but that got me nowhere. It seems to me the inverse function should exist, but I'm stumped at this point.(Step-by-step in the spoiler below, should anyone feel the need to double-check my work. I plopped everything in an excel sheet to verify my results, so I'm reasonably certain it's correct, even if I don't know why. Explanations appreciated tho.)

1. We're looking for the minima of fratio, so derivatives ahoy! With WolframAlpha as a substitute for my non-existent calculus skills.
2. Our function has 2 variables x (ammo) and p (exponent). I mess around with both partial derivatives, looking for anything useful to fall out. Turns out ∂fr/∂x = e^(p (-x) + p + x - 1) x^(-p - 1) (x - p (x + 1)) is the one I need (I have no idea why); We have 3 multiplicands here, so for the derivative to be 0, either one should be 0. Not the e^ part and x^ is only 0 when x=0, which is not what we're looking for. So the only working part left is (x - p (x + 1)) = 0 which gives us a relation between x and p: p = x / (x+1)
3. Substitute: f2 = (fL*fe)p => f2 = (x*ex-1)x/(x+1)
There is no "closed form" for the inverse function. With the exponent involved, I'm not certain, but you may be able to find a solution using the Lambert W-function.

-Dan
 
So that's what that W I've been seeing pop up in W|A results means. Not that I can do much with it.
I reached y=x+ln(x) and that's it. (In other words this operation from the OP: fL*fe) Seems that's the unsolvable part. Doesn't get any simpler than that and the root is apparently x = e(-W(1)). And I can totally find the wiki page but I'd need a course in calc and complex analysis before I can do anything with it.
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
6K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K