Answer:
Price before discount = $20 per keyboard
Price after discount = $18 per keyboard
Before the discount, you can buy 27 keyboards. After the discount, you can buy 30 keyboards.
===============================================
Work Shown:
k = cost of one keyboard before the price reduction
540/k = amount of keyboards purchased before the price reduction
k-2 = cost of one keyboard after the price reduction
540/(k-2) = amount of keyboards purchased after the price reduction
540/(k-2) = (540/k) + 3
--------------
If you multiply both sides by the LCM k(k-2), then you'll clear out the fractions and we can solve for k like so
540/(k-2) = (540/k) + 3
540k = 540(k-2) + 3k(k-2)
540k = 540k - 1080 + 3k^2 - 6k
0 = 540k - 1080 + 3k^2 - 6k - 540k
0 = 3k^2 - 6k - 1080
3k^2 - 6k - 1080 = 0
3(k^2 - 2k - 360) = 0
k^2 - 2k - 360 = 0
(k - 20)(k + 18) = 0
k-20 = 0 or k+18 = 0
k = 20 or k = -18
We ignore the negative result because a negative price doesn't make sense.
--------------
If k = 20, then
540/k = 540/20 = 27
Meaning that you can buy 27 keyboards before the price reduction
In other words, (27 keyboards)*(20 dollars per keyboard) = 540 dollars total.
After the price reduction, the cost per keyboard is now k-2 = 20-2 = 18
We can now buy 540/(k-2) = 540/18 = 30 keyboards, which is an increase of 30-27 = 3 extra keyboards. This helps confirm we have the correct answer.