\documentclass[a4paper]{article} \usepackage{mathtools} \usepackage{amsfonts} \usepackage{listings} \begin{document} \title{Solving $2^x=x^{32}$} \author{Amit Yaron} \date{Jan 3, 2025} \maketitle \begin{abstract} Here's one equation that can be solved using the Lambert W function. The Lambert W function is the formal way to write a solution. But even when you use that function, you can still find an exact solution using some intuition. In this article, I will show how to solve the equation. \end{abstract} \section{The Lambert W Function} The Lambert W function is defined as follows: \[ x=ye^y\Rightarrow y=W_n(x) \] for some integer value $n$. \\ $W_n$ is called a branch of the Lambert W function. \\ Now, let us derive $y=xe^x$ to find how many real solutions there are for a given $y$: \[ y=xe^x\Rightarrow y'=(x+1)e^x \] Thus, \[ y'=0\Rightarrow x=-1 \] It is a minimum point. And the minimum value of $y$ is $-e^{-1}$\\ Now, \[ x>0\Rightarrow xe^x>0\\ \] and \[ x<0\Rightarrow xe^x<0\\ \] And it can easily be found that if $e^{-1}0$, we only take $W_0$ of that argument. The following Python script approximates $x$: \begin{lstlisting} import numpy as np def nr_approx(func,derivative,start_x): x=start_x while(True): new_x=x-func(x)/derivative(x) if np.abs(x-new_x)<1e-14: break x=new_x return new_x f=lambda x: x*np.e**x-np.log(2)/32 d=lambda x: (x+1)*np.e**x y=nr_approx(f,d,0) x=-np.e**-y print("x=%f"%x) \end{lstlisting} The solution found is: \[ x\approx-0.979017 \] \end{document}