# Find the maximum and minimum values

Question:

Find the maximum and minimum values of the function $f(x)=\frac{4}{x+2}+x$.

Solution:

Given : $f(x)=\frac{4}{x+2}+x$

$\Rightarrow f^{\prime}(x)=-\frac{4}{(x+2)^{2}}+1$

For a local maxima or a local minima, we must have

$f^{\prime}(x)=0$

$\Rightarrow-\frac{4}{(x+2)^{2}}+1=0$

$\Rightarrow-\frac{4}{(x+2)^{2}}=-1$

$\Rightarrow(x+2)^{2}=4$

$\Rightarrow x+2=\pm 2$

$\Rightarrow x=0$ and $-4$

Thus, $x=0$ and $x=-4$ are the possible points of local maxima or local minima.

Now,

$f^{\prime \prime}(x)=\frac{8}{(x+2)^{3}}$

At $x=0:$

$f^{\prime \prime}(0)=\frac{8}{(2)^{3}}=1>0$

So, $x=0$ is a point of local minimum.

The local minimum value is given by

$f(0)=\frac{4}{0+2}+0=2$

At $x=-4:$

$f^{\prime \prime}(-4)=\frac{8}{(-4)^{3}}=\frac{-1}{8}<0$

So, $x=-4$ is a point of local minimum.

The local maximum value is given by

$f(-4)=\frac{4}{-4+2}-4=-6$