Canadian economist Mike Moffat asks on Twitter:
Math nerd Q: Is there a way to solve $e^x + x = 5$ for $x$, without using a numerical method?
Canadian economist Mike Moffat asks on Twitter:
Math nerd Q: Is there a way to solve $e^x + x = 5$ for $x$, without using a numerical method?
Write $y=5-x$. Then $ye^y=e^5$. Using the Lambert W function, this gives $x=5-W(e^5)$.
Yes, write it as $e^x =(5-x)$, then $e^5 e^{x-5} = (5-x)$ then $e^5 =(5-x)e^{5-x}$. Denote $y=5-x$. Equation becomes $e^5 = y*e^y$ which is an implicit equation defining Lambert W function. The $ y = W(e^5)$ and $x = 5- W(e^5)$.
$W(e^5)$ is approximately $3.69$ hence $x = 1.31$, see Wolfram-Alpha
Write $y = 5-x$, giving
$$e^{5-y} = y$$
and hence
$$y e^y = e^5$$
This can be inverted using the Lambert W function to give
$$y = W(e^5)$$
and hence
$$x = 5 - W(e^5)$$
Rewrite the equation and take the natural log:
$ e^x=5-x $. Then $ x=ln(5-x) $. Or $ x=ln(5)+ln(1-\frac{x}{5}) $. Linearizing the second RHS term gives: $ ln(1-\frac{x}{5})\approx-\frac{x}{5}+O(x^2) $. Hence an approximate answer for x is obtained by: $ x\approx ln(5)-\frac{x}{5} $, yielding: $ x\approx\frac{5}{6}\cdot ln(5)=1.34 $. Compared to the answer obtained by the Lambert W-function this answer is about 2% off.
If you do not want to use Lambert function or any numerical method, you can have explicit approximations using Newton-like methods of high order $n$ starting at $x=1$.
For example $$x_{(2)}=\frac{5}{1+e}$$ $$x_{(3)}=\frac{10+14 e-e^2}{2+8 e+e^2}$$ $$x_{(4)}=\frac{60+296 e+32 e^2-4 e^3}{12+116 e+56 e^2+2 e^3}$$ $$x_{(5)}=\frac{720+8016 e+4344 e^2-120 e^3-18 e^4}{144+2592 e+3048 e^2+456 e^3+6 e^4}$$ $$x_{(6)}=\frac{14400+286464 e+381696 e^2+45504 e^3-4224 e^4-96 e^5}{2880+81984 e+189696 e^2+69984 e^3+4416 e^4+24 e^5}$$ I stop here because the formulae start to be too large for the page.
Converted to decimals, the above approximations are $$\{1.3447071,1.3061341,1.3064721,1.3065586,1.3065589\}$$
Step 1. Transform the equation $e^x+x=5$ into $e^x=5-x$
Step 2. Write each side of the new equation as function : $y_1=e^x$ and $y_2=5-x$
Step 3. Graph these two functions in Desmos Graphing Calculator (you find its application in internet)
Step 4. Find the intersection of the two graphs. It has an $x$ and $y$ value.
Step.5 The $x$-value is the solution of our equation : $x=1.307$ (approximately)