Find the domain of $(\frac{2+x}{1-x})^{\frac{1}{x}}$
I tried to find the domain of this function but could not find.Then i referred the symbolab.com domain calculator,and it showed me a technique to find the domain of the functions of the type $f(x)^{g(x)}$.It found out the doamin as $[-2,0)\cup(0,1)$
It says for finding the domain of the functions of the type $f(x)^{g(x)}$,The condition is $f(x)\geq0$
The reason it gave was
$\sqrt{f(x)}=f(x)^{\frac{1}{2}}$(or any even root) has real values only when $f(x)\geq 0$
Therefore a function of the form $f(x)^{g(x)}$ is only defined for $f(x)\geq 0$ since $g(x)$ may take values like $\frac{1}{2},\frac{3}{4}...$.
I am confused here because i think $g(x)$ may take values like $\frac{1}{3},\frac{1}{7}...$ also in which $f(x)<0$ is also allowed.
But the domain it gave was correct because i verified from the graphing calculator desmos.com.But i am confused why it took only $f(x)\geq 0$ and not $<0$
Please help me clarify this confusion or please suggest me some other method to find the domain of the functions of the type $f(x)^{g(x)}$.