Lambert Function

Have you ever heard of a mathematical function called the Lambert function? If not, this is an interesting function that may come in handy in some applications. To understand it, let us consider the following example

xex=y and ask ourselves can we express or solve the above equation for variable x and given y i.e., x=f(y)? At first glance, it may feel simple, but then we will realize that the term x is outside and inside the exponential function and cannot be separated. The question is, is it at all possible?

The answer is yes, and that function f(y) is the Lambert function. For real x and y the solution for xex=y exists if and only if ye1. More specifically, x=W0(y),y0x=W1(y) and W0(y),e1y<0 For the case of complex variables refer.

We will solve one equation which can sometimes can come in handy and whose solution involves Lambert function in the solution. We solve for x in the following equation:

eax=bx+c and assume a0,b0,c0. For other cases it can be solved without having to invoke Lambert function. Now we solve with sequence of steps as follows:

bx+c=eax(bx+c)eax=1(bx+c)eabxbeacb=eacb(bx+c)ea(bx+c)b=eacba(bx+c)ea(bx+c)b=aeacba(bx+c)bea(bx+c)b=aeacbbabx+acb=W1(aeacbb)x=bW1(aeacbb)acab

One of the applications of the Lambert function occurs in the field of communications. Consider a simple example: the following is the Shannon capacity expression for AWGN (additive white Gaussian noise) channel

C=Blog2(1+ρB)bit/s where C is the capacity, B is the Bandwidth, and ρ=P/N0 is the normalized signal-to-noise ratio (SNR). What is the required B for given C and ρ? Here as well, the term B is outside and inside the logarithmic function. Before we provide solution for this problem consider a related simplified version of the problem,

Let k0 to solve zln(1+1z)=k One can show that after some mathematical manipulations, that z can be rewritten in terms of k using the Lambert function as follows: z=kW1(kek)+k and this holds when the condition that lnk<k1 holds, which is indeed always true. However, some times the solution may not be desirable in that situation solution doesn’t exist. For example, if the requirement is that z has to be positive then for solution to exist k1.

Now we can solve the initial problem which we intended to solve i.e., to solve for B in terms of other variables. The solution exists if Cρln2. Then we can obtain the solution in closed form and it is obtained by utilizing the above result and substituting: B=zρ and k=Cρln2

Following is the MATLAB code snippet which we can use to test the above expression

clc;
clear;

% Let first solve for C for given B and rho
rho = 2;
B = 1e3; % 1 KHz

% Obtaining Capacity value
C = B*log2(1 + rho/B);

% Now we shall use the expression given above
k = (C/rho)*log(2); 

% solving for z
z = (-k)/(k + lambertw(-1,-k*exp(-k)));

% Rescaling to obtain desired B, estimated using the Lambert function
Bcheck = z*rho;

Code results:

>> B

B =

        1000

>> Bcheck

Bcheck =

   1000.0000

Another application in the wireless domain where the Lambert function comes into play is obtaining closed-form expression for maximizing energy efficiency with respect to power (p) i.e., maximizing the following expression Blog2(1+pβBN0)pμ+Pcircuit where β is the pathloss parameter, N0 is noise power spectral density, μ amplifier efficiency and Pcircuit is the circuit power. All variables are constant except p. If carefully derived, the optimal solution p involves the Lambert function. On a side note, strictly speaking, Lambert is not a closed-form function because this function cannot be represented in terms of elementary functions. We can think of it as another function similar to Q-function or Gamma function.

Zakir Hussain Shaik
Zakir Hussain Shaik
PhD Student in Communications Systems

My research interests include wireless communications, distributed signal processing, and convex optimization