Try the code and the simulations beside the lesson.
What you will be able to do
use the triangle inequality for numbers, distances and vectors;
find the point that minimises a sum of distances, on a line and in the plane;
bound a variable with the discriminant, and find a polynomial from AM-GM on its roots.
A detour is never shorter
Walking from home to school through a shop is never shorter than walking straight there. For real numbers, vectors and complex numbers this is the triangle inequality:
∣a+b∣≤∣a∣+∣b∣,∣a−b∣≥∣a∣−∣b∣.
Equality in the first holds when a and b point the same way (for real numbers, when ab≥0).
Least total distance on a line
Three houses stand at 1 km, 4 km and 9 km along a straight road. Where should a well be dug so that the total walking distance f(x)=∣x−1∣+∣x−4∣+∣x−9∣ is least?
Pair the outer houses: ∣x−1∣+∣x−9∣≥∣(x−1)−(x−9)∣=8, with equality for 1≤x≤9. The middle term ∣x−4∣ is least at x=4. So the best place is the middle house, the median, and the least total is 8 km. For an even number of points, any point between the two middle ones is best.
A broken-line graph of the total distance |x - 1| + |x - 4| + |x - 9| for x from 0 to 10. It falls in straight pieces, reaches its lowest value 8 at x = 4, the middle house, and rises again. Three markers on the x axis show the houses at 1, 4 and 9.
Sums of square roots in the plane
Find the least value of g(x)=x2+1+(x−3)2+9.
Read each root as a distance. x2+1 is the distance from (x,0) to (0,1), and (x−3)2+9 is the distance from (x,0) to (3,3). Reflect (3,3) in the x-axis to (3,−3): the distance to (x,0) does not change. By the triangle inequality, the path from (0,1) to (x,0) to (3,−3) is at least the straight distance 32+42=5. So the least value of g is 5, where the straight line crosses the axis.
The x axis with the point (0, 1) above it and the point (3, 3) above it. The point (3, 3) is reflected to (3, -3) below the axis, drawn hollow. A straight green line from (0, 1) to (3, -3) crosses the axis at x = 0.75. A dashed path from (0, 1) to a point on the axis and on to (3, 3) is shown as a longer detour.
Sides of a triangle
Three positive numbers a, b, c are the sides of a triangle exactly when each is less than the sum of the other two. Then x=2b+c−a, y=2c+a−b and z=2a+b−c are positive, and
a=y+z,b=z+x,c=x+y.
This is the Ravi substitution. It turns a triangle inequality into an inequality about any positive numbers. For example, abc≥(b+c−a)(c+a−b)(a+b−c) becomes (y+z)(z+x)(x+y)≥8xyz, which is AM-GM from course 1.
Bounds from a discriminant
A quadratic ax2+bx+c with a>0 is never negative for real x exactly when b2−4ac≤0. Turn this round to bound a variable.
Real numbers satisfy x+y+z=4 and xy+yz+zx=5. How large can z be?
Fix z. Then x+y=4−z and xy=5−z(4−z).
Real roots.x and y are roots of u2−(4−z)u+5−z(4−z)=0, so the discriminant is not negative: (4−z)2−4(5−z(4−z))≥0.
Simplify. This is 3z2−8z+4≤0, that is (3z−2)(z−2)≤0, so 32≤z≤2.
Polynomials with positive roots
If a polynomial has only positive real roots, AM-GM links its coefficients. The cubic x3−9x2+px−27=0 has three positive real roots. By Vieta, the roots add up to 9 and multiply to 27. Their arithmetic mean is 3 and their geometric mean is 327=3. Equal means force equal roots, so every root is 3. Then p, the sum of the three products in pairs, is 3×9=27.
Practise with new numbers
Try it in Python
The program samples many real triples with x+y+z=4 and xy+yz+zx=5, and prints the smallest and largest z it finds.
Common mistakes
Forgetting the equality case of the triangle inequality. The bound is reached only when the pieces line up.
Reflecting the wrong point. Reflect one point so that the two points lie on opposite sides of the line.
Mixing strict and weak signs. A quadratic is positive for all x when D<0, and not negative when D≤0.
Using AM-GM on roots that may be negative or complex. Vieta plus AM-GM needs positive real roots.
Remember these
∣a+b∣≤∣a∣+∣b∣; a sum of distances on a line is least at the median.
A sum of square roots can be a path length: reflect and draw a straight line.
Ravi: triangle sides are y+z, z+x, x+y with x,y,z>0.
Real roots of a quadratic need D≥0; use it to bound a variable.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Find the least value of ∣x−3∣+∣x+2∣.
Can 3, 4 and 8 be the sides of a triangle?
For which real k is x2+kx+4>0 for every real x?
For the triangle with sides 5, 6, 7, find x, y, z of the Ravi substitution.
A cubic x3−12x2+qx−64=0 has three positive real roots. Find q.
References
Engel, Problem-Solving Strategies, Chapter 7, on the triangle inequality and the Ravi substitution.
OpenStax, College Algebra 2e, Chapter 5, on polynomial functions and the relation between roots and coefficients.
Enroll free in Convexity, Jensen and Inequality Techniques
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.
says that a detour is never shorter than the straight path. It finds the point that minimises a total distance and bounds sums of square roots. The sides of any triangle can be written as
y+z
,
z+x
,
x+y
with positive
x,y,z
. A quadratic that keeps one sign has a discriminant that is not positive, and real roots of a polynomial obey AM-GM through Vieta's formulas.
about 25 min1 simulation1 practice question1 Python program5 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.