"You buy 12 dollars worth of apples."You buy 12 dollars worth of apples. They are kind of small so the cashier gives you two extra for free. This reduces the price per dozen by exactly 1 dollar. How many apples did you get for 12 dollars?

Let x = number of apples you buy

And y = cost per apple, in dollars

So,

x*y = 12 ----------(1)

"...the cashier gives you two extra for free."

So you have now (x+2) apples. ------***

"This reduces the price per dozen by exactly 1 dollar."

New price of apples = (12*y -1) per dozen.

In per apple, that is (12y -1)/12 = y -(1/12)

So,

(x+2)(y -1/12) = 12 ------------(2)

12 in (1) = 12 in (2),

x*y = (x+2)(y -1/12)

xy = xy -x/12 +2y -2/12

0 = -x/12 +2y -2/12

Clear the fractions, multiply both sides by 12,

0 = -x +24y -2

x = 24y -2 ------------(3)

From (1), y = 12/x

Substitute that into (3),

x = 24(12/x) -2

x = 288/x -2

Clear the fraction, multiply both sides by x,

x^2 = 288 -2x

x^2 +2x -288 = 0

Use the Quadratic Formula to solve for x.

x = {-2 +,-sqrt[(2)^2 -4(1)(-288)]} /2*1

x = {-2 +,-sqrt(1156)}/2

x = {-2 +,-34}/2

x = (-2 +34)/2 = 16 ---***

x = (-2 -34)/2 = -18 --------reject, because there are no negative number of apples.

So, x = 16 apples -----you bought.

And you were given 2 extra apples for free.

Therefore, for 12 dollars, you got 16+2 = 18 apples altogether. ----answer.