Why does the vin=vout takes place at the voltage of (vdd/2) only in the case cmos inverter characteristics? and how to estimate the value of (vout) in every case, so that we can establish relationship between vgs and vds.
Well, a CMOS inverter is the only gate that has a single Vin. Life is much more complicated with multiple inputs. Inverters are also usually designed so that the PMOS and NMOS transistor have relatively equal current drive characteristics, so the switching threshold tends to be close to Vdd/2.
If you want to analyze the relationship between Vin and Vout, just write the equations for Vds vs. Vgs for both the PMOS and NMOS. Set Vgsp = Vdd - Vgsn, and set Vdsp = Vdd - Vdsn. Solve as desired.