The marginal cost c(p)=0.02 is the derivative of C(p), which is the production cost. Be careful on this because the upper case C and lower case c are two different functions.
In that case, C(p) is the antiderivative of c(p). We have to integrate c(p).
C(p) = ∫0.02dp
C(p) = 0.02p + k, where k is constant
According to the problem, when p=840, C(p)=20.27. Plugin those values to solve for k.
20.27=0.02(840)+k
k=3.47
Therefore the production cost function will be:
C(p) = 0.02p + 3.47