dccd,
The calculation of a T-beam is a straightforward exercise that may be found in any textbook discussing reinforced concrete design. If the neutral axis extends from either the web into the flange (very uncommon), or from the flange into the web (more common), you calculate moment resistance by superposing the resistance of outstand flanges and rebar (lever arm = distance between flange N.A. and rebar) and the resistance of the web and rebar (lever arm = distance from rebar to N.A. of web compressive block).
It would be unwise to design a T-beam of either type "a" or "b" (slab on "top" or "bottom" of the beam) that has neutral axis located very deep in the section (example: type a, section B-B, hogging at supports, with N.A. in the top flange and thus a very large compression block), because it leads to very small steel strain at ULS and subsequently to brittle fracture. This is also explained in university courses on RCS design and in textbooks on RCS design.
I suggest that you brush up on the subject before attempting this sort of design.