I need to calculate the $\mathrm{pH}$ of a salt of weak acid and weak base in an aqueous solution.
Method I used for calculation
For a salt of weak acid and weak base (assuming complete dissociation of salt) both cation and anion part of salt undergo hydrolysis. When cation part undergo hydrolysis, since they are the conjugate base of weak acid, they grab $\ce{H+}$ from water and releases $\ce{OH-}$ ions. Similarly, when anion part undergo hydrolysis they release $\ce{H3O+}$ ions.
This $\ce{H+}$ and $\ce{OH-}$ may react to give water. If we have same concentrations of these ions the solution will have a $\mathrm{pH}~7.$ If there is any excess of any of these ions after reaction, then the $\mathrm{pH}$ of the solution may be greater than or less than $7.$ But my answer didn't match up with what is given in my text.
Textbook answer
Formula given in my textbook is
$$\mathrm{pH} = \frac{1}{2}\left(\log K_\mathrm{b} - \log K_\mathrm{a} - \log K_\mathrm{w}\right)$$
where $K_\mathrm{b}$ is dissociation constant of base, $K_\mathrm{a}$ is dissociation constant of acid and $K_\mathrm{w}$ is ionic product of water.
When I try to derive this formula I need to make some assumptions like degree of hydrolysis of both anionic and cationic part of salt is equal. And the $\ce{H+}$ in the solution is contributed by the dissociation of weak acid how can this be possible. The dissociation of the weak acid formed from salt hydrolysis is been suppressed by already available concentration of its conjugate base (anion part of salt).