2

$$4^x+\sin(x)=10$$

I would use a log function to solve it but I don't know what to do with $\sin(x)$. What is the $x$ value of the exponent?

6 Answers6

6

you can solve it numerically(trail and error) after taking the $\log$ $$x=\frac{\log(10-\sin x)}{\log 4}$$ if you want the closed-form, it will become $$x=\frac{\log(10-\sin \frac{\log(10-\sin \frac{\log(10-\sin .....)}{\log 4})}{\log 4})}{\log 4}$$

E.H.E
  • 23,280
6

Rearrange to get $$x=\frac{\log(10-\sin x)}{\log 4}$$ as in Essam's answer. After that, you can use fixpoint iteration to get $x = 1.585\dotso$

Fix point iteration is: $$x_n = \frac{\log(10-\sin x_{n-1})}{\log 4}$$

Now interestingly, you can get a very accurate approximate solution which is $\dfrac{\log 3} {\log 2} \approx 1.585\dotso$ which ends up being accurate to 5 s.f. This is because if we do fixpoint iteration starting with $x_1 = \pi/2$, you get $x_2 = \dfrac{\log 3} {\log 2}$ which is already by coincidence close to $\pi/2 \approx 1.57$.

So $$x \approx \dfrac{\log 3}{\log 2} \approx \dfrac \pi 2$$

wlad
  • 8,185
4

Note that $f^{\prime}(x)=4^{x} \log(4)+\cos(x)$. So we can get a convergent sequence with the Newton-Raphson algorithm.

$$x_i=x_{i-1}-\frac{f(x_{i-1})}{f^{\prime}(x_{i-1})}$$

And here is the implentation in R.

    x0<-1
    for(i in 1:100){
    f<-4^{x0}+sin(x0)-10
    fprime<-4^{x0}*log(4)+cos(x0)
    x0<-x0-f/fprime
    }
    x0
[1] 1.584971

The algorithm works quite well for such problems and you don't even need the 100 iterations that I used. 3-4 is good enough for this problem.

JohnK
  • 6,444
  • 4
  • 28
  • 54
3

If you look at the plot of function $$f(x)=4^x+\sin(x)-10$$ you should notice that it is far away from being linear; so, finding the zero would require more or less iterations depending on the quality of the starting guess.

In the other hand, take logarithms and consider finding the zero of $$g(x)=x \log(4)-\log\big(10-\sin(x)\big)$$ This function is very linear. For a first estimate, expand $g(x)$ as a Taylor series around $x=0$ (being lazy as I am); this gives $$g(x)=-\log (10)+x \left(\frac{1}{10}+\log (4)\right)+O\left(x^2\right)$$ So, solving the approximation for $x$ gives $$x_0=\frac{10 \log (10)}{1+10 \log (4)}\approx 1.549212022$$ Now, let us start Newton method $$g'(x)=\frac{\cos (x)}{10-\sin (x)}+\log (4)$$ and the iterates will be $$x_1=1.584919403$$ $$x_2=1.584970552$$ which is the solution for ten significant figures.

If, instead, the expansion was done at $x=\frac \pi 2$, it would have been $$g(x)=(\pi \log (2)-\log (9))+\left(x-\frac{\pi }{2}\right) \log (4)+O\left(\left(x-\frac{\pi }{2}\right)^2\right)$$ from which $$x_0=\frac{\log (3)}{\log (2)}\approx 1.584962501$$ and the first iterate of Newton method would the be $$x_1=1.584970552$$

If, built at $x=\frac \pi 2$, the expansion used one more term $$g(x)=(\pi \log (2)-\log (9))+\left(x-\frac{\pi }{2}\right) \log (4)-\frac{1}{18} \left(x-\frac{\pi }{2}\right)^2+O\left(\left(x-\frac{\pi }{2}\right)^3\right)$$ solving the quadratic would give $$x_0=\frac{\pi }{2}+9 \log (4)-3 \sqrt{\log (4) (\pi +9 \log (4))-2 \log (9)}\approx 1.584970552$$

  • Similar questions are innumerable on Mathematics and the "standard" answer is Newton's method. IMO, true value is added when you discuss the number of solutions and a root separation scheme such that a specified method (Newton or other) is guaranteed to converge to every distinct root. Good initial values are welcome as well, provided their computational cost does not exceed that of gross estimates with similar convergence speed. This said, nothing against your answer. –  Jun 06 '15 at 12:28
  • I totally agree with all your statements ! What is interesting (to me) is to find the proper change of variable or function transform which make the problem almost linear. If you look at my profile, any simulation I run involves the resolution of zillions of nonlinear equations. Then, any saving is significant. Cheers :-) – Claude Leibovici Jun 06 '15 at 13:23
  • Does linearizing the function improve the convergence speed ? If yes, can't we "automate" linearization by means of the second derivative (possibly numerically evaluated) ? –  Jun 06 '15 at 15:44
  • Yes. If you want, we could discuss further about it. Send me an e-mail if you want (my e-mail address is in my profile). For the second point, for many cases, yes too and we can even do more (for some problems I use methods which show octic convergence). I hope to hear from you. Cheers. – Claude Leibovici Jun 06 '15 at 17:58
2

Finding an accurate solution by a numerical method such as Newton's is not a big deal (any modern calculator does that for you). The real issue with such transcendental equations is to count and isolate the roots.

In this particular case, thanks to the boundedness of the sine function, you can claim that for any solution $x$, $$9\le4^x\le11$$or $$\log_4(9)\le x\le\log_4(11).$$

By continuity there is certainly a solution, as

$$4^{\log_4(9)}+\sin(\log_4(9))\le10\le4^{\log_4(11)}+\sin(\log_4(11)).$$

The derivative of the function is $$f'(x)=\ln(4)4^x+\cos(x),$$ and in the given range, you are sure that $$9\ln(4)-1\le f'(x).$$ As the function is strictly increasing, this proves a single real root.

0

Here is a series expansion using:

Can all irrational numbers be expressed by infinite number series

$$4^x+\sin(x)=10\implies x=\log_4\left(10+\sum_{n=1}^\infty\sum_{m=0}^n\frac{(-1)^m}{n!}\binom nm\left(\frac{i(2m-n)}{\ln(4)}\right)^{(n+1)}\left(-\frac i{20}\right)^n10^{\frac{i(2m-n)}{\ln(4)}+1}\right)=\log_4\left(10+\sum_{n=1}^\infty\sum_{m=0}^n \frac{(-1)^m\left(i\frac{m-\frac n2}{\ln(2)}\right)!}{\left(i\frac{m-\frac n2}{\ln(2)}-n+1\right)!(n-m)!m!}\left(-\frac i{20}\right)^n10^{\frac{i(2m-n)}{\ln(4)}+1}\right) $$

with factorial power $u^{(v)}$ shown here

Is there a way to find the inner sum?

Тyma Gaidash
  • 12,081