We need to find the function in slope-intercept form. We thus need the y-intercept and slope. We know there are 38000 gallons in the pool already, so the y-intercept is 38000. The pool drains 12 per minute, so the slope is -12.
y = mx + b
y = -12x + 38000
To find the time it takes to drain the pool, we need to find x where y = 0, so we set the equation to 0 and solve for x.
0 = -12x + 38000
-38000 = -12x
-38000/-12 = -12x/-12
3167 = x
Now, to fill it back up, the y-intercept is 0. We know the slope is 16, so the equation is:
y = 16x
Finally, we need to find 16x = 38000. This is simple enough.
y = 16x
38000 = 16x
38000/16 = 16x/16
2375 = x