Phase 3 - Lesson 3.1

Vectors, Multivariable Functions, and Level Sets

From points in R^n to scalar fields: how to picture a function of several variables through its graph, level sets, and sections.

⏱ 45 min● Intermediate🔗 Prereqs: 2.x single-variable calculus
↖ Phase 3 hub
Builds on: Single-variable functions and limits from Phase 2.
Leads to: Partial derivatives (3.2) differentiate the scalar fields introduced here.

Learning Objectives

Click a status chip to cycle: Not started → In progress → Studied → Practiced → Needs review → Mastered.

Key Vocabulary

Euclidean space
The set \(\R^n\) of ordered n-tuples with vector addition, scalar multiplication, and the dot product.
Scalar field
A function \(f:\R^n\to\R\) assigning a number to each point, e.g. temperature or a portfolio’s loss.
Vector field
A function \(F:\R^n\to\R^m\) assigning a vector to each point, e.g. a gradient or a force.
Level set
The set \(\{x: f(x)=c\}\); for \(n=2\) a level curve, for \(n=3\) a level surface.
Norm
The length \(\lVert x\rVert=\sqrt{x\cdot x}\); measures distance and induces the metric on \(\R^n\).
Path limit
The value approached by \(f\) as \(x\) tends to a point along a chosen curve; all paths must agree for a limit to exist.

Intuition & Motivation

Intuition
A function of one variable lives on a line and draws a curve. A function of two variables lives on a plane and draws a surface floating above it. You cannot easily see four dimensions, so instead of the surface we read its contour map: slice the surface at constant heights and project the slices down. Those level curves are exactly what a topographic map or an option’s profit diagram shows.

The dot product is the one tool that turns geometry into algebra: it measures length, angle, and projection all at once. Almost every idea in the rest of this phase - gradients, orthogonality of constraints, least squares - is the dot product wearing a different hat.

Vectors and the dot product

A point \(x=(x_1,\dots,x_n)\) in \(\R^n\) is simultaneously a location and a displacement. The two operations that matter are the norm and the dot product:

\[x\cdot y=\sum_{i=1}^n x_i y_i,\qquad \lVert x\rVert=\sqrt{x\cdot x},\qquad x\cdot y=\lVert x\rVert\,\lVert y\rVert\cos\theta.\] (3.1)

The last identity defines the angle \(\theta\) between vectors and gives the Cauchy–Schwarz bound \(|x\cdot y|\le \lVert x\rVert\,\lVert y\rVert\). Two vectors are orthogonal exactly when \(x\cdot y=0\).

Definition - Scalar and vector fields
A scalar field is \(f:D\subseteq\R^n\to\R\). A vector field is \(F:D\to\R^m\). A path or curve is \(r:\R\to\R^n\), a function of one variable with vector output.

Graphs, level sets, and sections

For \(f:\R^2\to\R\) the graph is the surface \(z=f(x,y)\) in \(\R^3\). Two lower-dimensional shadows make it readable:

Worked Example - Level curves of a quadratic loss
1
Let \(f(x,y)=x^2+4y^2\), a stylized portfolio loss in two risk factors. Set \(f=c\) with \(c\gt 0\).
2
The level set \(x^2+4y^2=c\) is an ellipse with semi-axes \(\sqrt{c}\) and \(\tfrac12\sqrt{c}\).
3
As \(c\) grows the ellipses nest outward; their elongation along \(x\) says the loss is less sensitive to \(x\) than to \(y\) (a unit move in \(y\) costs four times as much).
4
The vertical section at \(y=0\) is the parabola \(z=x^2\) - the surface really is a bowl.

Limits and continuity in several variables

We say \(\lim_{x\to a}f(x)=L\) if \(f(x)\) can be forced within any tolerance of \(L\) by taking \(x\) close enough to \(a\) - along every path. Unlike one dimension there are infinitely many approach directions, so a limit fails if two paths disagree.

Key Idea
To disprove a limit, exhibit two paths giving different values. To prove one, bound \(|f(x)-L|\) by a quantity depending only on \(\lVert x-a\rVert\) (e.g. via polar coordinates).
Common Mistakes to Avoid
  • Concluding a two-variable limit exists after checking only straight-line paths - a parabolic path can still break it (classic: \(f=xy^2/(x^2+y^4)\)).
  • Confusing the graph (a surface in \(\R^3\)) with a level set (a curve in \(\R^2\)).
  • Writing \(\lVert x\rVert^2=x^2+y^2+\dots\) but then forgetting the square root when a distance is needed.
  • Assuming orthogonal means ‘perpendicular on the page’ only; algebraically it is exactly \(x\cdot y=0\) in any dimension.
Quant Practitioner Tips
  • Read any risk report as a contour map: nested ellipses are a quadratic loss, and their axes are the principal risk directions (Phase 4 makes this precise).
  • Polar substitution \(x=r\cos\theta,\ y=r\sin\theta\) turns many 2-D limits into a single-variable limit in \(r\).
  • The dot product is your Swiss-army knife: length, angle, projection, and later the gradient’s directional derivative all reduce to it.

Practice this in the Euler Lab

Computational problems that exercise exactly this technique. Each opens in the Euler Lab with a Python workbench, a progressive hint ladder, and answer checking. Tier A/B run at full scale in the browser.

Warm-up:
#6 Sum Square Difference (1%, tier A) #9 Special Pythagorean Triplet (1%, tier A) #28 Number Spiral Diagonals (2%, tier A) #39 Integer Right Triangles (2%, tier A)

Applied:
#504 Square on the Inside (16%, tier B) #265 Binary Circles (17%, tier B) #679 Freefarea (17%, tier B)

Challenge:
#147 Rectangles in Cross-hatched Grids (41%, tier C) #184 Triangles Containing the Origin (41%, tier C)

273 Project Euler problems in total are mapped to this lesson. Open the Euler Lab to filter them all.

Knowledge Check

Q1 Easy
The level set \(\{(x,y): x^2+4y^2=9\}\) is:
A circle of radius 3
An ellipse with semi-axes 3 and 3/2
A parabola
Two straight lines
Q2 Easy
Two nonzero vectors satisfy \(x\cdot y=0\). This means:
They point the same way
They are orthogonal (angle 90°)
One is the zero vector
Their norms are equal
Q3 Medium
To show \(\lim_{(x,y)\to(0,0)} f(x,y)\) does NOT exist, the cleanest strategy is:
Check the limit along the x-axis only
Find two approach paths giving different limits
Show f is unbounded
Evaluate f at the origin

Practical Exercise

Let \(f(x,y)=\dfrac{xy}{x^2+y^2}\) for \((x,y)\neq(0,0)\). (a) Compute the limit as \((x,y)\to(0,0)\) along the line \(y=mx\). (b) Does \(\lim_{(x,y)\to 0}f\) exist? Justify.

▶ Show full solution

(a) Substitute \(y=mx\):

\[f(x,mx)=\frac{x\cdot mx}{x^2+m^2x^2}=\frac{m x^2}{(1+m^2)x^2}=\frac{m}{1+m^2},\]

which is independent of \(x\), so the limit along \(y=mx\) is \(m/(1+m^2)\).

(b) The path limit depends on the slope \(m\): it is \(0\) along \(y=0\) (m=0) but \(\tfrac12\) along \(y=x\) (m=1). Two paths disagree, so the two-variable limit does not exist, even though every straight-line restriction is finite.

After the reveal, answer for yourself: Notice each single-line limit exists yet the joint limit fails - multivariable limits are strictly stronger.

Lesson Summary

A function of several variables is a scalar field on \(\R^n\); we read it through its graph, level sets, and sections. The dot product encodes length, angle, and orthogonality, and multivariable limits must hold along every path - a single disagreeing path disproves existence.

Formula Sheet Additions

Dot product & angle
\[x\cdot y=\lVert x\rVert\,\lVert y\rVert\cos\theta\]
Length, angle, and orthogonality in one identity.

Retrieval Practice

Close the lesson and answer from memory before checking. This is deliberate, effortful recall - the single highest-yield study action.

▶ Show retrieval prompts & answers
Q: What is a level set and what shape does \(x^2+4y^2=c\) give?
A: The set of inputs mapping to a fixed value c; here a family of ellipses with semi-axes sqrt(c) and (1/2)sqrt(c).
Q: How do you disprove a multivariable limit?
A: Exhibit two approach paths (e.g. y=0 and y=x) along which f tends to different values.

Completion Checklist

Confidence / mastery rating
Personal notes