Let the cost of the sandwich be x.
No. of sandwiches sold = n
nx=150
Let the decrease in price be a.
(n+5)(x-a)=150
Putting n=150/x:
(150/x + 5)(x-a)=150
150-150a/x+5x-5a = 150
150a/x + 5x -5a= 0
30a/x + x - a = 0
x^2 - ax + 30a = 0
(x-6a)(x+5a) = 0
Therefore x = 6a (x cannot be negative)
Putting it in nx=150:
na = 25
Possible solutions: (n,a) = (1,25),(5,5),(25,1)
Case 1: (n,a) = (1,25):
x= 6a = 150
n=1
Plugging the values in our equations:
nx=150 => 1*150 = 150 (satisfied)
(n+5)(x-a)=150 => (1+5)(150-25) = 6*125 (not satisfied)
Case 2: (n,a) = (5,5):
x= 6a = 30
n=5
Plugging the values in our equations:
nx=150 => 5*30 = 150 (satisfied)
(n+5)(x-a)=150 => (5+5)(30-5) = 10*25 (not satisfied)
Case 3: (n,a) = (25,1):
x= 6a = 6
n=25
Plugging the values in our equations:
nx=150 => 25*6 = 150 (satisfied)
(n+5)(x-a)=150 => (25+5)(6-1) = 30*5 (satisfied)
So, the cost of the sandwich was 6$.
This is not correct - If you had 30a^2 in the first step, then it would have been fine.