2
$\begingroup$

The problem is as follows:

$\textrm{Solve and round $x$ to two decimals}$

$$\ln x - \sin 2x= 0$$

There is no indication whether if is allowed to use a calculator or software assistance like Maple. Therefore my first choice was to use any algebraic manipulation if this can be solved that way.

However, the only thing I could come up was to use this:

$$\ln x - \sin 2x= 0$$

$$\ln x - \ln e^{sin 2x}=0$$

$$\ln\left (\frac{x}{e^{\sin 2x}} \right )=0$$

$$\textrm{antiln}\left (\ln\left (\frac{x}{e^{\sin 2x}} \right ) \right)= \textrm{antiln} (0)$$

$$\frac{x}{e^{\sin 2x}}= 1$$

$$x-e^{\sin 2x}=0$$

But it got stuck here, moreover, If I try to use the inverse function of the sine equation does not help much.

I'm also confused about this step with logarithm manipulation:

If I use the $\textrm{antiln}$ just straight at the beginning of the equation;

$$\ln x - \sin 2x= 0$$

$$\textrm{antiln}\left( \ln x- \sin 2x \right ) = \textrm{antiln} (0)$$

Would become into:

$$x - e^{\sin 2x}= e^{0}=1$$

But this latter equation does not seem the same of what I obtained before. Did I misunderstood something?. I need assistance with these doubts.

Edit:

Now moving onto Maple (which is the part which has not yet been answered):

I tried using this command:

solve(ln(x)-sin(2*x)=0,x)

and I got:

$$1/2*\textrm{RootOf}\left(_Z-2\exp(sin(_Z))\right )$$

I don't know what does it mean?, and why it does not produce a numeric result?. Can somebody help me with this matter?.

I'd like also some help how to make Maple to plot a graph of the function showing the answer. How do I achieve this?.

$\endgroup$
5
  • $\begingroup$ No, applying the antilogarithm (aka $e^x$) first would lead to $e^{\ln x - \sin 2x} = {x \over e^{\sin 2x}}$ which is the same expression. Subtracting exponents is dividing the bases. $\endgroup$
    – Andrew Li
    Jul 1, 2018 at 3:36
  • $\begingroup$ Also I don't think you can solve this analytically. WA gives a numerical approximation. $\endgroup$
    – Andrew Li
    Jul 1, 2018 at 3:39
  • $\begingroup$ @AndrewLi Thanks for reminding me about the mistake what I did in the latter part of the antilogarithm. Sorry. I also tried WA as you mentioned and I confirmed that it produces a number but I'm looking if somebody knows if it can be solved analytically and of course what does it mean the answer Maple produces. $\endgroup$ Jul 1, 2018 at 3:40
  • $\begingroup$ If you aren't allowed a computer, are you allowed a calculator or at least tables? $\endgroup$ Jul 1, 2018 at 4:04
  • $\begingroup$ @RossMillikan As it is mentioned, there is no clear caveat regarding not using a calculator. So I assume yes I can use any assistance available my question was if it can be solved without using such tools and what was the meaning of the answer that I obtained with Maple, to which the latter part has not yet been answered. $\endgroup$ Jul 1, 2018 at 17:09

3 Answers 3

5
$\begingroup$

I strongly doubt you will be able to solve this equation analytically for $x$; it is a transcendental equation where the variable appears in both arguments of transcendental functions. This will require some numerical methods to solve such as iterative root-finding methods.

You can employ Newton's which is given by

$$ x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}, $$

where $$ f(x) = \ln(x) -\sin (2x), \quad f'(x) = \frac{1}{x_n} - 2\cos(2x_n). $$

Using an initial value $x_0 = 1/2$, WA gives the following $x = 1.399942...$ reaching machine precision after $7$ iterations. The associated diagram is given by

enter image description here

In response to OP's comments:

Determining a suitable initial guess $x_0$ can present some issues. I would advise you consult the wiki article for more details. One way in determining a good initial guess is to plot the functions. This gives a rough value for $x_0$ value by inspection.

The RoofOf output is what Maple produces for solve-for equations. It is a placeholder for all the roots of some variable. You can then apply various functions to this such as evalf etc. to get some numerical result.

The video lecture by MapleSoft shows how to utilise the Student[Calculus1] package in Maple. It discusses

  • Root finding methods.
  • Display the corresponding graph with tangent lines similar to the WA output.
$\endgroup$
6
  • $\begingroup$ Can you kindly tell me what is the commend of WA to specific what numerical method to approximate with? Appreciation in advance $\endgroup$
    – ℋolo
    Jul 1, 2018 at 4:10
  • 1
    $\begingroup$ @Holo Sure. The commands are as follows; solve $f(x) = 0$ using Newton's method. You can also select Secant or bisection method. $\endgroup$ Jul 1, 2018 at 4:15
  • $\begingroup$ @Rumplestillskin Why should I start from $\frac{1}{2}$ for Newton's method? How could I get to that conclusion beforehand?. Is it a value assumed randomly?. There is a second part of the problem which has not yet been answered of what is the meaning of the answer I got from Maple and how can I obtain the graph you obtained using Maple? $\endgroup$ Jul 1, 2018 at 17:32
  • $\begingroup$ @ChrisSteinbeckBell I have updated my answer for clarity. $\endgroup$ Jul 2, 2018 at 7:30
  • $\begingroup$ @Rumplestillskin You hit the nail in the head about how to select the initial guess when using the Newton method. I've read the wiki article and it helped. But one way or another it looks that transcendental equations cannot be solved analytically and in the end i'll need to resort to some kind of software aid. $\endgroup$ Jul 3, 2018 at 3:17
4
$\begingroup$

The solution is clearly around $\frac \pi 2$.

So, for an approximation of the root, use the Taylor expansion built around this point and get $$\log (x)-\sin (2 x)=\log \left(\frac{\pi }{2}\right)+\left(2+\frac{2}{\pi }\right) \left(x-\frac{\pi}{2}\right)-\frac{2 \left(x-\frac{\pi }{2}\right)^2}{\pi ^2}+O\left(\left(x-\frac{\pi }{2}\right)^3\right)$$ Ignoring the higher order terms, solve the quadratic in $\left(x-\frac{\pi}{2}\right)$ . This would give $$x=\frac{1}{2} \left(2 \pi +\pi ^2-\sqrt{\pi ^2+2 \pi ^3+\pi ^4+2 \pi ^2 \log \left(\frac{\pi }{2}\right)}\right)\approx 1.40172 $$ while the exact solution is $\approx 1.39943$ and this is not too bad.

Sooner or later, you will learn that, better than Taylor series, functions can be locally approximated using Padé approximants. The simplest $[1,1]$ would write $$f(x)=\frac{f(a)+\frac{ \left(2 f'(a)^2-f(a) f''(a)\right)}{2 f'(a)}(x-a)}{1-\frac{ f''(a)}{2 f'(a)}(x-a)}$$ Then, just solving, for your case, this would give $$x=\frac \pi 2 \left(1+\frac{(1+\pi ) \log \left(\frac{4}{\pi ^2}\right)}{2 (1+\pi )^2+\log \left(\frac{\pi }{2}\right)} \right)\approx 1.40175$$

If you use Newton methods, the iterates would be $$\left( \begin{array}{cc} n & x_n \\ 0 & 1.570796327 \\ 1 & 1.399522975 \\ 2 & 1.399428868 \\ 3 & 1.399428866 \end{array} \right)$$

$\endgroup$
2
  • $\begingroup$ Can you tell me how did you obtained $\frac{\pi}{2}$ to be a solution to the equation?. It's been a time since I learned Taylor series, can you explain how to obtain the Taylor expansion for the sine function. I'm stuck at that part in your answer. Can you show it more explicitly? I'm not familiar with [Padé approximants] (bit.ly/2tKb8qC) the article in Wikipedia is not very helpful. Perhaps can you explain it a bit how you used it in this problem?. I mean I understand the notations of derivatives but where does [1,1] comes from?. $\endgroup$ Jul 1, 2018 at 17:29
  • 1
    $\begingroup$ I think stating "the solution is clearly around $\pi/2$" isn't very helpful to the OP. If it was so clear I am sure (s)he wouldn't have any issues with the question at hand. $\endgroup$ Jul 1, 2018 at 22:10
2
$\begingroup$

I assume the problem is to solve $\, \ln x - \sin 2x= 0 \,$ using hand calculation to two decimal place accuracy. A brief sketch shows that $x < \pi/2$ but not by much. More precisely, let $\, x = (1 - t) \pi/2 \,$ where $\, t \,$ is is the fraction by which $\, x \,$ is less than $\, \pi/2, \,$ and we guess that $\, t \,$ is much less than $\,1.\,$

Using this we get the first term becomes $\, \ln x = \ln( (1 - t) \pi/2) = \ln (1-t) +\ln (\pi / 2) .\,$ The second term becomes $\, \sin 2x = \sin((1 - t) \pi) = \sin(\pi - \pi t) = \sin(\pi t). \,$ Using these the equation becomes $\, \ln (1-t) +\ln (\pi / 2) - \sin(\pi t) = 0. \,$ Since $\, t \,$ is small, simple linear approximation gives us $\, \ln(1 - t) \approx -t \,$ and $\, \sin(\pi t) \approx \pi t. \,$ Using these approximations we get $\, - t + \ln(\pi/2) - \pi t = 0. \,$ By algebraic simplification we get $\, \ln (\pi /2) \approx (\pi + 1) t. \,$ Solving for $\, t \,$ gives $\, t \approx (\ln (\pi /2))/(\pi + 1). \,$ Calculation now gives $\, t \approx 0.11 \,$ and $\, x \approx 1.40. \,$

$\endgroup$
3
  • $\begingroup$ Where does $\frac{\pi}{2}$ value comes from?. Why $x=(1-t)\frac{\pi}{2}$?. The rest from there I'm lost. Why $\sin(\pi t)- \ln (1-t)$?. Can you explain this part?. Maybe you can develop a little bit more your answer?. $\endgroup$ Jul 1, 2018 at 17:36
  • $\begingroup$ @ChrisSteinbeckBell I have expanded my answer. I hope it is more understandable. $\endgroup$
    – Somos
    Jul 1, 2018 at 18:23
  • $\begingroup$ Thanks for expanding a bit your answer but I'm stuck at the approximation of $\ln(1-t)\approx -t$ and $\sin(\pi t)\approx \pi t$. How do I prove that? Why do we establish these are the approximations?. I can understand better if you add an explanation to this part in your answer. If you explain that I can take it from the rest. $\endgroup$ Jul 3, 2018 at 3:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .