The maths teacher of Mumbai is transferred to another school. The students of Class 10 decided to buy a book for 360 rupees(currency) as a gift for her. On the farewell day, 4 students did not turn up and so those present had to contribute an extra 1 rupee each. How many students were there in the class all together?
Progress
Let the number of students in the class be $x$. I got $360/x$ as the cost of one student in the class.
$x = $ number of students
$y = $ cost per student
$y=\frac{360}{x}$
$y+1=\frac{360}{x-4}$
Substitute $y=\frac{360}{x}$ into second equation:
$$\frac{360}{x}+1=\frac{360}{x-4}$$
$$(x-4)\frac{360}{x}+(x-4)=360$$
$$360-\frac{1440}{x}+x-4=360$$
$$-\frac{1440}{x}+x=4$$
$$-1440+x^2=4x$$
$$x^2-4x-1440=0$$
$$(x+36)(x-40)=0$$
$$x=40$$
We can ignore $x=-36$ because a class cannot have negative students. The class has $40$ students.