How do you find the domain and range of ##f(x) = 1/(2-e^x)##?

Domain: ##(-oo, ln(2)) uu (ln(2), +oo)## Range: ##(-oo, 0) uu (1/2, +oo)##

Right from the start, you can say that one value of ##x## will be excluded from the domain of the function because of the restriction to the denominator of the function.

More epecifically, the expression ##(2-e^x)## must not be equal to zero.

The value of ##x## for which condition is not satisfied will be

##2-e^x = 0##

##e^x = 2##

##ln(e^x) = ln(2)##

##x * ln(e) = ln(2) => x = ln(2)##

The domain of the function will thus be ##RR-{ln(2)}##, or ##(-oo, ln(2)) uu (ln(2), +oo)##.

The range of the function will be affected by the fact that the graph has a vertical asymptote at ##x=ln(2)##.

Now, because ##e^x >0, (AA)x##, you get that

##1/(2-e^x) >0## for ##x < ln(2)## and ##1/(2-e^x)<0## for ##x>ln(2)##.

That happens because you have

##lim_(x->-oo)e^x = 0##, for which you have ##f(x) -> 1/2##

##lim_(x->oo)e^x = +oo##, for which you have ##f(x) ->0##

The range of your function will thus be ##(-oo, 0) uu (1/2, +oo)##

graph{1/(2-e^x) [-10, 10, -5, 5]}