f(x) tends to negative and positive infinity doesn't it?
Let’s say we want to find the maximum and minimum of f(x) in the interval . That would make much more sense, wouldn’t it?
Now, rewrite the function as .
Then and by AM–GM, we have
equality being attained if and only if , i.e. if and only if
Now and so we must use in the AM–GM formula.
Again equality is attained if and only if , i.e. if and only if
Hence the maximum and minimum of f(x) are and , attained when and respectively.