Find the intervals in which the following functions are increasing or decreasing.
$f(x)=\log (2+x)-\frac{2 x}{2+x}$
Given:- Function $f(x)=\log (2+x)-\frac{2 x}{2+x}$
Theorem:- Let $f$ be a differentiable real function defined on an open interval $(a, b)$.
(i) If $f^{\prime}(x)>0$ for $a l l x \in(a, b)$, then $f(x)$ is increasing on $(a, b)$
(ii) If $f^{\prime}(x)<0$ for all $x \in(a, b)$, then $f(x)$ is decreasing on $(a, b)$
Algorithm:-
(i) Obtain the function and put it equal to $f(x)$
(ii) Find $f^{\prime}(x)$
(iii) Put $f^{\prime}(x)>0$ and solve this inequation.
For the value of $x$ obtained in (ii) $f(x)$ is increasing and for remaining points in its domain it is decreasing.
Here we have,
$f(x)=\log (2+x)-\frac{2 x}{2+x}$
$\Rightarrow \mathrm{f}(\mathrm{x})=\frac{\mathrm{d}}{\mathrm{dx}}\left(\log (2+\mathrm{x})-\frac{2 \mathrm{x}}{2+\mathrm{x}}\right)$
$\Rightarrow \mathrm{f}(\mathrm{x})=\frac{1}{2+\mathrm{x}}-\frac{(2+\mathrm{x}) 2-2 \mathrm{x} \times 1}{(2+\mathrm{x})^{2}}$
$\Rightarrow \mathrm{f}(\mathrm{x})=\frac{1}{2+\mathrm{x}}-\frac{4+2 \mathrm{x}-2 \mathrm{x}}{(2+\mathrm{x})^{2}}$
$\Rightarrow \mathrm{f}(\mathrm{x})=\frac{1}{2+\mathrm{x}}-\frac{4}{(2+\mathrm{x})^{2}}$
$\Rightarrow \mathrm{f}^{\prime}(\mathrm{x})=\frac{2+\mathrm{x}-4}{(2+\mathrm{x})^{2}}$
$\Rightarrow \mathrm{f}(\mathrm{x})=\frac{\mathrm{x}-2}{(2+\mathrm{x})^{2}}$
For $f(x)$ to be increasing, we must have
$\Rightarrow f^{\prime}(x)>0$
$\Rightarrow \frac{x-2}{(2+x)^{2}}>0$
$\Rightarrow(x-2)>0$
$\Rightarrow 2 $\Rightarrow x \in(2, \infty)$ Thus $f(x)$ is increasing on interval $(2, \infty)$ Again, For $f(x)$ to be decreasing, we must have $f^{\prime}(x)<0$ $\Rightarrow \frac{x-2}{(2+x)^{2}}<0$ $\Rightarrow(x-2)<0$ $\Rightarrow-\infty $\Rightarrow x \in(-\infty, 2)$ Thus $f(x)$ is decreasing on interval $(-\infty, 2)$