# How to find the maximum and minimum of the function $f(x) = \frac{3x}{x^2 -2x + 4}$

How would one find the maximum and minimum of such a function: $$f: \mathbb{R} \rightarrow \mathbb{R}, x \mapsto f(x) = \frac{3x}{x^2 -2x + 4}$$

I have just been introduced to functions in my calculus class (actually I missed that lectures), and I have more or less have the intuition of maximum and minimum of a function: the maximum should be the greatest $f(x)$ value in a certain range and the minimum the smallest $f(x)$ value.

My first question is: does it makes sense to talk about maximum and minimum of a function in general (instead of just in a certain subset of the domain of the function)?

I need to use maxima to find the maximum and minimum, and then I need to show formally that they are really the maximum and minimum.

My second question is: does anybody know how to find the maximum and minimum of a function using wxMaxima?

My third question is: I know the definition of maximum (and minimum), i.e. a number that is greater or equal (smaller or equal) to all other numbers. My problem is that I am not seeing how would I show it formally.

I used Wolfram Alpha to calculate the maximum and the minimum, and it says that the minimum is $-\frac{1}{2}$ at $-2$ and the maximum is $\frac{3}{2}$ at $2$.

If one lets $y=\frac{3x}{x^2-2x+4},$ one has $y=0\iff x=0$.

Suppose that $y\not=0$.

Since $y(x^2-2x+4)=3x\iff yx^2+(-2y-3)x+4y=0$, considering the discriminant gives you $$(-2y-3)^2-4\cdot y\cdot (4y)\ge 0\iff (2y-3)(2y+1)\le 0.$$

Hence, one has $-\frac 12\le f(x)\le \frac 32$. Here, the equalities are attained : $f(-2)=-\frac 12,f(2)=\frac 32$.

• Why should this give us the maximum and minimum? I am not seeing the connection... – nbro Apr 18 '15 at 12:33
• @Rinzler: Sorry, but please clarify what you don't understand in my answer. Do you understand $-\frac 12\le f(x)\le \frac 32$? – mathlove Apr 18 '15 at 12:38
• @Rinzler: (1) The reason why I separate it into two cases $y=0$ and $y\not=0$ is that I wanted to use the discriminant for $x$. Note that the coefficient of $x^2$ is $y$. This must not be $0$. (2) Since $x$ is real, the discriminant has to be non-negative (I'm sure you know this) (3) When $y\not=0$, I got $(2y-3)(2y+1)\le 0$. Combining this with $y=0$, I got $-\frac 12\le y\le \frac 32$. (4) Considering the discriminant sometimes works to find the maximum and the minimum because it gives an inequality for $y$. – mathlove Apr 18 '15 at 12:48
• nice work. i would have done the same way. @Rinzler, read the answer more carefully. – abel Apr 18 '15 at 13:25
• @Rinzler: You can get it by expanding LHS : $(-2y-3)^2-4\cdot y\cdot (4y)\ge 0\iff 4y^2+12y+9-16y^2\ge 0\iff -12y^2+12y+9\ge 0$ $\iff -4y^2+4y+3\ge 0\iff 4y^2-4y-3\le 0\iff (2y-3)(2y+1)\le 0$. – mathlove Apr 19 '15 at 22:04

solve the equation $f'(x)=-\frac{3 (x-2) (x+2)}{\left(x^2-2 x+4\right)^2}=0$ for $x$. if you know it is $\frac{3}{2}$ you can calculate $$\frac{3}{2}-\frac{3x}{x^2-2x+4}=\frac{3(x-2)^2}{2(4-2x+x^2)}\geq 0$$

• We have not been introduced to the concept of derivatives... – nbro Apr 18 '15 at 12:11

Since the discriminant of $x^2-2x+4$ is negative we have that $x^2-2x+4$ never vanishes, so it is enough to compute the minimum of $g(x)=\frac{1}{f(x)}$ over $\mathbb{R}^+$ and the maximum of $\frac{1}{f(x)}$ over $\mathbb{R}^-$, since $x=0$ is the only zero of $f(x)$ and $\lim_{x\to\pm\infty}f(x)=0$. Now:

$$g(x) = \frac{x}{3}+\frac{4}{3x}-\frac{2}{3},$$ so the stationary points of $g(x)$, by the AM-GM inequality, occur when $\frac{x}{3}=\frac{4}{3x}$, i.e. at $x=\pm 2$.

That directly gives: $$-\frac{1}{2}= f(-2) \leq f(x) \leq f(2) = \frac{3}{2}$$ as wanted.

• What do you mean by: "$x^2-2x+4$ never vanishes"? Why is it enough to computer the minimum of $g(x)$ over $R^+$ and the maximum over $R^{-1}$? What do you mean by "over $R^{+/-}$"?..... – nbro Apr 19 '15 at 14:02
• @Rinzler: "never vanishes" means that for every $x\in\mathbb{R}$ we have $x^2-2x+4\neq 0$. $\mathbb{R}$ is the set of real numbers, $\mathbb{R}^+$ the set of positive real numbers, $\mathbb{R}^-$ the set of negative real numbers. If a continuous function $g$ never vanishes, the maxima of $g$ are attained in the minima of $\frac{1}{g}$ and vice-versa. – Jack D'Aurizio Apr 19 '15 at 14:19

If $x\ne0,$ $$\frac{3x}{x^2-2x+4}=\dfrac3{x-2+4/x}$$

If $x>0,x-2+4/x=\left(\sqrt x-2/\sqrt x\right)^2+4-4\ge2$

Consequently, $$\frac{3x}{x^2-2x+4}\le\dfrac32$$

If $x<0,$ let $x=-y^2,x-2+4/x=-y^2-2-4/y^2=-2-\left(y-2/y\right)^2-4\ge-6$

Consequently, $$\frac{3x}{x^2-2x+4}\ge\dfrac3{-6}=-\dfrac12$$