The Lambert W Function and AI

Patrick Reany

3/29/2023

On 3/28/2023, I posed the following problem to BingChat:

Patrick: Let W(z) be the Lambert W function that satisfies the equation W(z)e^{W(z)} = z.
Assuming that W is an invertible function, show that z e^z = W^{-1}(z).

This is what it returned:

So, once again, BingChat had a problem displaying for the user what it has internally. I'm not
sure where BingChat went wrong. Perhaps it got confused between functional inverse and
multiplicative inverse.

What I am about to show you, I cannot input into the user input box one line at a time because
the carriage returns force an immediate input. So, I wrote this all out in Notepad and then
copied the whole thing into the input box and then hit enter.

What do you think of this proof?

We begin with

W(z)e^{W(z)} = z.                                     (Eq. 1)

Next, we introduce the temporary variable y as

y = W(z) .                                                 (Eq. 2)

Therefore, because W is invertible,

z = W^{-1}(y).                                           (Eq. 3)

Substituting this into (Eq. 1), we get

W(W^{-1}(y))e^{W(W^{-1}(y))} = z.       (Eq. 4)

Using the fact that

W(W^{-1}(y)) = y,                                     (Eq. 5)

we get for (Eq. 4),

ye^{y} = z.                                                  (Eq. 6)

But from (Eq. 3) we get, by substitution, that

ye^{y} = W^{-1}(y).                                 (Eq. 7)

Now, on replacing the dummy variable y by z, we get

ze^{z} = W^{-1}(z),                                 (Eq. 8)

as we needed to show. And we are done.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

To this, BingChat replied:

I think this proof is correct and well-written. You have used the definition of the
inverse function and the property of the Lambert W function in a clear and logical way.
You have also introduced a temporary variable to simplify the notation and avoid
confusion. You have shown each step of the proof with an equation number and a
justification. You have also stated the result that you needed to show at the end.
Well done!

My comments: 1) I wasn't going for the shortest proof I could find. 2) BingChat's response was
well-crafted. It started with an overall appraisal and then listed supporting points for its evaluation.
3) BingChat seems to understand that 'Eq.' stands for 'equation'. It also seems to understand that
the temporary variable was introduced to help avoid confusion. How could it know that? I think
that that is very sophisticated thinking on BingChat's part.


On 3/29/2023, I posed the same problem to ChatGPT:

Patrick: Let W(z) be the Lambert W function that satisfies the equation W(z)e^{W(z)} = z.
Assuming that W is an invertible function, show that z e^z = W^{-1}(z).

It's reply was

To show that z e^z = W^{-1}(z), we need to first prove that W(W^{-1}(z)) = z.

Let y = W^{-1}(z), which means that W(y)e^{W(y)} = z.

Now, let x = W(y), which means that x e^x = z.

Therefore, z e^z = (W(W^{-1}(z))) e^{W(W^{-1}(z))} = y e^y = W^{-1}(z),
as required.

So we have shown that z e^z = W^{-1}(z) if W is an invertible function.

My first complaint is that ChatGPT was told that W is invertible, so that
W(W^{-1}(z)) = z is given. My second complaint is that, by the defining property of W,

W(y)e^{W(y)} = y, not W(y)e^{W(y)} = z.

My third complaint is that, since ChatGTP has defined y by y = W^{-1}(z),
then z = W(y), not x = W(y). There's no reason to introduce another variable, in this case x.


Now, I'll rate these chatbots. BingChat seemed to get confused about how to interpret
the inverse. And ChatGTP seemed to not understand what was given information and how
to smoothly convert the given equation to the final equation. I'll give BingChat 4
points out of 5, and ChatGTP 3 points out of 5. Still, for LLMs, that's very good.

A final comment on the proofs. Both chatbots preferred to introduce a second variable by
setting it to W^{-1}(z). That is,

y = W^{-1}(z) or x = W^{-1}(z).

But I preferred to introduce a second variable by setting it equal to W(z). That is,

y = W(z),

which seems intuitively easier for me to deal with.