Let the desired linear function be
where x is number of units, y is the profit. We need to find k and b. Make a system of equations.
Then
Answer: y=40x-800