I have to decide which language type will result from the union of a type-2 (context-free) and a type-3 (regular) language.Is there a way or rule to decide this for all language types?
How can I see which language type will result from the union or intersection of different language types?
formal languages;regular languages
First, a minor point of terminology. In the Chomsky hierarchy, type-2languages are the context-free family, not the context-sensitive one. I donot know which you meant.In general, the terminology used is family of language rather thantype of language. The fact that the application of some operation$\diamond$ applied to languages in families $\mathcal F_i$ alwaysgives a language in the family $\mathcal F$ is called a closureproperty.As stated by Hendrik Jan in his answer, there are no general rules todetermine closure properties and they can vary a lot. To complementhis examples, context-free (type 2) languages are not closed underintersection:  the intersection of two context-free languages may notbe a context-free language. However, the intersection or union of acontext-free language with a regular language is always context-free.(proving it is an excellent exercise).Since you are ambiguous as to what family of languages you are interested in,it so happens that the context-sensitive languages are also closedunder union or intersection with regular languages.Actually, many (most ?) interesting families of languages are closedunder union or intersection with regular languages.Though there are no general rules for proving it, there are many otheroperations one may consider on the languages of a family, which leads tomany studies of closure properties of languages. It turns out thatclosure properties are not independent, because many operations can bedefined by composition, or complex combinations, of other operations.This has led to the study of what is usually called Abstract Familiesof Languages, i.e. families that are closed under the same kinds ofoperations. But that is now far beyond your question.