Combining linear and exponential functions I am struggling with this problem:
At $x=0$ I own $b$ units. Every year I deposit $a$ units. The bank pays an interest rate of $c$ every year. After how many years I will own $d$ units?
$$(ax+b)*e^{cx} = d$$
How am I able to solve this for $x$?
I know that
$$ax+b = d \Rightarrow x = {d-b \over a}$$
and
$$e^{cx} = d  \Rightarrow x ={\ln d \over c}$$ 
but I have no idea how to solve the first equation. Thank you for any help!
 A: You can't, not with elementary functions. As soon as your unknown is both outside and inside exp/log functions, it's hopeless - there's no closed form in terms of elementary functions. You have to attack the problem numerically (iteration, bisection, Newton's method,...). In this case, you can express the solution through the Lambert's W function, but that's just a fancy name for a numerical procedure.
A: The amount you have at the beginning is $b$.
After $1$ year, you have $a+b(1+c)$.
After $2$ years, you have $a+(a+b(1+c))(1+c)$.
After $3$ years, you have $a+(a+(a+b(1+c))(1+c))(1+c)$.
etc.
After $N$ years, you have
$$b(1+c)^N+a(1+c)^{N-1}+a(1+c)^{N-2}+\cdots+a(1+c)+a$$
$$=\left(b+\frac{a}{c}\right)(1+c)^N-\frac{a}{c}$$
For a given $d$, in general you can't have integer $N$ which gives you the exact amount $d$. But you have find the integer $N$ that you amount first exceed $d$, by
$$N=\bigg\lceil \frac{\log\frac{d+a/c}{b+a/c}}{\log(1+c)} \bigg\rceil $$
If we are allowed to approximate it as a continuous time process, then we have
$$\frac{dM}{dx}=a+cM$$
where $M$ is the amount of money you have at $x$.
The solution is
$$M=\left(b+\frac{a}{c}\right)e^{cx}-\frac{a}{c}$$
Then you can solve
$$\left(b+\frac{a}{c}\right)e^{cx}-\frac{a}{c}=d$$
to obtain
$$x=\frac{1}{c}\ln\frac{d+a/c}{b+a/c}$$
