To add or subtract expressions, expand them to make their denominators the same. Least common multiple of $x+2$ and $x+4$ is $\left(x+2\right)\left(x+4\right)$. Multiply $\frac{2x+1}{x+2}$ times $\frac{x+4}{x+4}$. Multiply $\frac{x-2}{x+4}$ times $\frac{x+2}{x+2}$.
Since $\frac{\left(2x+1\right)\left(x+4\right)}{\left(x+2\right)\left(x+4\right)}$ and $\frac{\left(x-2\right)\left(x+2\right)}{\left(x+2\right)\left(x+4\right)}$ have the same denominator, subtract them by subtracting their numerators.
To add or subtract expressions, expand them to make their denominators the same. Least common multiple of $x+2$ and $x+4$ is $\left(x+2\right)\left(x+4\right)$. Multiply $\frac{2x+1}{x+2}$ times $\frac{x+4}{x+4}$. Multiply $\frac{x-2}{x+4}$ times $\frac{x+2}{x+2}$.
Since $\frac{\left(2x+1\right)\left(x+4\right)}{\left(x+2\right)\left(x+4\right)}$ and $\frac{\left(x-2\right)\left(x+2\right)}{\left(x+2\right)\left(x+4\right)}$ have the same denominator, subtract them by subtracting their numerators.