# Homework Help: Finding the greatest value of a function

1. Dec 23, 2013

### shivam01anand

1. The problem statement, all variables and given/known data

So you know the quadratic equations questions like say find the range/ max and min value of the function (x^2-2x+4)/(x^2+2x+4)

2. Relevant equations

(x^2-2x+4)/(x^2+2x+4)

3. The attempt at a solution

So the typical method for this question is assuming this function to be some y, then forming the quadratic and then finally applying D>0 .

However now after a year, at a position where i know basic calculus i can diffn this function to find the critical pts.

MY QUESTION TO YOU is this.

Will the answer from this shortcut, per say , be always correct and in accordance with the long typical method.

Thank you.

2. Dec 23, 2013

### HallsofIvy

You keep using word "quadratic". Do you intend "(x^2-2x+4)/(x^2+2x+ 4)" to represent two separate problems? If so, x^2- 2x+ 4= x^2- 2x+ 1+ 3= (x- 1)^2+ 3, has a minimum value, 3, at x= 1, and x^2+2x+4= x^2+ 2x+ 1+ 3= (x+1s)^2+ 3, has a minimum value, 3, at x= -1. And, yes, if you differentiate those and set the derivative equal to 0, you will get 2x- 2= 0 so x= 1, and 2x+ 2= 0 so x= -1.

In general, if f(x)= ax^2+ bx+ c, then, completing the square, f(x)= a(x^2+ (b/a)dx+ b^2/4a^2)+ (c- b^2/4a)= a(x+ b/2a)^2+ (c- b^2/4a) has minimum value, c- b^2/4a, at x= -b/2a. While f'(x)= 2ax+ b= 0 when x= -b/2a.

But if you mean the rational function, $\frac{x^2- 2x+ 4}{x^2+ 2x+ 4}$, that's a different matter. Since that is not a quadratic, what you are referring to as the "shortcut", by which I presume you mean "completing the square", does not apply.

3. Dec 23, 2013

### shivam01anand

yes i am extremely sorry for not properly naming the respective equations nicely enough.

I meant the rational function.

Why do you say it is not defined?

Are you referring to those problems in which the denominator is equal to zero and hence the fn does indeed get to infinity which we won't get by calculating the max/min approach?

Or is there a big mistake on my part of applying that?

4. Dec 23, 2013

### Staff: Mentor

There is no "is not defined" in HallsofIvy's post.

That can be an issue, indeed, but it is not for this specific problem. The issue is here:

What do you mean with "shortcut"? Differentiation will always work if the function is differentiable everywhere and if it has a maximum.

5. Dec 23, 2013

### haruspex

I think the idea was to write the equation as y(x^2+2x+4) = (x^2-2x+4) and rearrange that as a standard quadratic in x. Applying D > 0 then gives information about y.

6. Dec 23, 2013

### SammyS

Staff Emeritus
Analyzing and sketching the graph of a rational function such as $\displaystyle \frac{x^2- 2x+ 4}{x^2+ 2x+ 4}$, is a fairly typical exercise for a pre-calculus class.

You generally need to determine the domain of the function.

Find any intercepts, for x and/or y.

Find and determine any asymptotes, vertical and horizontal/slant .

Setting the numerator to zero and solving for x, will get you started on finding any x-intercepts.

Setting the denominator to zero and solving for x, will get you started on finding any vertical asymptotes.

Your "shortcut" will only find where the numerator or where the denominator has a maximum (or minimum). That can work in this case because each of the numerator and the denominator has no zero -- and your "shortcut" can help determine that by finding that the minimum of each is positive, so that neither has a zero.

However, to find the range of this rational function, you need to find the minimum and maximum of the function as a whole. The min & max occur at values of x different than either minimum of the numerator or denominator.

7. Dec 23, 2013

### haruspex

I think you (and mfb, and Halls) have not understood the shortcut suggested. See post #5. It quickly yields the range [1/3, 3], the extremals corresponding to |x|=2. The local extreme values of numerator and denominator are at |x|=1.

8. Dec 23, 2013

### SammyS

Staff Emeritus
Interesting !

You're right concerning my (lack of) understanding of the non-shortcut (long way).

The shortcut being to differentiate the rational function, then set that equal to zero, etc. to find the extrema, thus the range.

Last edited: Dec 23, 2013
9. Dec 24, 2013

### haruspex

Ah yes, and you're right that the OP refers to the calculus way as the shortcut. Seems to me the calculus route is the longer, so I read it as the other way around.

10. Dec 24, 2013

### shivam01anand

Hmm that makes it rather clear, the thing about local vs global max/min etc

Turns out the differentiating method is a risky one with more and more chances of mistake plus the fact that it's not a shorter method in the first place..

Thank you all for the valuable input.

=y then D>0 is the way to go!

11. Dec 24, 2013

### Staff: Mentor

The calculus route is quick if you simplify the expression first:

$$\frac{x^2- 2x+ 4}{x^2+ 2x+ 4} = 1-\frac{4x}{x^2+ 2x+ 4}$$
The constant 1 drops out in the derivatives.

12. Dec 26, 2013

### ehild

It works in this case.

$$\frac{x^2-2x+4}{x^2+2x+4}=y \rightarrow x^2(y-1)+2x(y+1)+4(y-1)=0$$

The discriminant is $$D=4(y+1)^2-16(y-1)(y-1)$$
x has to be real, so D≥0--->[y+1+2(y-1)][(y+1)-2(y-1)]≥0

That means 3y-1 ≥0 and 3-y≥0, the range is 1/3≤y≤3.

ehild

13. Dec 26, 2013

### shivam01anand

Ehild what you just showed is the general and correct way to find it, right?

14. Dec 26, 2013

### ehild

No, the general way to find the range of a function is the one with differentiation. Find the local extrema, where the first derivative is zero, and also check the boundaries of the domain.

What is the range of f(x)=x4-4x3+x2-6x+1, for example?
Can you figure it out?

If you have a fraction of two second order polynomials, your method might work.

ehild

15. Dec 28, 2013

### shivam01anand

Wait im just talking about the f(x)/q(x) type of functions.. here the differentiation will not always give correct solution.

For example say;

x^2-5x+6/ x^2-2x-3

Via differentiation you'll get two pts and hence maxima/minima from these two points.

But obviously the maxima is ∞ at x= 3/-1

So that's my theory behind it not being the method to follow FOR this type of q.

IS my reasoning flawed in any way?

16. Dec 28, 2013

### Staff: Mentor

Don't forget brackets.

That function does not have a maximum, and setting the derivative to zero does not give a solution - exactly what you want.

17. Dec 28, 2013

### Ray Vickson

Judicious use of differentiation will always yield correct solutions, and is the most common and straightforward way to deal with such problems.

If the function f(x) = p(x)/q(x) has points where q = 0 but with p ≠ 0 at those points, then the graph of f will have vertical asymptotes, and so will not have finite optima of both types (but could, for example, have a finite minimum but no maximum, or vice versa). If f(x) fails to have both a finite max and finite min you are done; however, if it has a finite max (or min), you can find it out via differentiation. Be warned, however, that such problems are theoretical difficult, and in the worst case can involve checking many local optima to find the best of them, essentially by brute-force calculations.

Avoiding derivatives, as you seem to want to do, will generally produce problems that are even harder. If you don't believe it, try both methods on the following example:
$$f(x) = \frac{x^4 - 3 x^3 + 5 x^2 - 2 x + 6}{x^4 +2 x^3 + 4 x^2 + x + 5}$$

18. Dec 28, 2013

### ehild

The function (x^2-5x+6)/( x^2-2x-3) does not have local extrema ( the derivative is nowhere zero).
Edit:
x=3 and x=-1 are not points of the domain. It is not true that the maxima are at 3/-1. The function is not defined at those points. It is a hole in the domain at x=3, and a vertical asymptote at x=-1. The function goes to infinity if x tends to -1 from left, and tends to - infinity, if x goes to -1 from the right.
With derivation, you will find that the function monotonously increases in its whole domain.

ehild

#### Attached Files:

• ###### Graph1.jpg
File size:
8.3 KB
Views:
130
Last edited: Dec 29, 2013
19. Dec 29, 2013

### Staff: Mentor

ehild: your graph looks wrong, the factor (x-3) is in both the numerator and the denominator, x=3 is just a hole in the function at that point - the only vertical asymptote is at x=-1.

20. Dec 29, 2013

### ehild

Thank you mfb. I edited my post. I can not imagine how the program made that graph from the function.

ehild