You are Here: Home >< Maths

# Minimum difference between two functions. watch

1. I recently encountered a question in an admissions paper that was something like this (I'm not using the actual example as I can't remember it):

a = x^3 + 1 (some cubic)
b = x^2 + 2x + 1 (some quadratic)

Find the minimum and maximum difference between a and b.

So I started by stating a - b, differentiating and finding the two stationary points. I then subbed the x-values back into a-b to find which was minimum and maximum. The problem with this was that it's a non-calc question and substituting back in was quite tricky.

The online solution (not a mark scheme) used the 2nd derivative to prove which was maximum and minimum. However, is this dependent on whether you state a - b or b - a as the difference should be stated as |a-b|? Is the online solution rigorous enough of a proof?
2. (Original post by AHappyStudent)
I recently encountered a question in an admissions paper that was something like this (I'm not using the actual example as I can't remember it):

a = x^3 + 1 (some cubic)
b = x^2 + 2x + 1 (some quadratic)

Find the minimum and maximum difference between a and b.

So I started by stating a - b, differentiating and finding the two stationary points. I then subbed the x-values back into a-b to find which was minimum and maximum. The problem with this was that it's a non-calc question and substituting back in was quite tricky.

The online solution (not a mark scheme) used the 2nd derivative to prove which was maximum and minimum. However, is this dependent on whether you state a - b or b - a as the difference should be stated as |a-b|? Is the online solution rigorous enough of a proof?
yes, I would approach it as the online solution did. I'm not sure how it lacks rigour. Also as you're looking for a distance, the answer is going to be non-negative so it doesn't matter whether you take b - a or a - b provided you account for that, as
3. (Original post by _gcx)
yes, I would approach it as the online solution did. I'm not sure how it lacks rigour. Also as you're looking for a distance, the answer is going to be non-negative so it doesn't matter whether you take b - a or a - b provided you account for that, as
I was thinking along these lines.

If f(x) = a - b, then from f '(x) = 0 we find two solutions for stationary points, lets call them x = p and x = q.

Then f(p) > 0 and f(q) < 0, which shows that f(p) is the minimum and f(q) is the maximum.

However, -f(x) = b - a is an equally valid function as we are considering the difference as | a - b |. Wouldn't this result in f(p) < 0 and f(q) > 0 therefore flipping our results around?

Maybe I'm missing something.
4. Well, pedantically: the minimum distance is clearly 0 since the two curves intersect and there is no maximum distance since their difference goes off to infinity as x -> infinity.
5. (Original post by Zacken)
Well, pedantically: the minimum distance is clearly 0 since the two curves intersect and there is no maximum distance since their difference goes off to infinity as x -> infinity.
Think the OP was just using two random curves to demonstrate the type of question. I would assume this wasn't the case for the curves provided.
6. (Original post by AHappyStudent)
I was thinking along these lines.

If f(x) = a - b, then from f '(x) = 0 we find two solutions for stationary points, lets call them x = p and x = q.

Then f(p) > 0 and f(q) < 0, which shows that f(p) is the minimum and f(q) is the maximum.

However, -f(x) = b - a is an equally valid function as we are considering the difference as | a - b |. Wouldn't this result in f(p) < 0 and f(q) > 0 therefore flipping our results around?

Maybe I'm missing something.
I don't get your second paragraph. Did you mean f''?
7. (Original post by _gcx)
Think the OP was just using two random curves to demonstrate the type of question. I would assume this wasn't the case for the curves provided.
I would assume they are polynomials, in which case the maximum will still be unbounded or the polynomials differ by only a constant.

Also, you should definitely be checking if a-b has a root, since that would immediately imply the minimum distance is 0.

There is a problem with mindless taking derivatives and forgetting the original context.
8. (Original post by _gcx)
I don't get your second paragraph. Did you mean f''?
(Original post by Zacken)
I would assume they are polynomials, in which case the maximum will still be unbounded or the polynomials differ by only a constant.

Also, you should definitely be checking if a-b has a root, since that would immediately imply the minimum distance is 0.

There is a problem with mindless taking derivatives and forgetting the original context.
Yes, I meant the 2nd derivative but I must have forgotten the '', sorry for being unclear.

I haven't written the question out in full. The actual question used different functions, although one was a cubic and one was a quadratic, and it specified maximum and minimum values for | a - b | within a certain range where the stationary points lie but x-intercepts do not.
9. (Original post by AHappyStudent)
I haven't written the question out in full. The actual question used different functions, although one was a cubic and one was a quadratic, and it specified maximum and minimum values for | a - b | within a certain range where the stationary points lie but x-intercepts do not.
Yes, well I'll need the full fun tion, all these details actually matter.
10. (Original post by AHappyStudent)
I recently encountered a question in an admissions paper that was something like this (I'm not using the actual example as I can't remember it):

a = x^3 + 1 (some cubic)
b = x^2 + 2x + 1 (some quadratic)

Find the minimum and maximum difference between a and b.

So I started by stating a - b, differentiating and finding the two stationary points. I then subbed the x-values back into a-b to find which was minimum and maximum. The problem with this was that it's a non-calc question and substituting back in was quite tricky.
I would say this is the standard approach - and if you were supposed to find both minimum and maximum (two points) it would seem hard to avoid needing to substitute in.

The general way I would approach a problem like this:

Write f(x) = a(x) - b(x).
1st question: are you given a range? If not, then if f(x) is not constant, it is going to go to + (or possibly -) infinity as x goes to infinity (or -infinity), and that instantly gives you the maximum range.

Assuming you were given a range (x0 <= x <=x1), first evaluate f(x) at both end points. Next, find the roots of f'(x) and evaluate f(x) at each root. It is very important to consider the value of f at the extremes of the range - often one of these endpoints will be where the minimum or maximum in the range is reached.

These points give you all you need to sketch the curve. (It's sufficient to simply draw straight lines connecting each (x,y) pair you found in the previous step). You're looking to find the closest and furthest it comes to the x axis (note that if it crosses the x-axis, the closest distance is 0). [You don't really need to sketch it, but until you're confident that you don't need to, I would].

It would seem unusual for it to be quicker to skip analysing a particular point where f'(x) = 0 based on the 2nd derivative; certainly for the problem as you've described it. It would be easier to be definitve if you could give the actual question.

### Related university courses

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: October 19, 2017
Today on TSR

### Results day under a month away

How are you feeling?

Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams