McGill University · MATH 206

McGill MATH 206 tutoring

Applied Calculus and Linear Algebra: one-to-one online tutoring and exam preparation.

Listed course

Course overview

McGill MATH 206 combines linear algebra with multivariable calculus for data-science applications.

MATH 206 topics to review

Eigenvalues and diagonalizationOrthogonality, Gram–Schmidt and projectionsSpectral theorem and singular value decompositionPositive-definite matricesPartial derivatives, gradients and approximationsExtrema and constrained optimization

Common difficulties

  • Distinguishing eigenvalue decomposition from singular value decomposition
  • Connecting matrix properties to the classification of an extremum

What does the Hessian say about the objective?

Let x,yx,y be independent dimensionless real inputs and f(x,y)=2x2+2xy+2y2−6xf(x,y)=2x^2+2xy+2y^2-6x a dimensionless quadratic objective. Find its stationary point, form its Hessian matrix and decide whether the point is a minimum, maximum or saddle. Can you prove a global conclusion for this particular function?

Hint: connect the matrix to a displacement

The Hessian contains the second partial derivatives. A symmetric matrix HH is positive definite when dTHd>0\mathbf d^{T}H\mathbf d>0 for every nonzero displacement vector d\mathbf d. Here TT denotes transpose.

Find the point and justify the classification

The gradient equations are 4x+2y−6=04x+2y-6=0 and 2x+4y=02x+4y=0, giving (x,y)=(2,−1)(x,y)=(2,-1) and f=−6f=-6. The symmetric Hessian is

H=(4224).H=\begin{pmatrix}4&2\\2&4\end{pmatrix}.

Its eigenvalues are 66 and 22, both positive, so it is positive definite. Equivalently, for d=(u,v)T\mathbf d=(u,v)^T, dTHd=4u2+4uv+4v2=2(u+v)2+2u2+2v2>0\mathbf d^TH\mathbf d=4u^2+4uv+4v^2=2(u+v)^2+2u^2+2v^2>0 unless both components vanish. Positive curvature in every direction gives a strict local minimum.

For the global claim, write u=x−2u=x-2, v=y+1v=y+1. Direct expansion gives

f(x,y)+6=2u2+2uv+2v2=(u+v)2+u2+v2.\begin{aligned} f(x,y)+6&=2u^2+2uv+2v^2\\ &=(u+v)^2+u^2+v^2. \end{aligned}

This is positive for every nonzero displacement, so −6-6 is the unique global minimum value. A Hessian test at one point alone would not prove a global result for an arbitrary nonquadratic function.

Retry: change one quadratic coefficient

Replace 2y22y^2 by −y2-y^2, so g(x,y)=2x2+2xy−y2−6xg(x,y)=2x^2+2xy-y^2-6x. Find and classify its stationary point. Confirm the classification by moving separately along the two coordinate directions.

Check the changed objective

The equations 4x+2y−6=04x+2y-6=0, 2x−2y=02x-2y=0 give (1,1)(1,1), with g=−3g=-3. Its Hessian is (422−2)\begin{pmatrix}4&2\\2&-2\end{pmatrix}, whose determinant is −12-12, so it is indefinite and the point is a saddle. Directly, g(1+t,1)=−3+2t2g(1+t,1)=-3+2t^2 while g(1,1+t)=−3−t2g(1,1+t)=-3-t^2. Arbitrarily near the stationary point there are both larger and smaller values.

A zero gradient identifies a candidate; it does not classify it. If the matrix language is the obstacle, use the eigenvector geometry refresher as prerequisite practice, then return to the Hessian argument.

Why is an orthogonal projection the closest vector?

Work in real Euclidean space with the usual dot product and norm. All coordinates here are dimensionless. Let a=(1,2)T\mathbf a=(1,2)^T and b=(4,1)T\mathbf b=(4,1)^T, where TT means transpose. Find the vector on the entire line L={ca:c∈R}L=\{c\mathbf a:c\in\mathbb R\} that is closest to b\mathbf b. The line passes through the origin; this is not a projection onto a segment.

First sketch the line, the vector b\mathbf b, and the gap from a candidate on the line to b\mathbf b. What should be perpendicular when that gap is shortest?

Hint: name the residual

For a candidate cac\mathbf a, the residual is b−ca\mathbf b-c\mathbf a. Try making it orthogonal to a\mathbf a. Remember that a⋅a=∥a∥2\mathbf a\cdot\mathbf a=\lVert\mathbf a\rVert^2, not ∥a∥\lVert\mathbf a\rVert. The denominator is positive because a≠0\mathbf a\ne\mathbf0.

Find the projection and prove the minimum

The orthogonality equation is a⋅(b−ca)=0\mathbf a\cdot(\mathbf b-c\mathbf a)=0. Since a⋅b=6\mathbf a\cdot\mathbf b=6 and a⋅a=5\mathbf a\cdot\mathbf a=5, it gives c∗=6/5c_*=6/5. Thus

p=c∗a=(6/512/5),r=b−p=(14/5−7/5).\begin{aligned}\mathbf p&=c_*\mathbf a=\begin{pmatrix}6/5\\12/5\end{pmatrix},\\\mathbf r&=\mathbf b-\mathbf p=\begin{pmatrix}14/5\\-7/5\end{pmatrix}.\end{aligned}

Check the result: p∈L\mathbf p\in L and a⋅r=14/5−14/5=0\mathbf a\cdot\mathbf r=14/5-14/5=0. The scalar c∗c_*, the projection vector p\mathbf p, and the residual vector r\mathbf r are different objects.

Equal-scale coordinate diagram. The line L has direction a=(1,2). The vector b goes from the origin to (4,1). Its projection p ends at (6/5,12/5) on L. The residual arrow runs from p to b and is perpendicular to L. The projection lies beyond a on the same line.
The head-to-tail arrows show b=p+r\mathbf b=\mathbf p+\mathbf r. The residual is drawn from p\mathbf p to b\mathbf b; its components remain (14/5,−7/5)(14/5,-7/5). The right angle explains why the cross term in the squared-distance expansion vanishes.

Orthogonality also proves optimality. For any real number cc,

b−ca=r+(c∗−c)a,∥b−ca∥2=∥r∥2+(c∗−c)2∥a∥2=495+5(c−65)2.\begin{aligned}\mathbf b-c\mathbf a&=\mathbf r+(c_*-c)\mathbf a,\\ \lVert\mathbf b-c\mathbf a\rVert^2&=\lVert\mathbf r\rVert^2\\&\quad+(c_*-c)^2\lVert\mathbf a\rVert^2\\ &=\frac{49}{5}+5\left(c-\frac65\right)^2.\end{aligned}

The cross term vanishes because r⋅a=0\mathbf r\cdot\mathbf a=0. The added square is nonnegative and is zero only for c=6/5c=6/5. Hence p\mathbf p is the unique closest vector, and the minimum distance is ∥r∥=7/5\lVert\mathbf r\rVert=7/\sqrt5. We minimized squared distance; it has the same minimizer as distance because square root is increasing on nonnegative numbers. A nonzero residual means b\mathbf b is not on the line, not that the projection failed.

If the dot product or denominator is unclear, use the existing dot-product and projection practice, then return to the minimum-distance proof above. That prerequisite section is written for Concordia MATH 204; this link does not assert course equivalence.

Three checks, from geometry to least squares

These original questions practise selected skills. Use your current MATH 206 outline to decide which extensions to study; this is not an official exam or a complete assessment.

1. Can a nonzero vector have zero projection?

Keep a=(1,2)T\mathbf a=(1,2)^T, but take b=(2,−1)T\mathbf b=(2,-1)^T. Predict the projection before calculating. Find the residual and minimum distance.

Hint for question 1

Compute the dot product first. Zero projection does not require the input vector to be zero.

Check question 1

Now a⋅b=2−2=0\mathbf a\cdot\mathbf b=2-2=0, so c∗=0c_*=0, p=0\mathbf p=\mathbf0, and r=(2,−1)T\mathbf r=(2,-1)^T. The minimum distance is 5\sqrt5. Every nonzero move along LL adds a positive squared-distance term.

2. Change the generator, not the line

Return to b=(4,1)T\mathbf b=(4,1)^T, but describe the line using a~=(−2,−4)T=−2a\widetilde{\mathbf a}=(-2,-4)^T=-2\mathbf a. Find the new coefficient. Must the projection or minimum distance change?

Hint for question 2

Both numerator and denominator change. Compare the product of coefficient and generator, not the coefficient alone.

Check question 2

The new coefficient is (−12)/20=−3/5(-12)/20=-3/5. Multiplying gives (−3/5)(−2,−4)T=(6/5,12/5)T\begin{aligned}&(-3/5)(-2,-4)^T\\&\quad=(6/5,12/5)^T\end{aligned}, the same projection. The residual and minimum distance are unchanged because the set of candidate vectors is unchanged. The coefficient depends on the chosen generator; the closest vector does not.

3. One coefficient, three target values

As a least-squares extension, let a=(1,1,1)T\mathbf a=(1,1,1)^T, b=(1,2,6)T\mathbf b=(1,2,6)^T, and choose a constant cc to minimize (1−c)2+(2−c)2+(6−c)2(1-c)^2+(2-c)^2+(6-c)^2. Find the fitted vector and residual. Explain why the residual components sum to zero even though they are not all zero.

Hint for question 3

This is the same line-projection problem in R3\mathbb R^3. A zero residual would require all three target values to be the same.

Check question 3, then retry

The coefficient is c∗=9/3=3c_*=9/3=3, the fitted vector is (3,3,3)T(3,3,3)^T, and the residual is (−2,−1,3)T(-2,-1,3)^T. Its dot product with (1,1,1)T(1,1,1)^T is zero. The squared error is 1414, and for any cc the objective equals 14+3(c−3)214+3(c-3)^2. This proves the minimum rather than merely locating a stationary point.

Independent retry: replace the targets by (2,2,5)T(2,2,5)^T. Find the fit and squared error before opening the next answer.

Check the changed targets

The minimizing constant is still 33, but the residual is now (−1,−1,2)T(-1,-1,2)^T and its squared norm is 66. The same fitted vector can accompany different errors. This calculation uses ordinary unweighted Euclidean least squares; no probabilistic model has been assumed.

For a formula error, return to the orthogonal-residual argument. For a Hessian or eigenvalue question, use the separate quadratic-objective example. A projection test does not replace a Hessian classification.

How tutoring can help

Bring the gradient equations and your Hessian. Your tutor can check the stationary point, connect the matrix to directional curvature and ask what extra argument would make a local conclusion global. Then change one coefficient and explain the new geometry before calculating. For projection work, also bring your candidate vector and residual; mark which dot-product or minimum-distance step you cannot justify.

Exam preparation for MATH 206

Alternate matrix calculations with optimization problems from your current outline. For projections, identify the target subspace and check both membership of the projection and orthogonality of the residual to the target subspace; explain why these give the closest vector. For the quadratic example, distinguish the local Hessian test from the separate global argument. Try the changed-data questions without the solutions. The least-squares extension samples one application and is not a complete MATH 206 assessment.

Use your section’s outline to choose the chapters to review. We work through permitted practice and comparable problems, without completing graded assignments or exams on your behalf.

Need help with MATH 206?

Send your topic and preferred times. We’ll confirm whether we can help and, if so, agree on a time by text or email before payment.

Request MATH 206 tutoring

Nablio is an independent service and is not affiliated with this institution.

MATH 206 · official course referenceMATH 206 · official offering information