# How can I set the plot range to the point where the function becomes zero?

I have a lot of functions (mostly exponential included and more precisely complicated combinations of Gaussian and Slater ones) which decay and become zero in the different points depending on the parameters values. So I can't specify a special point as the range of plot for all of them. For this reason I want to write a simple code which solves the function for zero and gives me the desire point where the function value becomes zero. So I can use the solution of this code as the range of my plots automatically. As a toy example suppose

Plot[Exp[-x^2], {x, 0, pran}, PlotRange -> All]


but when I use

pran=Solve[Exp[-x^2] == 0, x]


I get empty list! why? Any idea? Or alternative?

• Exp[-x^2] never equals zero except in the limit as x -> Infinity or x -> -Infinity. Oct 16 at 5:31
• Pick a "sufficiently" small value, e.g., Solve[Exp[-x^2] == 10^-6, x, PositiveReals] Oct 16 at 5:37