I do not understand your last question. You are going to get a term divided by q whenever you are computing average costs and total costs has a component of fixed costs. You can see why if you look at the answer I gave to your prior question (which unfortunately I could not answer within the time frame that you needed). Or are you asking how to solve this type of equation? Please remember that you have to make your questions comprehensible to us; we are not mind readers.