Solving logarithmic equation for $n$

140 Views Asked by At

I have the following equation and I am trying to isolate $n$:

$$8n^2 = 64 n\log_2 n$$

Haven't done algebra in years and can't figure out how to get rid of the $\log_2$.

1

There are 1 best solutions below

0
On BEST ANSWER

As said in comments, because of the logarithm, $n \gt 0$; so, as you wrote, the equation simplifies to $$n = 8 n\log_2 n$$ which does not have a solution in terms of elementary functions.

However, any equation which can be written as $$a+b x+c \log(d+ex)=0$$ has a solution which is expressed in terms of the Lambert function. In your case, there are two solutions given by $$n_1=-\frac{8 }{\log (2)}W\left(-\frac{\log (2)}{8}\right)\approx 1.099997030$$ $$n_2=-\frac{8 }{\log (2)}W_{-1}\left(-\frac{\log (2)}{8}\right)\approx 43.55926044$$

If you do not want (or cannot) to use Lambert function, you could use a root-finding method such as Newton. Starting with a "reasonable" guess $n_0$, this will find the solution of $$f(n)=n - 8 n\log_2 n=0$$ updating the guess according to $$n_{k+1}=n_k-\frac{f(n_k)}{f'(n_k)}$$ For your case, the iterative schme will then be $$n_{k+1}=\frac{8 n_k (\log (n_k)-1)}{n_k \log (2)-8}$$ Let us start with a very poor estimate such as $n_0=20$; Newton successive iterates will then be $54.4636$, $43.8990$, $43.5597$, $43.5593$ which is the solution for six significant figures.