# Computing the sign of an expression

Can you please help with the following. I would like to compute the sign of an expression:

Sign[Sqrt σ +
E^((p - v0)^2/(2 σ^2))
Sqrt[π] (p - v0) Erfc[(-p + v0)/(Sqrt σ)]]


All 3 variables p, v0 and sigma are positive. Is there a way in which I can actually evaluate this expression?

I have deduced that for p higher or equal to v0 this expression is positive.

How can I check the sign of this expression when p is smaller than v0? For instance, assuming p goes to zero and sigma is 5 times smaller than v0?

Thanks a lot for your support, highly appreciated.

As $$\sigma>0$$ we can divide the expression by $$\sigma$$ without changing its sign. Then, defining $$x=(p-v_0)/\sigma$$, the expression becomes

Sign[Sqrt + E^(x^2/2)*Sqrt[π]*x*Erfc[-x/Sqrt]]


This expression seems to be positive for any $$x\in\mathbb{R}$$, so I'd say that the answer to your question is that your Sign[...] is always 1:

LogPlot[Sqrt + E^(x^2/2)*Sqrt[π]*x*Erfc[-x/Sqrt], {x, -1000, 10},
WorkingPrecision -> 100, PlotRange -> All] The asymptotes of your expression are

• $$\sqrt{2}/x^2$$ for $$x\to-\infty$$, which is positive,
• $$2x\sqrt{\pi} e^{\frac{x^2}{2}}$$ for $$x\to+\infty$$, which is positive.
• @Roman, thank you so much. I managed to compute a limit by assuming p=0, sigma>0, as v0 goes to infinity and I get -sqrt(2)*sigma. Your solution is more elegant, thanks! Jan 17 at 13:18
• @Daniel, thank you. I think it should either be multiplied by (-x) or have -x inside the Erfc function. Otherwise it returns -infinity. Jan 17 at 13:23
• Sorry, I had made a typo, it should read : Erfc[ - x/(Sqrt)] and then: Limit[Sqrt + E^(x^2/2) Sqrt[\[Pi]] x Erfc[-x/(Sqrt)], x -> -Infinity]what gives zero. I will delete the wrong comment. Jan 17 at 13:48

It seems that the sign of the expression is more complex, it is not always positive.

Clear[f, x0];
f[x_] := Sqrt + E^(x^2/2)*Sqrt[π]*x*Erfc[-x/Sqrt];
NMinimize[f[x], x];
x0 = %[[2, 1, 2]]
f[x0]
Plot[f[x], {x, x0 - 1, x0 + 1}, PlotPoints -> 400]
FindRoot[f[x], {x, x0}]


{-1.46626, {x -> -38.5039}}

{x -> -38.3605} • No, what you're seeing is an artefact of using insufficient WorkingPrecision. Jan 18 at 8:30