Concept:
- A substitution based on the denominator converts the rational expression into a simple power of the new variable.
- After setting $u=x+2$, express both $x$ and $dx$ in terms of $u$.
Step 1: Substitute for the denominator.
Let $u=x+2$. Then $x=u-2$ and $du=dx$.
Step 2: Rewrite the integral in terms of $u$.
$\int\dfrac{x}{x+2}\,dx=\int\dfrac{u-2}{u}\,du$
$=\int\left(1-\dfrac2u\right)du$
Step 3: Integrate the two terms.
$\int1\,du-2\int\dfrac1u\,du=u-2\ln|u|+C$
Step 4: Replace $u$ by $x+2$.
$u-2\ln|u|+C=x+2-2\ln|x+2|+C$
The constant $2$ is absorbed into the arbitrary integration constant.
Final Answer: $x-2\ln|x+2|+C$