I have some doubts in understanding the necessity of some steps in the following situation. While solving an algebraic problem, I came across an expression of the following type, where I have to solve for ${a}$: $${x^{a-1}}{y^{a-1}} = {x^{a}}{y^{-1}}$$ I see that there are corresponding like terms on both sides of equation, so I equate the powers (This is what I generally think of.) which gives ${a-1 = a}$, and ${a-1 = -1}$. The second equation implies ${a = 0}$, but is contradicted by the first one.
My first question is: am I right till here? If yes, then is this a coincidence that ${a = 0}$ was not a solution? (I think so.)
More importantly, my second question is: should I go for taking the logarithm on the original equation now, as a greedy approach to get some solution (which, assuming that ${x}$ and ${y}$ obey the required constraints, gives ${a} = {\log_y x}$)? Is this a pitfall if, after getting that contradiction (${a \neq 0}$), instead of using logarithm I claim that there is no solution for ${a}$?
To answer your first question, no, your deductions are incorrect; in general, you cannot simply equate the powers on each variable. For example, consider $x = 4$, $y = 2$, and $a = 2$. Then $$x^{a-1} y^{a-1} = 4 \cdot 2 = 8 = \frac{4^2}{2} = x^a y^{-1},$$ but obviously, the powers of $x$ and $y$ on the RHS and LHS of the equation aren't equal. As a side note, one of your deductions $a - 1 = a$ is very clearly impossible; in the future, use these as red flags to indicate whether or not you're doing something wrong.
Your intuition, however, to use a logarithm to solve for the value of $a$, was correct. If we rearrange the equation, we get $$y^a = x,$$ and taking $\log_y$ on both sides yields $a = \log_y {x}$. If you're unconvinced that $a = \log_y{x}$ satisfies your equation, try coming up with values of $x, y$, and evaluating the powers using your calculator.