# How would I maximize $Ae^{-(x-b)^2}+Be^{-(x-c)^2}$?

Someone me asked this and I was unable to answer. How can I maximize the function $f(x)=Ae^{-(x-b)^2}+Be^{-(x-c)^2}$?

Progress: For $A=B$, this is the same as maximizing $-(x-b)^2(x-c)^2$, which is easy. If $A\neq B$, I'm not sure how to factor in the coefficients, however.

-

$f'(x)=-2(x-b)Ae^{-(x-b)^2}-2(x-c)Be^{-(x-c)^2}$. This looks like it won't yield to algebra and will need a numerical solution. I would start at the average of $b$ and $c$ and go from there. You could use a root-finder on this or a maximizer on the original. Routines are given in any numerical analysis text.
I was hoping there's an exact solution through some clever manipulation. Like, the derivative of $e^{-(x-b)^2}+e^{-(x-c)^2}$ is also difficult to solve with algebra, but since the relationship between the two summands is "equal" you can intuitively replace this problem with that of maximizing $-(x-b)^2(x-c)^2$ (i.e. the maximum is at the average). From here it doesn't seem like a far stretch to be able to do the same with unequal coefficients, as long as you figure out how they factor into the entire dirty business. But maybe this is just my lack of experience talking... – add Feb 8 '13 at 22:38