Consider the following function:
$$ f(x)=\beta~e^{-x^2}-\frac{\beta +e}{e~x}+1~, $$
where $\beta$ is some parameter and $e$ represents the Euler constant.
I've been trying to get Mathematica to find the roots, using
FindRoot[1 + β E^-x^2 - (E + β)/(E x), {x, 1.4}]
However there seems to be some problem when, for instance, $\beta=2.3$, since FindRoot
outputs $\text{x=1.32902}$ but the function is only zero, for that value of $\beta$, when $x=0$.
What am I doing wrong?
Edit: The answers by David Keith and John Doty are absolutely correct. However it seems I have not formulated the question in the right way. My problem is not that with that code Mathematica cannot find the right answer (gets stuck in a local minimum) but the fact that it outputs an incorrect answer without showing some kind of error message. I'm using version 11.0.
1 + β E^-x^2 - (E + β)/(E x)
byx
introduces an artificial root at0
butFindRoot[E x (1 + E^-x^2 \[Beta]) == E + \[Beta], {x, 1.4}]
works nicely... $\endgroup$FindRoot
, etc.), it looks like a bug that came and went. Maybe someone with 11.0 will come along and verify. (I still think it might be better to explicitly mentionFindRoot::lstol
, which should have been emitted.) $\endgroup$