k takes integer values (as it looks like)
To get the expectation, first compute the integrals x*pdf for each k, then sum over k.
This will (I think) give the expectation you're looking for.
I have a mixed probability function:
q+(1-q)*NB(0,r,p) for k=0;
(1-q)*NB(k,r,p) for k>0;
How can I calculate the Mean and Variance of this mixed function?