# Exponential Linear Intersection

For a given exponential curve and a given line, can we know if and where they intersect?

That is, for two equations \(y\) and \(z\) \[ y = mx + b \] \[ z = e^{nx} + c\] can we solve \(y = z\), or even tell if there is a solution? \[ mx + b = e^{nx} + c \]

A better mathmatician than I might be able to solve that, but in the meantime let's graph an example. Below \(y\) intersects \(z\), but not \(z'\).

Looking at this graph we can see that the exponential gradient starts shallow and ends up steep. And if the curves intersect, it must be at points where there gradients are unequal, else they'd be parralel. Assuming both curves have a positive gradient, at the first intersection the gradient of \(z\) must be less than that of \(y\), and vice versa at the second intersection. And as both curves are smooth, somewhere in between these intersections the gradients must be equal.

Differentiating these functions we get \[ {dy \over dx} = m \] \[ {dz \over dx} = ne^{nx}\] and when equated we can easily solve for \(x\) \[ ne^{nx} = m \] \[ e^{nx} = { m \over n } \] \[ nx = \ln { m \over n } \] \[ nx = \ln m - \ln n \] \[ x = { \ln m - \ln n \over n } \]

So now we know that when \( x = { \ln m - \ln n \over n } \) the lines are parallel, and if the lines intersect at all \(z\) must be less than \(y\) at this point.

Once we know there the lines intersect, we can resort to numerical methods to find the intersection itself, such as a binary search or the Newton-Raphson method.