I need to minimize the following quantity with respect to $p$, but I don't know how to go about it. Here it is:

$$\frac {x(p+h)}{pb} + \frac{(k-1)(p+h)}{b}$$

According to my textbook the answer should be 
$$p = \sqrt \frac{xh}{k-1}$$

I tried deriving but didn't get the same result. Any ideas?