I have the following equation that I would like to isolate the variable $a$ from, but I am a bit stuck. The variable $k$ is known; however, $x$ and $a$ are unknowns.
$$ x^2 + \frac{a}{(1-a)} x -\frac{1}{2(1-a)k}=0 $$
Upon solving for $x$ we find
$$ x = \frac 12 \bigg\{-\frac{a}{(1-a)}\pm \bigg[\frac{a^2}{(1-a)^2}+\frac{2}{(1-a)k}\bigg]^{1/2}\bigg\} $$
At this point I think that we can substitute this solution into the first equation to obtain
$$ \frac 14 \bigg\{-\frac{a}{(1-a)}\pm \bigg[\frac{a^2}{(1-a)^2}+\frac{2}{(1-a)k}\bigg]^{1/2}\bigg\}^2 + \frac{a}{2(1-a)} \bigg\{-\frac{a}{(1-a)}\pm \bigg[\frac{a^2}{(1-a)^2}+\frac{2}{(1-a)k}\bigg]^{1/2}\bigg\} -\frac{1}{2(1-a)k}=0 $$
Can this expression be inverted to give $a=?$, and if so, how can I achieve this?
The equation is $x^2-x+\frac{x}{1-a}-\frac1{2k(1-a)}=0$, therefore $$\frac1{1-a}\left(x-\frac1{2k}\right) =x-x^2\\ a=1-\frac{2kx-1}{2kx(1-x)}$$ for $k\ne0$, $x\notin\{ 0,1,\frac1{2k}\}$. If $k=\frac12$ and $x=1$, then every $a\ne 1$ satisfies the equation. In all other cases either the equation does not exist or no $a$ satisfies it.