$$\frac{2\left(x+2\right)}{\left(x+1\right)\left(x+2\right)}+\frac{3\left(x+1\right)}{\left(x+1\right)\left(x+2\right)}$$
Since $\frac{2\left(x+2\right)}{\left(x+1\right)\left(x+2\right)}$ and $\frac{3\left(x+1\right)}{\left(x+1\right)\left(x+2\right)}$ have the same denominator, add them by adding their numerators.$$\frac{2\left(x+2\right)+3\left(x+1\right)}{\left(x+1\right)\left(x+2\right)}$$
Do the multiplications in $2\left(x+2\right)+3\left(x+1\right)$.$$\frac{2x+4+3x+3}{\left(x+1\right)\left(x+2\right)}$$
Combine like terms in $2x+4+3x+3$.$$\frac{5x+7}{\left(x+1\right)\left(x+2\right)}$$
Expand $\left(x+1\right)\left(x+2\right)$.$$\frac{5x+7}{x^{2}+3x+2}$$