$$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?
$$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?
On
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$$
On
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.
On
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$$
On
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.
On
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?
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}$$