Here is a more detailed proof of the final result for heterozygous advantage:

= 0  when = at equilibrium

Clearly, this is true either when p = 0 (a "trivial" equilibrium; if we don’t have any A, there can be no evolution!),
or when
Now, notice that the mean fitness (bottom line)
So now:  at equilibrium

Therefore:-

(why?)


, but, is of course = q!!
Here we have another "trivial equilibrium"; if there are no a, q = 0 and the gene frequency remains fixed for A; alternatively, the thing in brackets (i.e. -sp + tq)  = 0, which is the same as saying tq = sp. This latter is the "internal", "non-trivial" equilibrium we want, with both A and a polymorphic (frequency > 0) in the population.
when 
t = sp + tp
(s+t)p = t
so: .....