# Finding intersection between functions containing logarithms

At what point does $8x^2$ and $64x\log(x)$ intersect?

I'm trying to catch up on my math, but this stumped me. Something awry in my understanding of logarithms.

I figured that I could equate both functions and solve for $0$:

$$8x^2 = 64x\log(x)$$

then divide both sides by $8x$ for:

$$x = 8\log(x)$$

and then find:

$$10^x - x^8 = 0$$

Where did I go wrong? I seem to be stuck doing this by hand.

Thanks!

• You cannot do it by hand (in the sense of finding roots of a polynomial), using standard functions. From your tags, you should probably be using a numerical method – David Peterson Jul 26 '16 at 0:25
• Solving the intersection of a polynomial curve and a transcendental curve will only rarely have an explicit solution. One thing to try here might be Lambert's W function. – hardmath Jul 26 '16 at 0:25
• Thanks guys. I was under the impression that if I could graph it and find that both functions intersect, then i should have been able to come up with an explicit solution by hand. Looking at Lambert's W function right now. – gswamibu Jul 26 '16 at 0:30
• What do you mean where did you go wrong? Why do you think you did anything wrong? – fleablood Jul 26 '16 at 4:46

You didn't do anything wrong, except I would be careful of dividing by $8x$ for general algebra problems because what if $x=0$. But $\log (x)$ is undefined at $0$ so we are good.

Anyways you correctly reach:

$x=8\log(x)$

But the "closed form" is probably not what you expected as it involves the lambert w function:

Solution:

First convert from logarithms base $10$ to base $e$:

$$x=\frac{8 \ln x}{\ln 10}$$

Then the substitution $x=\frac{1}{u}$ gives:

$$\frac{1}{u}=-\frac{8}{\ln 10} \ln u$$

It can be rearranged to this:

$$-\frac{\ln 10}{8}=u \ln u=e^{\ln u}\ln u$$

Therefore:

$$\ln u=W(-\frac{\ln 10}{8})$$

$$u=\frac{1}{x}=e^{W(-\frac{\ln 10}{8})}$$

$$x=e^{-W(-\frac{\ln 10}{8})}$$

Now,

$$W(u)e^{W(u)}:=u$$

Thus,

$$\frac{W(u)}{u}=e^{-W(u)}$$

And we can rewrite our solutions as:

$$x=-\frac{W(-\frac{\ln 10}{8})}{\frac{\ln 10}{8}}$$

• Wow, huge thank you for spending time on this. Looks like I'll be practicing lambert's function tonight until it becomes intuitive. I love how you detailed this step by step for us to refer back to this. – gswamibu Jul 26 '16 at 0:54
• No problem, I just hope there's no careless mistakes. – Ahmed S. Attaalla Jul 26 '16 at 1:14

In fact, there two roots for the equation $x=8\log_{10}(x)$.

Consider the function $$f(x)=x-8\log_{10}(x)\implies f'(x)=1-\frac{8}{x \log (10)}\implies f''(x)=\frac{8}{x^2 \log (10)}$$ The first derivative cancels for $x=\frac{8}{\log (10)}$; it is negative if $x<\frac{8}{\log (10)}$, positive if $x>\frac{8}{\log (10)}$. The second derivative test shows that $x=8$ corresponds to a minimum. Since $f(8)=8-8\log_{10}(8)<0$, then there exactly two roots.

As Ahmed S. Attaalla answered, the analytical solutions are given in terms of Lambert function. They are $$x_1=-\frac{8 W\left(-\frac{\log (10)}{8}\right)}{\log (10)}\approx 1.57231$$ $$x_2=-\frac{8 W_{-1}\left(-\frac{\log (10)}{8}\right)}{\log (10)}\approx 6.50710$$ Sooner or later, you will learn about Lambert function and understand that any equation which can write $A+Bx+C\log(D+Ex)=0$ has analytical expressions in terms of it.

If you cannot use Lambert function, numerical methods would be required. Probably the simplest would be Newton method which, starting with a "reasonable" guess $x_0$, will update it according to $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$

Draw the graphs of $y=x^8$ and $y=10^x$. It then becomes glaringly obvious that they intersect somewhere between $x=0$ and $x=-1$, BUT the equation you started with requires $x$ to be positive, since you're taking its logarithm. Do $y=x^8$ and $y=10^x$ intersect at some point where $x$ is positive? That's a slightly subtler question. However, look at what happens when $x$ goes from $1$ to $2$. You see that $x^8$ goes from $1$ to $256$ while $10^x$ goes from $10$ to $100$. Thus $x^8$ goes from less than $10^x$ to more than $10^x$. Therefore there is at least one intersection somewhere between $x=1$ and $x=2$. Just how many such intersections there are, and whether there are others not between $1$ and $2$, is a more involved question, which I might approach by using derivatives.

Probably the solution to your equation cannot be found algebraically and you'll need numerical methods such as Newton's method.

• You bring up good points. I was thinking about implementing the newton method in python, but it seemed it would rob me of intuitively finding an intersection by hand. – gswamibu Jul 26 '16 at 0:59