Question: total of 40 students in class, boys number is double of the girls number. How many boys & girls in the class?

Working as follow:

a = boy b = girl

2a + b = 40

2a + 2a = 40

4a =40
a =10

b=2a

b = 2x 10
b = 20

So a=10, b= 20. Total only 30, not 40 . Why?

Thanks

No, a=2b

a+b = 40
2b+b = 40

?? Not an integer solution

Also, you started out saying a=boys and b=girls. Then you say b=2a, but that's not correct.

The whole problem looks mishandled.