# What are the local extrema, if any, of f(x)= (4x-3)^2-(x-4)/x ?

May 31, 2018

The only extremum is $x = 0.90322 \ldots$, a function minimum

But you have to solve a cubic equation to get there and the answer is not at all 'nice' - are you sure the question is correctly typed in? I have also included suggestions for how to approach the answer without going into the amount of analysis shown fully below.

#### Explanation:

1. Standard approach points us in a laborious direction

First calculate the derivative:
$f \left(x\right) = {\left(4 x - 3\right)}^{2} - \frac{x - 4}{x}$
so (by chain and quotient rules)
$f ' \left(x\right) = 4 \cdot 2 \left(4 x - 3\right) - \frac{x - \left(x - 4\right)}{x} ^ 2 = 32 x - 24 - \frac{4}{x} ^ 2$

Then set this equal to 0 and solve for $x$:
$32 x - 24 - \frac{4}{x} ^ 2 = 0$
$32 {x}^{3} - 24 {x}^{2} - 4 = 0$
$8 {x}^{3} - 6 {x}^{2} - 1 = 0$

We have a cubic equation, which is solvable by radicals, but this is far from an easy process. We know that this equation will in general have three roots, but not that they will all be real, although at least one of them will be - that at least one will be we know from the Intermediate Value Theorem - https://en.wikipedia.org/wiki/Intermediate_value_theorem - which tells us that because the function goes to infinity at one end and minus infinity at the other, then it must take all values in between at one point or another.

Trialling a few simple values (1 is often an informative and quick value to try), we see that there is a root somewhere between 1/2 and 1, but we don't find any obvious solutions to simplify the equation with. Solving a cubic equation is a long and tedious process (which we'll do below), so it is worth trying to inform one's intuition before doing so. Trialling solutions further, we find that it is between 0.9 and 0.91.

2. Solve a simplified problem

The function consists of the difference of two terms, ${f}_{1} \left(x\right) = {\left(4 x - 3\right)}^{2}$ and ${f}_{2} \left(x\right) = \frac{x - 4}{x}$. For much of the range of $x$, the first of these will dominate hugely, as the second term will be close to 1 for all values of $x$ away from small values. Let us ask how the two individual terms behave.

First term, ${f}_{1}$
${f}_{1} \left(x\right) = {\left(4 x - 3\right)}^{2}$
${f}_{1}^{'} \left(x\right) = 4 \cdot 2 \left(4 x - 3\right) = 8 \left(4 x - 3\right)$

Set this equal to zero: $x = \frac{3}{4}$. This is in the region of the zero of the function that we found, but it isn't very close to it.

$f \left(1\right)$ is a parabola in $x$, one that touches the $x$ axis at $x = \frac{3}{4}$. Its derivative is a steep straight line of gradient 32 that crosses the x-axis at the same point.

Second term, ${f}_{2}$
${f}_{2} \left(x\right) = \frac{x - 4}{x} = 1 - \frac{4}{x}$
${f}_{2}^{'} \left(x\right) = \frac{4}{x} ^ 2$

Set this equal to zero: there are no solutions in $x$. So ${f}_{2}$ has no extrema as a function on its own. It does however have a point at which it blows up to infinity: $x = 0$. It goes to positive infinity as it approaches 0 from the negative side, and to negative infinity as it approaches 0 from the positive side. Far away from this point, the curve tends to the value 1 on both sides. ${f}_{2}$ is a hyperbola centred on $\left(x , y\right) = \left(0 , 1\right)$. Its derivative is a curve in two pieces, for negative and positive $x$. It goes to positive infinity from both directions at $x = 0$ and is always positive.

Note that ${f}_{1}^{'} \left(x\right) < 0$ for all $x < 0$. There can be no intersections of ${f}_{1}^{'}$ and ${f}_{2}^{'}$ on the negative $x$ axis. Over the positive $x$ axis there must be exactly one intersection - one curve goes from less than 0 to infinity as $x$ does the same while the other goes from infinity to 0. By an application of the Intermediate Value Theorem (see above) they must cross exactly once.

So now we are certain that we are only looking for one solution but we do not have a good answer for it.

In professional situations requiring the solution of these kinds of problems, often the quickest way to get to where you need to get is to perform a numerical approximation. A pretty good one for finding roots of a function is the Newton-Raphson method (https://en.wikipedia.org/wiki/Newton%27s_method).

Which is: to find a root of a function $f$, first make a guess ${x}_{0}$ at a root, and then iterate round and round according to this formula:
${x}_{1} = {x}_{0} - f \frac{{x}_{0}}{f ' \left({x}_{0}\right)}$
${x}_{1}$ is a better guess than ${x}_{0}$, and one just repeats this until the desired precision is reached.

Recall our function and its derivative:
$f \left(x\right) = {\left(4 x - 3\right)}^{2} - \frac{x - 4}{x}$
$f ' \left(x\right) = 8 \left(4 x - 3\right) - \frac{4}{x} ^ 2$

So we might guess 0.5 as our root, making ${x}_{0} = 0.5$, $f \left({x}_{0}\right) = 8$, $f ' \left({x}_{0}\right) = - 24$. Thus ${f}_{1} = 0.5 + \frac{8}{24} = 0.5 + \frac{1}{3} = 0.8333 \ldots .$, indeed a closer answer. Repeating brings us to the value of approximately 0.9 mentioned above.

So we can find the answer with arbitrary precision, but the full answer requires an analytic solution, something that we noted above would be hard. So here we go...

4. Solve the full problem, slowly and painfully

Now let's do the full cubic solution (you're going to have to love algebra to solve this one properly):

First, divide through to make the leading term have coefficient 1 :
$8 {x}^{3} - 6 {x}^{2} - 1 = 0$
${x}^{3} - \frac{3}{4} {x}^{2} - \frac{1}{8} = 0$

Second, make the following substitution to the variable $y$ to remove the ${x}^{2}$ term:
Substitute $x = y + \frac{1}{4}$. More generally, for an equation of the form $a {x}^{3} + b {x}^{2} + c x + d = 0$, one would substitute $x = y - \frac{b}{3 a}$. If you work through the algebra, you'll see that this always causes the ${x}^{2}$ term to vanish. In this case we obtain:
${x}^{3} - \frac{3}{4} {x}^{2} - \frac{1}{8} = 0$
${\left(y + \frac{1}{4}\right)}^{3} - \frac{3}{4} {\left(y + \frac{1}{4}\right)}^{2} - \frac{1}{8} = 0$
(Expand brackets, remembering the Binomial theorem: https://en.wikipedia.org/wiki/Binomial_theorem)
${y}^{3} + \frac{3}{4} {y}^{2} + \frac{3}{16} y + \frac{1}{64} - \frac{3}{4} {y}^{2} - \frac{3}{8} y - \frac{3}{64} - \frac{1}{8} = 0$
(Notice that the two ${y}^{2}$ terms exactly cancel out)
${y}^{3} - \frac{3}{16} y = \frac{5}{32}$
We now have the same number of terms as we did before, because we previously had no $y$ term. Losing the ${y}^{2}$ term is a mathematical profit, promise!

Third, make another substitution (Vieta's substitution: http://mathworld.wolfram.com/VietasSubstitution.html) to turn this into a quadratic:
Substitute $y = w + \frac{1}{16 w}$. More generally, for an equation of the form ${y}^{3} + p y = q$, this substitution is $y = w - \frac{p}{3 w}$.
${y}^{3} - \frac{3}{16} y = \frac{5}{32}$
${\left(w + \frac{1}{16 w}\right)}^{3} - \frac{3}{16} \left(w + \frac{1}{16 w}\right) = \frac{5}{32}$
${w}^{3} + \frac{3}{16} w + \frac{3}{256 w} + \frac{1}{4096 {w}^{3}} - \frac{3}{16} w - \frac{3}{256} w = \frac{5}{32}$
(Notice that both $w$ and $\frac{1}{w}$ terms cancel out exactly)
${w}^{3} + \frac{1}{4096 {w}^{3}} = \frac{5}{32}$
${w}^{6} - \frac{5}{32} {w}^{3} + \frac{1}{4096} = 0$
(Now, you may well ask what on earth the benefit of this is - we've fiddled with our degree 3 equation until we have a degree 6 equation, surely a loss... But we can now think of it as a quadratic equation in ${w}^{3}$, and we can solve quadratic equations...)

Fourth, solve the quadratic equation for ${w}^{3}$
${w}^{6} - \frac{5}{32} {w}^{3} + \frac{1}{4096} = 0$
${\left({w}^{3}\right)}^{2} - \frac{5}{32} \left({w}^{3}\right) + \frac{1}{4096} = 0$
${w}^{3} = \frac{\frac{5}{32} \pm \sqrt{\frac{25}{1024} - \frac{1}{1024}}}{2}$
${w}^{3} = \frac{\frac{5}{32} \pm \sqrt{\frac{24}{1024}}}{2} = \frac{\frac{5}{32} \pm \frac{\sqrt{24}}{32}}{2}$
${w}^{3} = \frac{5 \pm \sqrt{24}}{64} = \frac{5 \pm 2 \sqrt{6}}{64}$

We have an answer! Now we just have to relate it back to our original variable $x$.

Fifth, convert back to our original terms
${w}^{3} = \frac{5 \pm 2 \sqrt{6}}{64}$
Take the cube root:
$w = {\left[\frac{5 \pm 2 \sqrt{6}}{64}\right]}^{\frac{1}{3}}$
$w = \frac{{\left[5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}}{4}$
Recall how we related $y$ to $w$ earlier: $y = w + \frac{1}{16 w}$

$y = \frac{{\left[5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}}{4} + \frac{1}{4 {\left[5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}}$

Now $\frac{1}{{\left[5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}}$
$= \frac{1}{{\left[5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}} \cdot \frac{{\left[- 5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}}{{\left[- 5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}}$
$= \frac{{\left[- 5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}}{{\left[\left(5 \pm 2 \sqrt{6}\right) \left(- 5 \pm 2 \sqrt{6}\right)\right]}^{\frac{1}{3}}}$
$= \frac{{\left[- 5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}}{{\left[- 25 + 4 \cdot 6\right]}^{\frac{1}{3}}}$
$= \frac{{\left[- 5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}}{- 1} = - {\left[- 5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}$
(Socratic doesn't seem to offer a minus-plus opposite of plus-minus, so we have to write it this way)

Thus
$y = \frac{{\left[5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}}{4} - \frac{{\left[- 5 \pm 2 \sqrt{6}\right]}^{\frac{1}{3}}}{4}$

If we multiply out the minus signs in the second large term we can see that we obtain two identical expressions, so we can drop the quadratic plus/minus signs, and simplify to

$y = \frac{1}{4} \left({\left[5 + 2 \sqrt{6}\right]}^{\frac{1}{3}} + {\left[5 - 2 \sqrt{6}\right]}^{\frac{1}{3}}\right)$

Finally (!) recall that we set $x = y + \frac{1}{4}$.
Thus
$x = \frac{1 + {\left[5 + 2 \sqrt{6}\right]}^{\frac{1}{3}} + {\left[5 - 2 \sqrt{6}\right]}^{\frac{1}{3}}}{4}$

Sixth, deduce how many of these roots are real
The two expressions in the cube roots each have one real root and two conjugate imaginary roots. A real number $a$ has three cube roots ${a}^{\frac{1}{3}}$, ${a}^{\frac{1}{3}} \left(\frac{1}{2} + i \frac{\sqrt{3}}{2}\right)$,${a}^{\frac{1}{3}} \left(\frac{1}{2} - i \frac{\sqrt{3}}{2}\right)$. Now we know that both expressions inside the cube roots are positive (notice $5 = \sqrt{25} > \sqrt{24} = 2 \sqrt{6}$), and so the imaginary components in the second and third values for $x$ cannot sum to zero.

Conclusion
Therefore there is only one real root for $x$ (as we concluded far above by a simpler analysis), and hence only one local extreme on the curve you're asking about, given by the expression
$x = \frac{1 + {\left[5 + 2 \sqrt{6}\right]}^{\frac{1}{3}} + {\left[5 - 2 \sqrt{6}\right]}^{\frac{1}{3}}}{4}$
or, in decimal
$x = 0.90322 \ldots$

We can deduce that this is a minimum of the function by the fact that there is only one extremum and the function tends to positive infinity at both ends.