To add or subtract expressions, expand them to make their denominators the same. Least common multiple of $2$ and $x$ is $2x$. Multiply $\frac{x}{2}$ times $\frac{x}{x}$. Multiply $\frac{2}{x}$ times $\frac{2}{2}$.
$$\frac{xx}{2x}+\frac{2\times 2}{2x}$$
Since $\frac{xx}{2x}$ and $\frac{2\times 2}{2x}$ have the same denominator, add them by adding their numerators.