I got it.
When going through the problem you deal with the quantity ln(40-x). But 40-x would be negative at t=0, so we must be dealing with -(40-x)=(x-40)
There is a problem in my textbook that is exactly like one of the examples, but just uses different numbers.
Problem: A tank initially contains 400 gal of brine in which 100 lbs of salt are dissolved. Brine containing 1/10 lb of salt per gallon is run into the tank at 20 gal/min, the mixture being drained off at the same rate. How many lbs of salt remain in the tank after 30 minutes?
In the example, we separate variables and integrate. I use the same method to solve this problem, it just has different numbers and I get: 40-60e^(-t/20). The books's answer is 40 + 60e^(-t/20).
What am I doing wrong?