# fraction with 2 variables, and radicals in numerator

I arrived at the following solution to a problem in pre-calculus:

$$\frac{2xh + h^2 + \sqrt{x+h} - \sqrt{x}}{h}$$

However, this can be simplified further to:

$$2x+h+\frac{1}{\sqrt{x+h}+\sqrt{x}}$$

The steps to simplify were not provided. I substituted in $x = 9, h = 16$ to confirm and I've searched a few places, but am at a loss as to how the term

$$\frac{\sqrt{x+h} - \sqrt{x}}{h}$$

can be simplified to:

$$\frac{1}{\sqrt{x+h}+\sqrt{x}}$$

What are the steps and relevant rules?

This is an example of the very useful "multiply by the conjugate" trick. The trick is based on the fact that $$(a+b)(a-b)=a^2-b^2,$$ which is easy to verify by direct multiplication — but it's so useful that it's worth remembering!
In your example, the conjugate of the numerator $\left(\sqrt{x+h}-\sqrt{x}\right)$ is the expression $\left(\sqrt{x+h}+\sqrt{x}\right)$, so we're going to multiply the numerator and denominator simultaneously by this conjugate: $$\frac{\sqrt{x+h}-\sqrt{x}}{h}=\frac{\left(\sqrt{x+h}-\sqrt{x}\right)\left(\sqrt{x+h}+\sqrt{x}\right)}{h\left(\sqrt{x+h}+\sqrt{x}\right)}=\frac{\left(\sqrt{x+h}\right)^2-\left(\sqrt{x}\right)^2}{h\left(\sqrt{x+h}+\sqrt{x}\right)}=\frac{x+h-x}{h\left(\sqrt{x+h}+\sqrt{x}\right)}=\frac{h}{h\left(\sqrt{x+h}+\sqrt{x}\right)}=\frac{1}{\sqrt{x+h}+\sqrt{x}}.$$
Note that $$h = x+h-x = (\sqrt{x+h}-\sqrt{x})(\sqrt{x+h}+\sqrt{x})$$
and therefore, $$\frac{h}{\sqrt{x+h}+\sqrt{x}} = \sqrt{x+h}-\sqrt{x}$$