Let's say 'x' to number of the students in the smaller class. Since the larger one is 6 more than the smaller one, its number would be 'x+6'. So their sum is equal to
[tex]x+x+6=2x+6[/tex] and we know total is 50 so:
[tex]2x+6=50\\ 2x=50-6\\ 2x=44\\ x=\frac { 44 }{ 2 } \\ x=22[/tex]
x is 22 so the larger number 'x+6' is equal to : [tex]x+6=22+6=28[/tex]