Subjects algebra

Lambert W Solve

Step-by-step solutions with LaTeX - clean, fast, and student-friendly.

Use the AI math solver

1. **State the problem:** Solve for $x$ in the equation $$2^x + x = 5.$$\n\n2. **Rewrite the equation:** We want to isolate $x$ but the equation mixes an exponential and a linear term, so direct algebraic methods won't work easily.\n\n3. **Express $2^x$ in terms of $e$:} Recall that $2^x = e^{x \ln 2}$. Substitute this to get $$e^{x \ln 2} + x = 5.$$\n\n4. **Isolate the exponential term:** $$e^{x \ln 2} = 5 - x.$$\n\n5. **Set $y = 5 - x$ to simplify:** Then $$e^{(5 - y) \ln 2} = y.$$\nRewrite as $$e^{5 \ln 2} e^{-y \ln 2} = y.$$\n\n6. **Simplify the exponentials:** $$2^5 e^{-y \ln 2} = y,$$ which is $$32 e^{-y \ln 2} = y.$$\n\n7. **Rewrite as:** $$y = 32 e^{-y \ln 2}.$$\nMultiply both sides by $e^{y \ln 2}$ to get $$y e^{y \ln 2} = 32.$$\n\n8. **Substitute $z = y \ln 2$:** Then $$y = \frac{z}{\ln 2}$$ and the equation becomes $$\frac{z}{\ln 2} e^{z} = 32,$$ or $$z e^{z} = 32 \ln 2.$$\n\n9. **Use Lambert W function:** By definition, if $$z e^{z} = a,$$ then $$z = W(a).$$ So $$z = W(32 \ln 2).$$\n\n10. **Back-substitute for $y$ and $x$:** $$y = \frac{W(32 \ln 2)}{\ln 2},$$ and since $$y = 5 - x,$$ we have $$x = 5 - \frac{W(32 \ln 2)}{\ln 2}.$$\n\n**Final answer:** $$\boxed{x = 5 - \frac{W(32 \ln 2)}{\ln 2}}.$$