general formula,salt from strong base(p) and weak acid(q).
peter.vlasschaert@gmail.com,     28/09/2016

kill(all)$

salt : M(p)A(q),p,q , M = metal anion, A = non metal kation
       M(p)A(q) = strong base(p) + weak acid (q),ca=Cb=c
                = NaOH   (p=1)   + HAc   (q=1)  =  NaAc + H(2)O
       q -> i=1..q -> ka1,ka2,..,kaq     ( choose p,q=2);

v:h*ka1+2*ka1*ka2;
w:h^2+h*ka1+ka1*ka2;
q:v/w;
p1:cb*p+h=ca*q+kw/h;

p2 : ev(lhs(p1)-rhs(p1)=0,ca=c,cb=c);

p3:(-1)*factor(p2);

p4:-1*(num(lhs(p3)))=0;

first approximation : M(p)A(q),p,q = 1..2,ka1,ka2

p5:ev(p4,kw=0);

p6:factor(p5);

p7:part(lhs(p6),2);

m1:ev(p7,h=0)$
m2:coeff(lhs(p7),h^1)$
m3:coeff(lhs(p7),h^2)$
m4:coeff(lhs(p7),h^3)$

p8:m1+m2*h+m3*h^2+m4*h^3=0;

example : M(p)A(q) , q=1 => M(p)A(1)
p=1 => M(1)A(1)=NaAc

p9:ev(p4,ka2=0);

p10:factor(p9);

p11:part(p10,1,2)=0;

approximation ka << c ,p=1,q=1 ,NaAc 'aq' 
         NaAc        -> Na(+) + Ac(-)
reason : Ac(-)+H(2)O -> HAc   + OH(-)
          c              
         -x             x      x
        --------------------------- 
        c-x             x      x
       
        kh = equilibrium hydrolysis = x^2/(c-x)  
 
        1e)        kh = ([OH(-)]*[HAc])/[Ac(-)]*[H(+)]/[H(+)]=kw/ka1
        2e)        kh = x^2/(c-x) ,c > x = [OH(-)] = kw/[H(+)]
        1e) = 2e)  kw/ka1 = x^2/c => [H(+)]=sqr((ka1*kw)/(c))

p12:ev(lhs(p11),p=1,h^2*ka1=0,h^3=0,h*kw=0)=0;

part(solve(p12,h),2);