From positions to displacements
A temperature field takes a position as input. A particle trajectory returns a position as output. Before differentiating either object, we need a language for comparing positions and describing directions. Coordinates supply the algebra; the inner product supplies length and angle.
Definition
Euclidean space and vectors
The space consists of ordered tuples of real numbers. Addition and scalar multiplication act component by component:
The standard basis vector has entry in position and elsewhere, so . A point specifies a position, whereas a vector specifies a displacement. For points , the vector from to is .
A linear combination combines displacement vectors. An affine combination of points has coefficients summing to . This condition makes the resulting point independent of the chosen origin. In particular, describes the segment from to when ; allowing all real describes the full line.
Worked example
A displacement and its direction
Take and . Then . Its length is , so the unit vector pointing from to is . The point one quarter of the way along the segment is
Changing the origin changes the coordinates of both points, but their difference and the segment parameter remain the same.
Length and angle from the inner product
Definition
Inner product, norm and distance
For , define
The inner product is a scalar. It is symmetric and linear in each variable. Also , with equality exactly when . Consequently .
Two vectors are orthogonal when their inner product is zero. For nonzero , their angle satisfies
The inequality below ensures that this quotient lies in . The zero vector is orthogonal to every vector, but has no angle or unit direction.
Theorem
Cauchy–Schwarz inequality
For ,
Equality holds exactly when the pair is linearly dependent, including pairs containing a zero vector.
Proof
Proof by removing a parallel component
If , both sides vanish. If , put . Nonnegativity gives
Multiply by and take square roots. Equality means , precisely the required dependence condition when .
Worked example
A linear expression on a sphere
Suppose . The expression is the inner product of with . Their lengths are and , so
Equality requires parallel vectors. The maximum occurs at , and the minimum occurs at its negative. A bound becomes a complete extremum calculation only after these equality points are identified.
Estimates that control distance
Theorem
Triangle and reverse triangle inequalities
For all ,
Equality in the first inequality holds if one vector is zero or the two nonzero vectors point in the same direction.
Proof
Proof and equality conditions
Expand the square and apply Cauchy–Schwarz:
Taking square roots is valid because both sides are nonnegative. For nonzero vectors, equality requires , which is positive dependence, rather than arbitrary dependence. Finally, apply the triangle inequality to , then exchange and . The two resulting bounds give the reverse triangle inequality.
The reverse inequality says that moving a point by at most changes its distance from the origin by at most . This is a first example of an estimate that controls every possible direction of approach, a central requirement in multivariable limits.
Orthogonal projection
We often need to split a displacement into a part along a chosen direction and a part perpendicular to it. For a nonzero vector , requiring to be orthogonal to gives . Hence
This is also a nearest-point construction. Write . For every real , orthogonality gives
The unique minimum occurs at . Thus projection solves a minimization problem without differentiation.
Worked example
Check a projection by its residual
For and , the coefficient is . Therefore
The residual has dot product with . Also and , whose sum is . Both checks confirm that the decomposition is orthogonal.
Common mistake
A projection is a vector
The coefficient is a scalar; multiply it by to obtain the projection. A negative coefficient means the projection points opposite to . A projection's norm cannot exceed , although an individual coordinate can increase.
How an algebraic formula becomes geometry
The angle formula agrees with the ordinary angle between two nonzero arrows in the plane they span. To see this, expand the squared length of their difference:
The cosine law for the triangle with vertices gives the same expression with the last term replaced by . Comparing the two identifies the quotient defining the angle. Cauchy–Schwarz establishes that the algebraic definition works in every dimension, even when the entire ambient space cannot be drawn.
When , the cross term vanishes and we recover Pythagoras. Conversely, if , then expansion forces . Thus a length identity can detect orthogonality without computing an angle. More generally, the sign of the inner product distinguishes an angle below, equal to, or above , provided both vectors are nonzero. Parallel vectors can have angle or , depending on whether they point in the same or opposite directions.
The squared norm often makes calculations shorter because it is a polynomial expression. For instance, checking is equivalent to checking equality of their squares, since norms are nonnegative. Subtracting the expansions gives . This proves that the diagonals corresponding to and have equal lengths exactly when and are orthogonal.
Use estimates rather than checking directions
The triangle inequality is more than a statement about triangles. For points , write to obtain
It bounds the total effect of two consecutive errors. If a measured position differs from an intermediate estimate by at most , and that estimate differs from the true position by at most , then the original measurement differs from the truth by at most . No assumption about the directions of the two errors is needed.
Cauchy–Schwarz provides a similarly uniform estimate for a fixed linear measurement. With fixed, put . Then
For example, if and a position changes by at most in Euclidean distance, the measurement changes by at most . The estimate covers all changes in position simultaneously. Equality is possible when the displacement is parallel to , so the constant cannot be made smaller for all possible displacements. This gives both an error bound and the direction in which the measurement is most sensitive.
Projection also gives a uniform comparison. If , then Pythagoras yields , hence . Equality holds precisely when the residual vanishes, meaning already lies on the line spanned by . Applying the projection twice changes nothing: writing gives . These two properties explain why projection behaves like retaining one directional component and discarding the perpendicular component.
A problem-solving routine
First identify the type of each object. The difference of two positions is a vector; its norm is a length; an inner product produces a scalar; a projection produces a vector. Keeping these types visible prevents a scalar projection coefficient from being mistaken for the projected displacement.
Next select the quantity that matches the question. For a distance, form a difference and take its norm. For an angle, compute an inner product and both lengths. For an upper bound on a linear expression, recognize an inner product and apply Cauchy–Schwarz before doing more coordinate algebra. For the closest point along one direction, remove the perpendicular residual using projection.
Finally verify the result geometrically. A unit vector must have norm and the intended direction. A projection residual must be orthogonal to the target direction. An extremum found from an inequality must satisfy the original constraint and the inequality's equality condition. These checks have different purposes: one confirms magnitude, another confirms direction, and another confirms attainability. Together they convert a plausible calculation into a complete solution.
Coordinates, scaling and geometric meaning
The standard basis separates a vector into independent coordinate contributions. The coefficient of a basis vector tells us how much displacement occurs in that coordinate direction. These coefficients can be negative, positive or zero. A negative coefficient describes movement opposite to a basis direction; it does not describe a negative length. This distinction explains why coordinate calculations use signed numbers while a norm uses a square root of a sum of squares. The sign information remains in the vector even though it disappears from its length.
To compare vectors, first check that they belong to the same Euclidean space. A point in the plane and a point in three-dimensional space do not have a difference until an embedding has been specified. Once the ambient space is fixed, the formulas do not depend on whether we can draw that space. In four dimensions, for example, two positions differing only in one coordinate are separated by the absolute value of that coordinate change. When several coordinates change, the squared changes add, just as they do in a right triangle in the plane.
The dot product records how two displacements cooperate. Positive contributions from corresponding coordinates can be cancelled by negative contributions in other coordinates. Orthogonality therefore does not require the nonzero coordinates to occur in different positions. For instance, the planar vectors with coordinates one and two, and coordinates two and negative one, have two nonzero coordinates each, but their inner product is zero. The cancellation expresses perpendicular directions rather than a lack of shared coordinates. This is why inspecting coordinates one by one is usually less useful than computing the full inner product.
Scaling a direction changes a parameter but does not change its line. If a nonzero real number multiplies the target vector in a projection formula, it appears once in the inner product, twice in the squared denominator and once in the final vector. These factors cancel. Thus projecting onto a direction and projecting onto any nonzero multiple of that direction give the same point. In particular, reversing the arrow chosen to describe the line leaves the nearest point unchanged. This is a valuable consistency check when two solutions use different direction vectors.
The signed scalar component along a unit direction deserves separate attention. It is an inner product and may be positive, zero or negative. The corresponding projected vector is that scalar times the unit direction. Its length is the absolute value of the scalar. Confusing these three objects can produce an answer of the wrong type even when all arithmetic is correct. In a displacement problem, retain the sign when describing which way an object moves; take the absolute value only when the question asks for a distance or length.
Finally, inequalities and equations play different roles. An inequality such as Cauchy–Schwarz provides a bound valid for an entire set of vectors. An equation describing the equality case identifies the vectors for which the bound is sharp. In a constrained extremum problem, both pieces are needed. If the equality direction is incompatible with an extra constraint, the original bound remains true but may no longer be attainable. The correct next step is then to examine the additional constraint, rather than to label the unattained bound as a maximum. Keeping the bound and its attainment separate is a habit that will remain useful in later optimization problems.
Exercises and solutions
Checkpoint
1. Expand both sides to prove the parallelogram identity.
Prove .
Solution · 1. The cross terms cancel
The two expansions contain and . Their sum is , giving the identity.
Checkpoint
2. Compare the two equality conditions.
Let and . Does equality hold in Cauchy–Schwarz? Does it hold in ?
Solution · 2. Opposite directions give different answers
Since , Cauchy–Schwarz is an equality: . But , so the triangle inequality reads and is strict. Opposite directions satisfy dependence, but not positive dependence.
Checkpoint
3. Find a projection and its error.
Project onto , and find the shortest distance from to the line through in direction .
Solution · 3. Use the perpendicular residual
Here and , giving . The residual is perpendicular to , and its length is . The nearest-point identity proves that this is the shortest distance.