When x refuses to be boxed in

A rather peaceful sunday afternoon. I opened up my instagram and started scrolling through the feeds. Out of the blue, an asian beauty popped up and said "if you can't solve , you are gay!". No joke, I literally jumped out my bed, took a piece of white paper and started solving it in a attempt to prove myself not gay. The strategy was pretty straight forward - isolate x. But dear god, this was one of those equations where x refuses to be linear about its feelings just like most "ex"s.
When powers are involved you take log to simplify, that's the golden rule and here's where it lead me to:
A bit of rearrangement gives you:
Now what? After a few excruciating minutes of existential crisis, it finally hit me. I could just match LHS and RHS instead of actually solving for x. All I had to do was multiply the numerator and denominator of RHS with 2.
With a sigh of relief, proving myself not gay, I resumed the video. It presented a slight variation of the same trick and yielded 36 at the end.
But that got me thinking, is that really it? Would there be other solutions for the equation? After all, the solution that occurred to me was a random stroke of luck. Not that I really succeeded in isolating x.
And not just that, the function is only defined for in the real number system. So when I transformed the equation from to , I performed a step that is only valid for positive numbers ().
Seems too incomplete to leave it at that.
*Throws the mobile phone away. Well I proved I am not gay 🤷*
Back to the whiteboard
Let's try to plot the graph of and .

There are three intersecting points in the graph corresponding to the solutions to the equation . "Wait a minute, I only see two" is probably what you are thinking. The point corresponding to is indeed there but the y value, or , is so large that it can't be plotted easily on most graphs. Let's take y axis in logarithmic scale to see all the solutions clearly.

There we go! Three solutions to the problem and is just one among them. But how to get the other two with a non-graphical approach. Enter the Lambert W function.
Lambert W function
To understand the Lambert W function better, let's just forget about the initial equation in question. We'll revisit that in a while.
Now consider the function .
This equation involves both a power of and an exponential of . The beauty of the latter is that all attempts to isolate in terms of , using standard algebraic operations, ends up in vain. These type of equations are called transcendental equations - meaning they cannot be solved using a finite number of additions, subtractions, multiplications, divisions, and root extractions.
Lambert W function, gives us a formal solution to solve a specific set of such transcendental equations that can be manipulated into the form:
In these cases can be solved as:
where W is Lambert W function or the Omega function.
Now what exactly is this W function? To answer that let's further the analyze the function by plotting it.

Notice that different values of can yield the same value of ? That's the characteristic of a many-to-one function. This is contrary to the behavior of a one-to-one or injective functions where each value of have a distinct pre-image .

Now we know that is a many-to-one function. So what's the big deal? Well, by trying to isolate and represent in terms of , what we are essentially doing is trying to find the inverse of , i.e, . And guess what, when you try to find the inverse of a many-to-one function, it ceases to exists as a single function and becomes a multi-valued relation.

So how would the multi-valued inverse relation of look like? Technically it should satisfy the equation which can be plotted.

Notice how the same value of x gives two different values of y. So how do we convert this relation to a predictable function. Behold, branching!

In mathematics, a branch is defined as a maximal connected portion of the inverse that remains "well-behaved" (analytic and single-valued). To put it simply, a branch is just the result of taking a pair of scissors and cutting that curve into pieces so that each piece becomes a proper, predictable function. The point where you cut the function should be at a place where the function transitions from being single-valued to multi-valued—specifically at its critical point, so that each "branch" behaves like a proper function without ambiguity.
The multi-valued inverse relation of will give us two real branches if we split it at the critical point . This gives us two separate, predictable "scissors-cut" functions: and .

For real-valued inputs , the "full" Lambert W relation is written as a piecewise function:
The defining identity of the Lambert W function is:
That's a wrap to Lambert's W function. Let's pivot back to the original question now.
Solving equation using Lambert W function
Let's do some modifications on until it matches the "template" of the function: .
First, we apply to both sides to bring the exponents down and do a bit of rearrangement just like before:
We know that, by logarithmic property, . Substituting this in the equation gives:
The template requires . Right now, our exponent is but our coefficient is . They are opposite in sign. To fix this, we multiply the entire equation by :
Now the equation perfectly matches where: and
To solve for , apply the Lambert W function to both sides:
Finally, multiply by and exponentiate to isolate :
There is a handy identity: . Using this, we can rewrite the solution without the base:
Recall the piecewise Lambert function equation:
When the argument is negative (between and ), we get two branches; when it is positive, we get only one. Since in this case the argument is negative, for each branch, and , we get a different value for , i.e, and .
We are not done yet. To find the negative root, we have to account for the fact that .
can be negative as well.
Assume where is a positive value (). The equation then becomes
Now, let's force this into the template following a similar logic to before:
Now we have the form where: and
Apply the Lambert W function:
Isolate :
Since we defined :
Using the identity again:
Because the argument to the Lambert function is positive, it falls into the part of the function where there is only one branch (). Calculating this gives:
There it is, three solutions to the equation . The content creator, who mad me do all this, should be proud. Well, here's to me unnecessarily saving another day.
നന്ദി... നമസ്കാരം (Nanni Namaskaram)