Skip to main content
4 of 9
added 28 characters in body
taiwan12
  • 3.3k
  • 11
  • 58

I do the calculus exercise. You wonder about the intersection, if any of $e^x$ with $u x + v$. We examine the difference $e^x- ux -v$. It is a strictly convex function.

  • if $u<0$, the function is strictly increasing and vanishes at a unique abscissa which will be the one of the your intersection point. Newton method whatever the starting point will converge to the root. Better to start on its right, I have not detailed more.
  • if $u=0$ we have horizontal lines, left to reader.
  • if $u>0$, this time the difference is still convex but with a minimum. The value is $u - u \log u - v$. If this quantity is negative you have two intersection points, if it vanishes you have a tangent, if it is positive you have no intersection points. To find the intersection points do Newton method with either large positive or large negative starting point.

Hope it helps.

Edit: the starting point is crucial so the above is ill-advised to say "large starting point". Because as long as $e^x$ is large Newton's method will simply do roughly $x\mapsto x-1$ and take a long time to reach the root if you started too far (but I assume your real life examples have some reasonable bounds ,say $-10<x<10$). If $x$ is very negative (and slope $u$ positive), then situation is better, because the studied function whose root is aimed at is quasi linear, so after one iteration we are near $-v/u$ it seems and it should go fast (untested). So it seems to be easier to find the left-intersection point. In the case with negative slope, the sole intersection point can presumably be obtained starting Newton with the $-v/u$ mentioned above. Well, may be not the place for a mathematical treatise, let's leave some work to the AIs.

Mathematical treatise

I will focus on the case u>0. In order to analyze mathematically it is convenient to make a translation. The equation to solve is e^x = ux+v. Let t= x+v/u. On finds that the equation becomes e^t = ct with c= u exp(v/u). This can be transformed if one so wishes into a Lambert-W function type of equation -texp(-t)=-c so z exp(z)=-c with z=-t I will not use that.

Geometrically, as c>0 we see clearly that there is a c_0 such that c<c_0 give no solution, c=c_0 one, and c>c_0 gives two. It turns out that c_o = e: the line with slope e touches the exponential at point (1,e). Thus we can say in advance that for c>e we will have a solution w_1 in (0,1) and a solution w_2>1. This second solution is the most delicate because it probes when c increases the exponential regime.

Let's start with w_1. It is clear geometrically that it is larger than the abscissa of intersection of our line through the origin of slope c and the tangent to the exponential at t=0 of slope 1. So w_1 > 1/(c-1). We are in the convex decreasing part of the difference e^t - ct, so put t_0 = 1/(c-1) and apply Newton iteration, this gives a strictly increasing sequence which should be efficient to find the limit w_1. The formula to iterate is next(t) = (1-t)/(c exp(-t) - 1).

More challenging is finding w_2. We would like a starting point to the right of it. I convert the equation e^t = c t into the equation t = d + log (t)with d = log(c) >1. If we plot the line of equation y = t-d we want its intersection the graph of log with abscissa w_2>1. The difference t - d - log(t) is convex and increasing for t>1 with zero slope at t=1 and negative value 1-d at t=1. We look for starting point sufficiently to the right but not too much so that Newton will not start from too far. Now if d is large, the solution should be approximately t=d + log(d). In fact we see that iterating t<- d+log(t) will converge geometrically, and stay always to the left of the seeked root w_2. So perhaps do this a couple of times, then apply Newton which will give us a point on the right of w_2 hopefully not too far and continue with Newton. So we set t_0=d, iterate a bunch of times t<- d +log(t), then switch to next(t) = ((d-1)+log(t))/(1 - 1/t).

Posting this for now, a numerical example later.

user691586
  • 4.6k
  • 4
  • 15