# Inverse of added logarithms

#### akunzler

##### New member
How do you take the inverse of $$\displaystyle y=2^x+3^x$$
Or how do you solve for $$\displaystyle y$$ in $$\displaystyle x = 2^y + 3^y$$
I and all the math teachers at my high school are stumped
Thanks!

#### pka

##### Elite Member
How do you take the inverse of $$\displaystyle y=2^x+3^x$$
Or how do you solve for $$\displaystyle y$$ in $$\displaystyle x = 2^y + 3^y$$
I and all the math teachers at my high school are stumped.
You have not posed a question. You must tell us exactly what is needed.
What is the object of the quest? Look at the graphs.

#### Dr.Peterson

##### Elite Member
You are asking the same question in two ways; finding the inverse of the first function means solving the second equation. I understand that.

But not every problem can be solved algebraically! There may be some trick I'm not thinking of, but it wouldn't surprise me at all if this can't be done.

Do you have any reason to think it should?

#### akunzler

##### New member
Sorry if I didn't include enough details!
I am not actually sure it can be done, but I figured this would be an okay place to ask
I am trying to find a function to describe a set of points, but the function I found (through a mixture of experimentation and research) was in terms of y. I want to be able to input x and get y, so I needed to solve it for y (effectively taking the inverse if the variables were swapped)
The equation was pretty complicated, plotting $$\displaystyle \left(\frac{3\cdot2^{y_{1}+1}Z+\left(-2\right)^{y_{1}}+\left(-1\right)^{2y_{1}+1}}{3},y_{1}\right)$$ with $$\displaystyle Z$$ being all integers plotted the data set I was given.
I don't know if I can take the inverse or manipulate this to get it in terms of x, or if I have to come at the data from a different direction. Starting with a more simple equation based on similar concepts: $$\displaystyle y=2^x+3^x$$ seemed a good place to start.
I did know that I was asking the same question two different ways, but I didn't want to ask for the inverse of $$\displaystyle y=2^x+3^x$$ and be told it was $$\displaystyle x=2^y+3^y$$, because I specifically need to solve for y.

P.S. I asked more specifically about this data set here, but I haven't found an answer yet.

#### Dr.Peterson

##### Elite Member
I fully understand, and it is a perfectly reasonable thing to ask. If it had been an exercise from a textbook, I'd be much less willing to commit to my answer, which is why I asked.

But, as I said, I doubt that there is an algebraic solution. That is, you probably will not be able to find a formula for the inverse. The function is one-to-one, so it does have an inverse; it just can't be expressed "in closed form" as an equation in x (unless, again, someone else jumps in here with a trick that proves me wrong). This is all the more true of the complicated relation you really want to deal with. (And you were wise to start by considering a similar but simpler example.)

My point was that many students, having only been given problems in class that can be solved by the methods they are learning, assume that an inverse can be found for any function. Your teachers should be aware of this, but (like me, actually) don't have an answer but don't want to definitively state that it is utterly impossible. Sometimes, as I tell my students, it's not your fault that a problem has no solution, but the problem's! The trick is to know the difference.

For some confirmation that it can't be done, see

#### akunzler

##### New member
Ok, good to know.
You explained that really well. Thanks!

#### Cubist

##### New member
If you have an extra constraint on y it might help out.

For example if y must be a +ve integer, then I'm pretty sure there would be an algebraic inverse for all y>some value (this is a hint). NB I am considering the form $$\displaystyle x=2^y+3^y$$

#### akunzler

##### New member
This equation being a more simple version of the concept I am trying to solve, in my real problem y is always an integer, and though there would be values for negative numbers, only positive values apply to my situation. So, I would be fine with limiting it to +ve integers, but the math problem itself would not be constrained to that outside of my situation. Thanks for considering my problem!

#### Cubist

##### New member
To clarify, I have found an algebraic inverse for the +ve integer case.

Would you like some extra hints so that you can find it too? (I'd rather not give you the answer directly because you won't learn as much from that)

NB: I don't think there is an inverse if y is not constrained in some way. (But obviously it could be done numerically.)

#### Dr.Peterson

##### Elite Member
How about a hint as to what you did that does not apply to real numbers? Most of what we consider "algebraic" would.

#### Cubist

##### New member
OK here's several hints, sorry I was probably being too obscure.

I made an approximation to the equation $$\displaystyle x=2^y+3^y$$. Assume a large value of y and which term dominates? This approximate equation can then easily be inverted algebraically. At this point the value obtained for y is a real number that is bigger than the desired integer value - but something simple can be done to obtain the required integer value. Then, to be complete. you can check the range of values for which the method holds. It might be a bigger range than expected.

#### akunzler

##### New member
That makes sense
For example, one simple though not very accurate approximation I made was $$\displaystyle 5\log\left(\sqrt{\frac{x}{2}}\right)=y$$

#### Dr.Peterson

##### Elite Member
I made an approximation to the equation $$\displaystyle x=2^y+3^y$$. Assume a large value of y and which term dominates? This approximate equation can then easily be inverted algebraically. At this point the value obtained for y is a real number that is bigger than the desired integer value - but something simple can be done to obtain the required integer value. Then, to be complete. you can check the range of values for which the method holds. It might be a bigger range than expected.
Rounding an approximate value can be a valid way to solve such a problem. But to make this a full solution to the problem, you need to prove conditions under which rounding is guaranteed to produce the correct value of y; and I would also want to be able to know whether a given x is actually in the domain of the inverse function, which might be considerably more difficult. I haven't pursued your idea at all.

#### Cubist

##### New member
That makes sense
For example, one simple though not very accurate approximation I made was $$\displaystyle 5\log\left(\sqrt{\frac{x}{2}}\right)=y$$
I was actually thinking of the simple approximation $$\displaystyle x≈3^y$$

which leads to $$\displaystyle y≈\frac{\log{\left(x\right)}}{\log{\left(3\right)}}$$

Then to restore the integer constraint, $$\displaystyle y=\left\lfloor \frac{\log{\left(x\right)}}{\log{\left(3\right)}} \right\rfloor$$

To check the range of values for which the method holds, I think you need to consider values of y for which $$\displaystyle 2^y \lt \left(3^{y+1}-3^y\right)$$. This means that the error introduced by the approximation remains lower than the gap between adjacent approximations. I might stand to be corrected on this!

I've tested it numerically from y=1 to 1000, and it gives the correct answer (obviously x gets very large so you need an arbitrary precision calculator). I also did a successful test when y=100,000 but I won't test any higher numbers because my computer was starting to melt at that point

I'll look up the meaning of domain, that Dr. Peterson kindly points out. I hope this doesn't scupper the idea!

#### Cubist

##### New member
Regarding domains (I've looked up the meaning!)...

For the equation A: $$\displaystyle x=2^y+3^y$$
- (constrained) domain (y vals) all integers ⩾ 0
- range (x vals) is a discrete set of +ve integer values that become sparse as y increases

The inverse function B: $$\displaystyle y=\left\lfloor{\frac{\log{\left(x\right)}}{\log{\left(3\right)}}}\right\rfloor$$
- (constrained) domain (x vals) all integers ⩾2
- range (y vals) all integers ⩾ 0

The only way to be sure that an x value is in the range of A (that it could have come from equation A) would be...
1. Use given x to calculate y using B
2. Plug it back into A, $$\displaystyle x_2=2^y+3^y$$
3. Check that x is the same value as $$\displaystyle x_2$$

Wow. Thanks!