Difference of Functions (Subtracting Ordinates)
Theory
Subtracting ordinates builds the graph of \(y=f(x)-g(x)\) from the vertical gaps between two graphs. This Year 11 Mathematics Extension 1 page shows how to evaluate a difference of functions, find its domain, solve \((f-g)(x)=0\) to find where graphs meet, use the discriminant to decide whether they touch or never meet, and find the greatest vertical distance and the range.
The difference of two functions \(f\) and \(g\) is the function \[(f-g)(x)=f(x)-g(x).\] To graph it by subtracting ordinates, take each \(x\)-value and subtract the height of \(g\) from the height of \(f\). Always subtract the whole of \(g(x)\): \((f-g)(x)=(2x+1)-(x-3)=x+4\), because the bracket changes every sign inside it.
The ordinate of \(f-g\) is the vertical distance from the graph of \(g\) up to the graph of \(f\). It is positive where the graph of \(f\) is above the graph of \(g\), zero where the two graphs meet, and negative where \(f\) is below \(g\). So:
• the graphs of \(y=f(x)\) and \(y=g(x)\) meet where \((f-g)(x)=0\), and these are the \(x\)-intercepts of \(y=f(x)-g(x)\);
• the graph of \(f\) is above the graph of \(g\) where \(f(x)-g(x)\gt 0\);
• the greatest vertical distance between the graphs is the maximum value of \(f(x)-g(x)\) between the meeting points (where \(f\) is above \(g\)).
The difference exists only where both functions exist, so its domain is the set of \(x\)-values in both domains. For \(f(x)=\sqrt{x+5}\) and \(g(x)=\dfrac{1}{x+1}\), the domain is \(x\ge-5,\ x\ne-1\).
When \(f-g\) is a quadratic, its discriminant \(\Delta\) counts the meeting points: \(\Delta\gt 0\) gives two, \(\Delta=0\) means the graphs touch at one point (a repeated root), and \(\Delta\lt0\) means they never meet, so \(f-g\) keeps one sign for every \(x\).
Where \(g(x)\) approaches \(0\), the difference approaches \(f(x)\). For example, as \(x\to-\infty\), \(3^{x}\to0\), so \(y=2-3^{x}\) approaches the horizontal asymptote \(y=2\); and since \(3^{x}\gt 0\), \(y\lt2\) for every \(x\).
The difference of two functions, and its value at \(x=a\):
Meeting points and above/below:
If \(f(x)-g(x)=ax^2+bx+c\), the discriminant counts the meeting points:
| \(\Delta\) | Roots of \(f(x)-g(x)=0\) | The graphs of \(f\) and \(g\) |
|---|---|---|
| \(\Delta\gt 0\) | two real roots | meet at two points |
| \(\Delta=0\) | one repeated root | touch at one point |
| \(\Delta\lt0\) | no real roots | never meet |
How to work with \(y=f(x)-g(x)\)
- Form the difference with brackets, \((f-g)(x)=\big(f(x)\big)-\big(g(x)\big)\), and simplify.
- Evaluate at \(x=a\) either by substituting into the simplified difference, or by finding \(f(a)\) and \(g(a)\) and subtracting.
- State the domain: the \(x\)-values where both functions are defined.
- Solve \((f-g)(x)=0\) to find where the graphs meet: factorise a quadratic, multiply through by \(x\) to clear a fraction, or square a square-root equation and check.
- Decide where \(f-g\) is positive or negative from the graphs or the sign pattern between the meeting points.
- Use the discriminant to count meeting points, or to find a constant \(k\) that makes the graphs touch or never meet.
- Complete the square to find a greatest vertical distance, a minimum value or the range.
(i) Find \((f-g)(x)\) and hence \((f-g)(3)\).
(ii) Find the \(y\)-intercept of the graph of \(y=f(x)-g(x)\).
(iii) Solve \((f-g)(x)=0\).
(i) Subtract the ordinates, then substitute:
| \((f-g)(x)\) | \(=\) | \((4x-1)-(x+5)\) |
| \(\) | \(=\) | \(4x-1-x-5\) |
| \(\) | \(=\) | \(3x-6\) |
| \((f-g)(3)\) | \(=\) | \(3(3)-6\) |
| \(\) | \(=\) | \(\mathbf{3}\) |
Check: \(f(3)=11\) and \(g(3)=8\), so \(f(3)-g(3)=11-8=3\).
(ii) At \(x=0\): \(y=3(0)-6=-6\). \(\therefore\) the \(y\)-intercept is \(\mathbf{y=-6}\).
(iii)
| \(3x-6\) | \(=\) | \(0\) |
| \(3x\) | \(=\) | \(6\) |
| \(x\) | \(=\) | \(\mathbf{2}\) |
So the two lines meet where \(x=2\), at \((2,7)\).
(i) State the domain of \(y=f(x)-g(x)\).
(ii) Solve \((f-g)(x)=0\). (Reject any extraneous solution.)
(i) \(\sqrt{x+2}\) needs \(x+2\ge0\), so \(x\ge-2\). \(g(x)=x\) is defined for all \(x\).
\(\therefore\) the domain is \(\mathbf{x\ge-2}\).
(ii) Set the ordinates equal, square, then check:
| \(\sqrt{x+2}\) | \(=\) | \(x\) |
| \(x+2\) | \(=\) | \(x^2\) |
| \(0\) | \(=\) | \(x^2-x-2\) |
| \(0\) | \(=\) | \((x-2)(x+1)\) |
\(x=2\) or \(x=-1\)
Check \(x=-1\): \(\sqrt{-1+2}=1\) but \(g(-1)=-1\), so reject.
Check \(x=2\): \(\sqrt{2+2}=2\) and \(g(2)=2\), true.
\(\therefore\) \(\mathbf{x=2}\)
(i) Find the value of \(k\) for which the graphs of \(y=f(x)\) and \(y=g(x)\) touch, and the point where they touch.
(ii) Find the values of \(k\) for which the graph of \(y=f(x)-g(x)\) lies entirely above the \(x\)-axis.
Form the difference:
| \(f(x)-g(x)\) | \(=\) | \(x^2+1-(4x-k)\) |
| \(\) | \(=\) | \(x^2-4x+(1+k)\) |
| \(\Delta\) | \(=\) | \((-4)^2-4(1)(1+k)\) |
| \(\) | \(=\) | \(16-4-4k\) |
| \(\) | \(=\) | \(12-4k\) |
(i) The graphs touch when \(f(x)-g(x)=0\) has a repeated root, so \(\Delta=0\):
| \(12-4k\) | \(=\) | \(0\) |
| \(k\) | \(=\) | \(\mathbf{3}\) |
Then \(f(x)-g(x)=x^2-4x+4=(x-2)^2\), a repeated root \(x=2\), and \(f(2)=5\). \(\therefore\) they touch at \(\mathbf{(2,5)}\).
(ii) The parabola \(y=f(x)-g(x)\) opens upward, so it lies above the \(x\)-axis for all \(x\) when \(\Delta\lt0\):
| \(12-4k\) | \(\lt\) | \(0\) |
| \(-4k\) | \(\lt\) | \(-12\) |
| \(k\) | \(\gt \) | \(3\) |
\(\therefore\) \(\mathbf{k\gt 3}\). (Dividing by \(-4\) reverses the inequality sign.) For example, \(k=5\) gives the orange line \(y=4x-5\), which never meets the parabola.
(i) Find the \(x\)-coordinates of the points where the graphs of \(y=f(x)\) and \(y=g(x)\) meet.
(ii) By considering \(y=f(x)-g(x)\), find the greatest vertical distance between the two graphs for values of \(x\) between these points.
(iii) For which values of \(x\) is the line below the parabola?
(i) The graphs meet where \(f(x)-g(x)=0\):
| \(2x+3-x^2\) | \(=\) | \(0\) |
| \(x^2-2x-3\) | \(=\) | \(0\) |
| \((x-3)(x+1)\) | \(=\) | \(0\) |
\(\therefore\) \(\mathbf{x=-1}\) or \(\mathbf{x=3}\)
(ii) For \(-1\lt x\lt3\) the line is above the parabola, so the vertical distance is \(d=f(x)-g(x)\). Complete the square:
| \(d\) | \(=\) | \(-x^2+2x+3\) |
| \(\) | \(=\) | \(-\left(x^2-2x\right)+3\) |
| \(\) | \(=\) | \(-(x-1)^2+1+3\) |
| \(\) | \(=\) | \(-(x-1)^2+4\) |
Greatest value when \(x=1\). \(\therefore\) greatest vertical distance \(=\mathbf{4}\).
(iii) The line is below the parabola where \(f(x)-g(x)\lt0\), that is, outside the meeting points.
\(\therefore\) \(\mathbf{x\lt-1}\) or \(\mathbf{x\gt 3}\).
Common pitfalls
Frequently asked questions
What does subtracting ordinates mean?
It means building the graph of \(y=f(x)-g(x)\) by subtracting the \(y\)-value of \(g\) from the \(y\)-value of \(f\) at each \(x\)-value. Each ordinate of the difference is the vertical gap from \(g\) up to \(f\).
How do you find where two graphs meet using f(x) - g(x)?
Solve \(f(x)-g(x)=0\). Its solutions are the \(x\)-coordinates of the meeting points, and the \(x\)-intercepts of \(y=f(x)-g(x)\).
What does f(x) - g(x) > 0 mean on a graph?
The graph of \(y=f(x)\) is above the graph of \(y=g(x)\) at those \(x\)-values.
How do you find the greatest vertical distance between two graphs?
Between the meeting points, write \(d=f(x)-g(x)\) (upper minus lower) and find its maximum, for a quadratic by completing the square.
How do you tell if a line and a parabola touch?
Form \(f(x)-g(x)\) and find its discriminant. \(\Delta=0\) gives a repeated root, so the graphs touch at exactly one point.
Is (f - g)(x) the same as f(x) - g(x)?
Yes. \((f-g)(x)\) is notation for the function whose value at \(x\) is \(f(x)-g(x)\).