Does the first derivative test always work for finding minima and maxima? Suppose you want to find the max of the function $\ f(x)=\sqrt{x} - x$.
Using the first derivative test you get, $f'(x)= \frac{1}{2\sqrt{x}} - 1$ .
If we equate this to $0$ we get $x =\frac{1}{4}$. Taking as $x$ as $0.20$ and $0.30$, we get that the first derivative doesn't change signs (remains positive). However, if x is taken as $x > 1$, then the first derivative becomes negative.
Graphing the function reveals that $x =\frac{1}{4}$ is indeed the maximum point. 
Taking the second derivative $\ f\prime\prime(x)= \frac{-1}{4x^\frac{3}{2}}$ and using the second derivative test at the point $x =\frac{1}{4}$ shows the second derivative is negative, indicating a maximum.
My question therefore is does the first derivative test necessarily always show the maximum? Both the graphs and second derivatives indicate a maximum; however if the first derivative is taken with $x < 1$ then the first derivative test fails. Can someone explain how this could happen?

Before attempting to find maxima or minima of a function, you must remember that a function is not just a formula. A function may be expressed by a formula, but even in that particular case you need to add an important specification: the domain. If we are dealing with functions defined in the reals, often it's assumed that the domain are all the values where the formula can be evaluated (natural domain) - but, even then, make that explicit before findind maxima-minima. 
In this case, the natural domain is $D=[0,+\infty)$, so we are only interested in the points that make null the derivative in the region. (It might happen that the derivative you get -as a mere formula- can be evaluated outside the domain - but you must exclude that values)
But that's not all. Even after you have found the points where the derivative is zero, and have found that the second derivative is positive or negative, you might still miss some minima-maxima (and, perhaps, the global maximum or minimum).
You also need to ask yourself: 


*

*Is the function derivable in all its domain? If not, check for the non-derivable points

*Is the domain open? If not, check for the extremal points (in this
case, $x=0$)
