How can I solve for n in the following equation:
$10 = 2^n + 3^n$
Thank you for the assistance.
How can I solve for n in the following equation:
$10 = 2^n + 3^n$
Thank you for the assistance.
Another approach is: $$ 10 = 2^x + 3^x \iff \\ 3^x = 10 - 2^x \iff \\ x \ln(3) = \ln(10-2^x) \iff \\ x = \frac{\ln(10-2^x)}{\ln(3)} $$ So a solution $x^*$ is a fixed point of $$ f(x) = \frac{\ln(10-2^x)}{\ln(3)} $$ A similar calculation would give $x^*$ as fixed point of $$ g(x) = \frac{\ln(10-3^x)}{\ln(2)} $$ It turns out that $f$ is suitable for iteration, because $x^*$ is an attractive fixed point of $f$.
I told my friend Ruby about it
irb> def f(x)
irb> Math.log(10 - 2**x)/Math.log(3)
irb> end
=> :f
and asked her to calculate some values:
irb> x0 = 2.0
=> 2.0
irb> x1 = f(x0)
=> 1.6309297535714573
irb> x2 = f(x1)
=> 1.7585257030106298
irb> x3 = f(x2)
=> 1.7199545709895085
irb> x4 = f(x3)
=> 1.732152321422241
irb> x5 = f(x4)
=> 1.7283476553532908
irb> x6 = f(x5)
=> 1.729539553249585
irb> x7 = f(x6)
=> 1.7291666700381647
irb> x8 = f(x7)
=> 1.7292833754476598
irb> x9 = f(x8)
=> 1.7292468537080912
irb> x10 = f(x9)
=> 1.729258283280372
The sequence converges slower than a Newton iteration, but is less complex.
The graph shows $f$ in red and $g$ in green.
If $n\in\mathbb{N}$, there is no such $n$.
If $n\in\mathbb{R}$, there exists such $n$ by the continuity of function $f(x):=2^x+3^x$ and the use of https://en.wikipedia.org/wiki/Intermediate_value_theorem
Note: I will assume that $n\in \mathbb{R}$, since there does not exist a solution for $n\in \mathbb{N}$.
There does not exist a closed form solution for $n$ in terms of elementary functions. However, you can solve this numerically.
I will use the Newton-Raphson method.
Note 2: From now on, I will use $x$ instead of $n$ as the variable to find, just for convenience of the method.
$$2^x+3^x=10$$
The process is as follows: $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)} \tag{1}$$
The function $f$ to consider is: $$f(x)=2^x+3^x-10$$ Evaluating its derivative: $$f'(x)=2^x\ln(2)+3^x\ln(3)$$ Substituting into equation $(1)$: $$x_{n+1}=x_n-\frac{2^{x_n}+3^{x_n}-10}{2^{x_n}\ln(2)+3^{x_n}\ln(3)}\tag{2}$$ We can iterate $(2)$ by using a spreadsheet or using more sophisticated software such as MATLAB. Let's start with a reasonable guess for the solution $x_0=2$. $$\begin{array}{c|c}n&x_n\\\hline0&2\\1&1.76304\\2&1.72982\\3&1.72926\\4&1.72926\\5&1.72926\end{array}$$
Note that as the iterations $n\to \infty$, $x_n\to x$. Doing this iteration repeatedly gives: $$x\approx 1.729255558981860$$ The function is strictly increasing for all $x\in \mathbb{R}$, therefore we know that there exists only one root.