Can someone show me how to solve $2^x + x = 4$? I tried every way imaginable to solve the function $2^x + x  = 4$, but I can't figure it out. I know it's not an easy one. I spend my free time helping people out with their math questions online, and I came across this. My guess is the guy made a typo and meant $x^2 + x  = 4$, but I would still like to know how one would solve $2^x + x  = 4$. Thanks.
 A: You're right that it's hard. The solution involves the unusual "Lambert W" function, which is not an elementary function (you can't express it in terms of arithmetic, trig functions, exponentials and logarithms, polynomial roots, etc.)
The Lambert W function is defined as the inverse of the function $f(x) = x e^x$. So if $y \equiv x e^x$, then $W(y) = x$.


*

*Starting from $2^x + x = 4$, subtract $x$ from both sides. $2^x = 4-x$. 

*Divide by $2^x$. $1 = (4-x)2^{-x}$

*To make the coefficient of the $2^{-x}$ term match the exponent, multiply both sides by $2^4$:
$$2^4 = (4-x)2^{4-x}$$ 

*Rewrite $2^{4-x}$ in terms of base $e$...
$$2^4 = (4-x)e^{\ln(2)(4-x)}$$
...then multiply both sides by $\ln(2)$ to ensure that the coefficient and exponent continue matching.
$$2^4 \ln(2) = \ln(2)(4-x)e^{\ln(2)(4-x)}$$

*The right hand side matches the form "$ye^y$" needed for the Lambert W function. Apply the Lambert W function to both sides.
$W[2^4\ln(2)] = \ln(2)(4-x)$

*Solve for $x$.
$$x = 4-\frac{W[\ln(2)2^4]}{\ln(2)} \approx 1.386$$
A: You can use Newton's method, to solve this numerically.
There is no algebraic solution for equations like that. Newton's method is a pretty basic numerical method and goes like this:
We search the root of the function $f(x)=2^x+x-4$. It is $f'(x)=\ln(2)2^x+1$.
The iteration is as follows:
$x_{k+1}=x_k-\dfrac{f(x_k)}{f'(x_k)}$
We have to guess our $x_0$. As The Count has pointed out, a good guess it $x\in (1,2)$. So we take $x_0=\frac32$.
Then $x_1=\frac32-\dfrac{f(\frac32)}{f'(\frac32)}\approx 1.38906424$
This converges rapidly. Already after two steps the digits do not change and I get 1.38616698 on my display.
Wolframalpha gives $1.38617$
A: We have
\begin{align}
2^x+x=&4\\
x=&4-2^x\\
4x-3x=&4-2^x\\
4x=&4-2^x+3x\\
x=&\frac{1}{4}\left(4-2^x+3x\right)
\end{align}
Define the function $f:\mathbb{R}\to \mathbb{R}$ by $f(x)=\frac{1}{4}\left(4-2^x+3x\right)$. It is easy to see that $ x $ is the solution of the equation $2^x+x=4$ if, and only if, $ x $ is the fixed point of the function $f$, that is, $f(x)=x$.
Use the derivatives 
$$
f^{\prime}(x)=\dfrac{3-\ln\left(2\right){\cdot}2^x}{4}
\quad \mbox{ and } \quad
f^{\prime\prime}(x)= -\ln^2\left(2\right){\cdot}2^{x-2}
$$
to prove that $ f $ is a $ \lambda $ -contraction in interval $[0,2]$ and that $f([0,+2])\subseteq [0,+2]$.Then, by Banach's contraction theorem, the sequence $ x_n = f^n (x) $ converges to the single fixed point of $ f $ in the interval $ [0,2] $ which is the only solution of the equation $2^x+x=4$ in the interval $ [0,2] $.
A: Using Newton-raphson Method
$$y=2^x+x-4$$
$$y'=2^x\log 2+1$$
$$x_{i+1}=x_i-\frac{y_i}{y'_i}$$
so
$$x_{i+1}=x_i-\frac{2^{x_i}+x_i-4}{2^{x_i}\log 2+1}$$
