In a recent piece of homework I needed to solve an equation of the form $ae^x + bx +c = 0$ where $a,b$ and $c$ are constants. I could not do it; no matter how I tried I either went in circles or hit a brick wall. Can someone demonstrate a general method for solving equations of this form? Please show every step in your answers.
Solving equations of the form $ae^x + bx +c =0$
3.3k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 2 best solutions below
On
As said, there is an analytical solution in terms of Lambert function $$x=-W(d)-\frac{c}{b}$$ where $$d=\frac{a }{b}e^{-\frac{c}{b}}$$ If you do not want to (or cannot) use Lambert function, then numerical methods are the way to go.
Probably the simplest should be Newton method which, starting from a "reasonable" guess $x_0$, will update it according to $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$ For the example you give in comments $$f(x)=5-12x - 88e^x$$ $$f'(x)=-12-88e^x$$ A look at the graph of the function shows that the solution is close to $-1.5$. So, let start iterating at $x_0=-1.5$; the method will generates the following iterates : $-1.393646353$, $-1.397047564$, $-1.397051301$ which is the solution for ten significant figures.
\begin{align} a e^{x}+b x+c&=0 \end{align} Substitute $bx+c=y$: \begin{align} a e^{((-c+y)/b)}+y &= 0 \\ -y &= ae^{-c/b}e^{y/b} \\ \frac{-y}{b}e^{-y/b} &= \frac ab e^{-c/b} \end{align} The last equation is in the form $u\exp(u)=w$, which has a solution in terms of Lambert $W$ function: \begin{align} u&=W(w). \end{align} Hence \begin{align} \frac{-y}{b}&=W(\frac ab e^{(-c/b)}) \\ y&=-b W(a/b e^{\frac{-c}{b})} \\ x&=-W(\frac ab e^{-c/b})- \frac cb. \end{align} In particular, equation $88\exp(x)+12x-5=0$ with $a=88,b=12,c=-5$ has one real root, since the argument of $W$ is positive: \begin{align} x&=-W_0(\frac{22}{3} e^\frac{5}{12}))+\frac{5}{12} \approx-1.3970513. \end{align}
Edit:
Lambert's W function is included in the Gnu Scientific Library (GSL) and is freely available by means of many computer systems and packages (wolframalpha, R, Asymptote, python scipy.special to name a few).