I am trying to simplify so h does not cause division by zero when h=0. but the algebra is not so obvious to me.

this is what I try.

$\displaystyle \frac{\frac{1}{\sqrt{x+h}}-\frac{1}{\sqrt{x}}}{h} \;=\; \frac{1}{h}\cdot \frac{\sqrt{x}-\sqrt{x+h}}{\sqrt{x(x+h)}} \;=\; ?$

also

$\displaystyle \frac{\frac{1}{\sqrt{x+h}}-\frac{1}{\sqrt{x}}}{h} \;=\; \frac{1}{h}\cdot \frac{x \sqrt{x+h}-(x+h)\sqrt{x}}{x(x+h)} \;=\; ?$