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$.

  • $\begingroup$ If you write it as $8\times n\times n=8\times n\times 8\log_2n$, I hope you can see that if $n\neq0$, your equation is equivalent with $n=8\log_2n$ which should be easier to manipulate. You have to check the case $n=0$ separately. $\endgroup$ – Joonas Ilmavirta Jan 8 '15 at 10:01
  • $\begingroup$ Yea I can get to n=8log2n but thats as far as I make it. $\endgroup$ – moesef Jan 8 '15 at 10:02
  • $\begingroup$ There is no elementary way of solving equations that contain the unknown and a logarithm of the unknown. Assuming $n>0$, you have $n=8\log_2n\iff n=\log_2n^8\iff 2^n=n^8$. The only solution is $\approx1.1$ (closed form expressions involve a special function). (Tip: When asking in the future, tell what you already know yourself. This saves others from explaining something you already know.) $\endgroup$ – Joonas Ilmavirta Jan 8 '15 at 10:16
  • $\begingroup$ ...and there is also a second solution, near 44. But these two are all. You can also try using WA. $\endgroup$ – Joonas Ilmavirta Jan 8 '15 at 10:25
  • $\begingroup$ Sure. Thanks for the answer. If you put that exact comment in an answer I'll mark as closed. $\endgroup$ – moesef Jan 8 '15 at 10:25

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.