# Math Help - Show that cosx = lnx has a unique solution

1. ## Show that cosx = lnx has a unique solution

Hi,

I was looking at some old exams in Numerical Analysis and found this question.

Show that cosx = lnx has a unique solution in $]0,\pi/2]$. First of all, I think the sign $]$ is a typo, and perhaps it should be $($ since $ln0$ is $-\infty$. Then again, it could perhaps be a closed interval as well...

The first thing I think of is to look at the function $f(x) = cos(x)-ln(x)$. Now if I assume that the interval is $[0,\pi/2]$ then I think I could, by the intermediate value theorem show that there exists a solution. I would need to do some limit-stuff because of $0$ and $ln(x)$...

Another thing that comes to mind is perhaps rewriting this in the following manner;
$
e^{cos(x)} = x \Rightarrow x - e^{cos(x)} = 0.$

If I let $g(x) = e^{cos(x)}$ then,
$
x-g(x) = 0$
if there is some number $\xi$ in our interval such that
$\xi - g(\xi) = 0$. That is, if $\xi$ is a fixed-point of $g$.

A unique fixed point exists if $g$ is a contraction..
Since $g'(x) = -sin(x)e^{cos(x)}$ we have that
$|g'(x)|<1$ for all $x$ in $[0,pi/2]$ and so a unique solution to our problem exists.

The problem from the exam comes with a suggested solution as well. The solution says that since the function cosx is monotonically decreasing in the given interval, and the function ln(x) is monotonically increasing in the same interval, they can only cross in one point.. I do not find this solution particularly satisfying, but what do I know.

2. We'll examine the function $f(x) = \cos{x} - \ln{x}$.

If we let $x = 1$ we find that $f(1) = \cos{1} - \ln{1} = \cos{1} > 0$.

If we let $x = \frac{\pi}{2}$ we find that $\displaystyle f\left(\frac{\pi}{2}\right) = \cos{\frac{\pi}{2}} - \ln{\frac{\pi}{2}} = -\ln{\frac{\pi}{2}} < 0$.

Since the function changes sign, we know that there's a solution.

Now let's examine the derivative...

$f'(x) = -\sin{x} - \frac{1}{x}$

$\displaystyle = -\left(\sin{x} + \frac{1}{x}\right)$

$< 0$ in the interval $\displaystyle \left(0, \frac{\pi}{2}\right]$.

Since the derivative is always negative, that means that the function is always decreasing and therefore does not turn.

So there can only be one solution.

3. I think that a Numerical Analyst would simply sketch the graphs of $\cos x$ and $\ln x,$ note that they intersect just once, and regard that as sufficient.

4. BobP: You're probably right, but I do not see the fun in that

5. May be that is interesting to find the solutions of the equation $\cos z= \ln z$ when z is complex. Using Newton's iterations I found...

z= 1.30296400122... + i 0 [the only on the real axis...]

z= -1.28661280828... + i 1.58835248621...

z= -7.26120884757... - i 1.95753445328...

z= -13.4349581438... -i 2.0737796597...

z= 12.5123914472... + i 1.58339003977...

Of course some more solution may exists and it would be interesting to valuate if their number is finite or infinite...

Kind regards

$\chi$ $\sigma$