How do I solve the following equation? $$ Ae^{Bx} + Cx = D $$
Solve for $x$, where $A, B, C, D$ are real constants. This popped up in a run of the mill high school first-order DE question. No matter what I try with logarithms it doesn't seem like I can isolate an $x$ onto one side of the equation. Is this equation unsolvable analytically? If not, how does one generally go about solving something like this?
 A: \begin{align} 
a\exp(bx) + cx &= d
\tag{1}\label{1}
\end{align}
to get the solution
in terms of the real constants $a,b,c,d$,
we need
the Lambert W function.
In order to apply it, we need to 
convert \eqref{1} to the form $u\exp(u)=v$:
\begin{align}
\frac{ab}c\exp(bx)
+bx 
&= \frac{bd}c
,\\
bx
-\frac{bd}c 
&= 
-\frac{ab}c\exp(bx)
,\\
bx
-\frac{bd}c 
&= 
-\frac{ab}c\exp\left(bx-\frac{bd}c+\frac{bd}c\right)
,\\
\left(bx
-\frac{bd}c\right) 
&= 
-\frac{ab}c\exp\left(bx-\frac{bd}c\right)
\exp\left(\frac{bd}c\right)
,\\
\left(\frac{bd}c-bx\right) 
\exp\left(\frac{bd}c-bx\right)
&= 
\frac{ab}c
\exp\left(\frac{bd}c\right)
,\\
\end{align}  
and we have succeed in transforming \eqref{1}
to $u\exp(u)=v$, where
\begin{align}
u&=\frac{bd}c-bx
,\\
v&=
\frac{ab}c
\exp\left(\frac{bd}c\right)
.
\end{align}
Now we can apply Lambert W function,
which will help to "untie" $u\exp(u)$ term:
\begin{align}
\operatorname{W}(u\exp(u))
&=\operatorname{W}(v)
,\\
u&=\operatorname{W}(v)
,\\
\frac{bd}c-bx
&=\operatorname{W}(v)
,\\
x&=\frac{d}c-\frac{\operatorname{W}(v)}b
\tag{2}\label{2}
.
\end{align}
And \eqref{2} without any extra efforts,
can tell the number of real solutions for \eqref{1},
which depends on the argument $v$.
If $v>0$, there is only one 
real solution,
\begin{align}
x&=\frac{d}c-\frac{\operatorname{W_0}(v)}b
,
\end{align}
if $v<-\frac1{\mathrm{e}}$, there are no 
real solutions,
if $-\frac1{\mathrm{e}}<v<0$,
there are two distinct real solutions,
\begin{align}
x_1&=\frac{d}c-\frac{\operatorname{W_0}(v)}b
,\\
x_2&=\frac{d}c-\frac{\operatorname{W_{-1}}(v)}b
,
\end{align}
with the bonus information that
in this case
\begin{align}
-1<\operatorname{W_0}(v)&<0
,\\
\operatorname{W_{-1}}(v)&<-1
.
\end{align}
And if $v=-\frac1{\mathrm{e}}$,
the two solutions coincide, 
\begin{align}
\operatorname{W_0}(v)&=
\operatorname{W_{-1}}(v)=-1
,
\end{align}
and there is again just one real solution,
which has the simplest form,
\begin{align}
x &= \frac{d}c+\frac1b
.
\end{align}
