# Minimum or maximum value of a function in square roots

Find the minimum and maximum value of the function $$f(x)=3\sqrt{x-2}+\sqrt{4-x}$$

My approach is as follows

The domain of the function is $$x\in[2,4]$$

If the function is $$T(x)=\sqrt{x-2}+\sqrt{4-x}$$

On squaring we get $$(T(x))^2=x-2+4-x+2 \sqrt{(x-2)(4-x)}$$

Hence $$(T(x))^2=2+2 \sqrt{(x-2)(4-x)}$$

Let $$(x-2)(4-x)$$ represent quadratic equation whose maximum value is $$1$$ at $$x=3$$ based on this concept how we will solve it

• With the substitution $x = 3+\cos(2t)$, it becomes $\sqrt{2}(3\cos(t)+\sin(t)=\sqrt{2}\sqrt{10}\cos(2t+a)$ Commented Apr 7 at 11:33
• Have you tried setting the derivative equal to zero? Commented Apr 7 at 11:34
• $x=2 \sin^2 \theta + 4 \cos^2 \theta$ Commented Apr 8 at 6:39

You can use the Power-Mean Inequality.

Let $$a_1=a_2=...=a_9=\displaystyle{\frac{x-2}{9}}$$ and $$a_{10}=4-x$$. Then $$\displaystyle{\bigg(\frac{f(x)}{10}\bigg)^2=\bigg(\sum\limits_{i=1}^{10}\frac{a_i^{\frac{1}{2}}}{10}\bigg)^2\leq\sum\limits_{i=1}^{10}\frac{a_i}{10}=\frac{1}{5}}$$ Therefore $$\displaystyle{f(x)\leq 2\sqrt{5}}$$.

Or you can use the Cauchy inequality $$20=((\sqrt{x-2})^2+(\sqrt{4-x})^2)(3^2+1^2)\geq (3\sqrt{x-2}+\sqrt{4-x})^2=f(x)^2$$

On the other hand, let $$a=3\sqrt{x-2}$$ and $$b=\sqrt{4-x}$$. Immediately we have $$\displaystyle{\frac{a^2}{9}+b^2=2}$$, which is an ellipse. Then $$\displaystyle{f(x)^2=a^2+b^2+2ab=a^2+2-\frac{a^2}{9}+2ab=\frac{8a^2}{9}+2ab+2\geq 2}$$.

I'm going to write two solutions.

The domain of $$f(x)$$ is $$x\in [2,4]$$.

solution 1 :

As commented by Alex K, considering the derivative helps.

We have \begin{align}f'(x)&=\frac{3}{2\sqrt{x-2}}-\frac{1}{2\sqrt{4-x}} \\\\&=\frac{3\sqrt{4-x}-\sqrt{x-2}}{2\sqrt{(x-2)(4-x)}} \\\\&=\frac{3\sqrt{4-x}-\sqrt{x-2}}{2\sqrt{(x-2)(4-x)}}\times\frac{3\sqrt{4-x}+\sqrt{x-2}}{3\sqrt{4-x}+\sqrt{x-2}} \\\\&=\frac{9(4-x)-(x-2)}{2\sqrt{(x-2)(4-x)}(3\sqrt{4-x}+\sqrt{x-2})} \\\\&=\frac{-5x+19}{\sqrt{(x-2)(4-x)}(3\sqrt{4-x}+\sqrt{x-2})}\end{align}

So, we can see that $$f(x)$$ is increasing for $$x\lt\frac{19}{5}(=3.8)$$, and is decreasing for $$\frac{19}{5}\lt x$$.

Therefore, we see that the maximum value is $$f\bigg(\frac{19}{5}\bigg)=\color{red}{2\sqrt{5}}$$

and that the minimum value is $$\min(f(2),f(4))=f(2)=\color{red}{\sqrt 2}$$

solution 2 :

As commented by Hari Shankar, setting $$x=2+2\cos^2 t\ (0\le t\le\frac{\pi}{2})$$ works.

We have $$3\sqrt{x-2}+\sqrt{4-x}=3\sqrt 2\cos t+\sqrt 2\sin t$$$$=2\sqrt 5\sin(t+\alpha):=g(t)$$ where $$\cos\alpha=\frac{\sqrt 2}{2\sqrt 5}$$ and $$\sin\alpha=\frac{3\sqrt 2}{2\sqrt 5}$$.

So, the maximum value is $$g(\frac{\pi}{2}-\alpha)=\color{red}{2\sqrt 5}$$.

The minimum value is $$\min\bigg(g(0),g\bigg(\frac{\pi}{2}\bigg)\bigg)=g\bigg(\frac{\pi}{2}\bigg)=\color{red}{\sqrt 2}$$

Too long for the comment.

• Domain of $$f(x)$$ is $$[2,4].$$

• The equation $$\;f'(x)=0,\;$$ or $$\,\dfrac3{2\sqrt{x-2}}=\dfrac1{2\sqrt{4-x}},\;$$ has the single real root $$\;x=\dfrac{19}5.\;$$

• Extremes of $$\;f(x)\;$$ can be achieved at the edges of domain or at the stationary points, i.e. at the points set $$\;x\in\left\{2, \dfrac{19}5,4\right\},\;$$ where $$\;f(x)\in\{\sqrt2, 2\sqrt5, 3\sqrt2\},\;$$ with the least value $$\;f\left(2\right)=\sqrt2\;$$ and the greatest value $$\;f\left(\dfrac{19}5\right)=2\sqrt5.\;$$