Let V(d) be the volume of water at day d, we know that in the first day (d=0), V(0)=30, and every day leaks 2 gallons, so the equationfor this model is
but this will stop when the tank reaches 10 gallons, that will happens at day
Then, the complete model is given by the piecewise function