Find the value of $n$ if $\frac{a^{n+1}+b^{n+1}}{a^n+b^n}=\frac{a+b}{2}$ Now, this question looks simple, it did to me too, at first, but I got stuck at a point and can't get out.

This is how I did it, take a look : 
$$\dfrac{a^{n+1}+b^{n+1}}{a^n+b^n}=\dfrac{a+b}{2}$$
By cross multiplication, we get : 
$$2a^{n+1}+2b^{n+1}=(a+b)(a^n+b^n) = a^{n+1}+b^{n+1}+ab^n+a^nb$$
Transposing the first two terms of RHS to LHS, we obtain :
$$a^{n+1}+b^{n+1}=ab^n+a^nb$$
Now, what I did the first time I attempted this question was that I transposed $a^nb$ to the LHS and $b^{n+1}$ to the RHS but my friend suggested that we could also transpose $ab^n$ to LHS and $b^{n+1}$ to RHS and obtain different results. I suggested that we look at some constraints and arrive at condition based answers. Here's how I proceeded :

$1^{st}$ method :
$$a^{n+1}-a^nb=ab^n-b^{n+1}$$
$$\implies a^n(a-b)=b^n(a-b)$$
Now, instead of just cancelling out $a-b$, I thought of putting a condition that would enable the cancellation to be possible. That condition is that $a-b$ should not be equal to $0$, so $a \neq b$
Now, on assuming that $a \neq b$, we get :
$$a^n=b^n$$
Now, there are two cases when this is possible, one, when $n=0$, so $a^n=b^n=1$ and other, when $a=b$, but, we have already assumed that $a \neq b$ to arrive at this result, which means that the case that suggests that $n = 0$ is true. So, the $1^{st}$ method gives us the conclusion that $a \neq b \implies n = 0$

Here's the $2^{nd}$ method :
$$a^{n+1}-ab^n=a^nb-b^{n+1}$$
This time, we take $a$ and $b$ common on the LHS and the RHS respectively to obtain :
$$a(a^n-b^n)=b(a^n-b^n)$$
Now, we can cancel out $(a^n-b^n)$ from both LHS  and RHS if $a^n-b^n \neq 0 \implies a^n \neq b^n$

Now, this can be true only if $a \neq b$ and $n \neq 0$ because if any of these two cases end up being true, then $a^n$ will be equal to $b^n$. So, we assume that $a \neq b$ and $n \neq 0$ and cancel optu $a^n-b^n$ from both LHS and RHS to obtain :
$$a=b$$
This is the part that confuses me. We assume that $a \neq b$ to arrive at a conclusion that $a = b$, is it possible? Do outcomes like this appear frequently (this is the first time I have encountered something like this)? Did I make some mistake? How do I get out of this?

In my opinion (which is most probably wrong), the second method gives us no useful outcome and tells us that $a$ can not be equal to $b$ which is almost surely wrong because I don't see any restriction that would show that $a \neq b$.
I do think that a better approach would be to take two cases : $a \neq b$ and $a = b$ and then expand them and then combine the outcomes. But I'd like to know what's wrong with this approach and how do I correct it?
Thanks!
 A: You have cancelled $(a-b)$ both sides assuming that $a\neq b$. What you have missed out is that $a=b$ is also a solution to the first method of solving. (Because then $0=0$)

Here's some more explanation:
Let's have a look where you've ended up after the first method:
$$a^n(a-b)=b^n(a-b)$$
Now if we have to cancel out $(a-b)$ on both sides, we must assume that $a\neq b$. This ends us up with:
$$a^n=b^n$$
Now $n$ cannot be $1$ because of the assumption we made to arrive here. Hence $n$ must be $0$ 
Now let's go back to the point before we cancelled $(a-b)$. Note that if $a=b$, the equality is respected:
$$0=0$$
Hence, $a=b$ is another solution to this. From here, If we consider it in the form of : $a^n=b^n$, we get $n=1$.

Let's walk over to method $2$ (again, just before the cancellation):
$$a(a^n-b^n)=b(a^n-b^n)$$
Again, assuming $a^n\neq b^n$, we end up in what we already found earlier:
$$a=b$$
 Now looking at it in the eyes of : $a^n=b^n$, $n$ cannot be $0$ because of our underlying assumption that $a^n\neq b^n$. Hence $n$ should be $1$
And for the last time, if we don't cancel , but simply observe, $a^n=b^n$ is also a solution , leading us to $n=0$ 
Thus, both the methods yield the same result . (The beauty of Mathematics)

P.S : You can place the values $0$ and $1$ for $n$ in the question and see that everything checks out like it should. 
P.P.S : I have assumed that : $a=b \implies n=1$ and $a^n=b^n\implies n=0$ . You can do it the other way round too.
A: In the second proof you assume $a^n\neq b^n$ and get $a=b$. Since this is a contradiction, it can't happen, and your original assumption was wrong. 
You must have therefore $a^n=b^n$ and consider the various possibilities involved. $a=b$ is one of these, but that doesn't support the assumption $a^n\neq b^n$ - it arises from a different case.
A: As $ab\ne0$
$$a^n=b^n\implies (a/b)^n=1$$
Which implies 
Either $a/b=1$ and $n$ is finite for real $a/b$
Or $a/b=-1$ and $n$ is even for real $a/b$
Or $n=0$
