I would like to study the sign of this function (potential) and show the region (positive-negative)
These are the parameters followed by the code (left figure)
a = 1; c = 1;
b = -1; d = 1;
p = 1; q = -1;
f1= (Exp[-2 r a] p)/(2 r c) + (Exp[-2 r b] p)/(2 r d)
f2= ( Exp[-2 r a] q)/(2 r c) + (Exp[-2 r b] q)/(2 r d)
Plot[{ f1,f2 } , {r, -2, 2}, PlotRange -> Automatic]
As we see for this case, we obtain different signs for f1 and f2. In four different regions I would like to show them in the plot, A legend it possible only for two regions?
For example, If we change b and d with the same sign (d=-1 and b=-1) (right figure) have only two regions. Please any suggestion and recommendation will be usefull
Plot[{f1, f2 } , {r, -2, 2}, ColorFunctionScaling -> False, ColorFunction -> (If[#2 > 0, Blue, Red]&)]
? $\endgroup$ – MarcoB Nov 25 '20 at 6:47