Answer:
28 students
Step-by-step explanation:
Let x be the number of girls in the class. There were two more boys than girls in her class, then the number of boys is x + 2.
Mrs. Awesome gave each boy as many jelly beans as there were boys in the class, so each of x + 2 boys got x + 2 jelly beans, so
Number of boys = x + 2
Number of jelly beans each boy got = x + 2
Total number of jelly beans all boys got = (x + 2)(x + 2)
Mrs. Awesome gave each girl as many jelly beans as there were girls in the class, so each of x girls got x jelly beans, so
Number of girls = x
Number of jelly beans each girl got = x
Total number of jelly beans all girls got = (x)(x)
Hence,
Total number of jelly beans class got = (x + 2)(x + 2) + (x)(x)
Mrs. Awesome brought 400 jelly beans, and when she finished, she had six jelly beans left, so she gave 400 - 6 = 394 jelly beans to the calss.
So,
![(x+2)(x+2)+(x)(x)=394\\ \\x^2+2x+2x+4+x^2=394\\ \\2x^2+4x+4-394=0\\ \\2x^2+4x-390=0\\ \\x^2+2x-195=0\\ \\D=2^2-4\cdot (-195)=4+780=784\\ \\\sqrt{D}=28\\ \\x_{1,2}=\dfrac{-2\pm 28}{2\cdot 1}=-15,\ 13](https://tex.z-dn.net/?f=%28x%2B2%29%28x%2B2%29%2B%28x%29%28x%29%3D394%5C%5C%20%5C%5Cx%5E2%2B2x%2B2x%2B4%2Bx%5E2%3D394%5C%5C%20%5C%5C2x%5E2%2B4x%2B4-394%3D0%5C%5C%20%5C%5C2x%5E2%2B4x-390%3D0%5C%5C%20%5C%5Cx%5E2%2B2x-195%3D0%5C%5C%20%5C%5CD%3D2%5E2-4%5Ccdot%20%28-195%29%3D4%2B780%3D784%5C%5C%20%5C%5C%5Csqrt%7BD%7D%3D28%5C%5C%20%5C%5Cx_%7B1%2C2%7D%3D%5Cdfrac%7B-2%5Cpm%2028%7D%7B2%5Ccdot%201%7D%3D-15%2C%5C%2013)
Number of girls cannot be negative, so x = 13, x + 2 = 15 and total number of students is 13 + 15 = 28