# How do I find the maximum of a function with a non-zero derivative?

High school student here. I'm trying to find the maximum of this function: $$f(x)=\frac{2x-1}{2-x}.$$ where $$0 \leq x \leq 1$$. The standard process would involve finding the values of $$x$$ such that $$f'(x)=0$$ (then checking that the second derivative is negative), but $$f'(x)$$ here is always non-zero since $$f'(x)=\frac{3}{(x-2)^2}$$. From guessing and checking, I think that the maximum is probably when $$x=1$$, but this isn't particularly rigorous. How do I find the maximum of f(x) in this situation?

• The maximum of a continuous function on a compact interval can occur at points where the function is non-differentiable, has derivative $0$, or on the endpoints. Check all of them. – Don Thousand May 16 at 17:11
• The function describes an axis-aligned hyperbola, which is notoriously monotonous. – Yves Daoust May 16 at 17:12
• Have you considered the possibility that there is no maximum? – Isaac Ren May 16 at 17:12
• @Don Thousand, aha thanks, I have not considered the other two cases. – Hypatia of Alexandria May 16 at 17:12

As you have found, $$f'(x)=\frac{3}{(x-2)^2}$$

This is always positive, but not defined at $$x=2$$.

You should check at the points of non-differentiability too, as this could mean a vertical asymptote. Thus a maxima could occur here.

If you check at $$x=2$$,

$$\lim_{x \to 2^-}=+\infty$$

This is clearly a point of maxima.

Moreover you could also have approached the problem as:

$$f(x)=\frac{3}{2-x}-2$$

$$(y+2)(x-2)=-3$$

This is clearly a rectangular hyperbola (shifted) of the form $$xy=k$$..(k is some constant).

Its asymptotes are well known to be $$X=0 \ and \ Y=0$$

$$x-2=0 \ and \ y+2=0$$

Out of these x=2 is clearly a vertical asymptote.

You could also plot the function to find the maxima.

Take a look at the graph yourself here (Desmos)

If $$f'(x)\gt0$$ for all $$x$$ in an interval $$[a,b]$$, then $$f$$ is strictly increasing on that interval, hence its maximum (on that interval) occurs at the right endpoint, $$x=b$$. So there are two things to observe: first, that $$3/(2-x)^2\gt0$$ for all $$x\not=2$$, and second, that $$2\not\in[0,1]$$.