Here are two types of classes -One is a 2-hour clas and the other 4-hour class.
Suppose, number of 2-hour classes = x, and the number of 4-hour classes = y
since there are total 36 classes, we can write x + y=36 - - - - - - - - - (1)
As x is a 2-hour class x collects 2x43=86 in one class and y collects 4x43 = 172 in ane class.
during these classes total collected amount is 4214.
so that 86x + 172y = 4214 - - - - - (2)
Solving equations (1) and (2) by substitution method,
86(36-y) + 172y = 4214
or, 3096 - 86y + 172 y =4214
or, 86y=1118
y=13,
substituting the value of y in equation (1) x + 13 =36 , or x = 36 - 13 = 23
hence there 23 two hour classes and 13 four hour classes.
We can check the answer as, 23 x2($ 43) = $ 1978
13x4($ 43) = $ 2236
total collected amount = 4 4214