# solving quadratic equation involving log

• Jul 27th 2011, 08:49 PM
kiwi5
Hi,
How do you solve an equation with a quadratic expression on one side and a log expression on the other?
The specific question is:

2*n*log10(n) = 0.1*n^2

(Background: this is actually for an algorithm analysis question - I am trying to find the intersection points of the worst-case running times of two algorithms)

Thanks
• Jul 27th 2011, 08:54 PM
Prove It
Re: solving quadratic equation involving log
Well if you write this as

\displaystyle \begin{align*} 2n\log_{10}{n} &= 0.1n^2 \\ 0 &= 0.1n^2 - 2n\log_{10}n \\ 0 &= n(0.1n - 2\log_{10}{n}) \end{align*}

Since $\displaystyle \log_{10}{0}$ is undefined, we can't accept $\displaystyle n = 0$ as a solution, which means we have

$\displaystyle 0 = 0.1n - 2\log_{10}{n}$

You will need to use a numerical method to solve this.
• Jul 27th 2011, 08:55 PM
pickslides
Re: solving quadratic equation involving log
This is a tricky one, but maybe we can work it around a bit so the solution might be easier to find.

$\displaystyle 2n\log_{10}n = 0.1n^2$

$\displaystyle \log_{10}n = \frac{0.1n^2}{2n}$

$\displaystyle \log_{10}n = 0.05n$

$\displaystyle n = 10^{0.05n}$

You can solve it numerically from here.
• Jul 27th 2011, 09:04 PM
kiwi5
Re: solving quadratic equation involving log
Thanks a lot for the fast replies.
I also got up to n = 10^(0.05*n) and did not know how to proceed any further. What is meant by solving it numerically, exactly? Does it basically mean a brute-force approach?
Cheers
• Jul 27th 2011, 09:09 PM
pickslides
Re: solving quadratic equation involving log
Yep, brute force, open up a spreadsheet you'll find $n \approx 29$
• Jul 28th 2011, 07:33 AM
mithgar
Re: solving quadratic equation involving log