Gradients, the Jacobian, and Taylor Series
Gradients, the Jacobian, and Taylor Series
9.1 Single-Variable Derivatives — Quick Recap
9.1.1 Definition and Key Identities
What if you could predict exactly how fast something changes at a single moment — not an average over time, but the instantaneous rate right now? That is what the derivative gives you.
Think of a car's speedometer. It does not tell you how far you drove in the last hour. It tells you your speed right now — the rate at which the distance is changing at this instant. A derivative is the speedometer reading for any function. For a function , the derivative tells you how fast changes when you nudge by a tiny amount. If the derivative is large, the function is steep. If it is zero, the function is flat. If it is negative, the function is dropping.
The derivative of a function at a point is the limit of the difference quotient:
It measures the instantaneous rate of change — the slope of the tangent line at that point.
Four exam-critical identities. The professor recommends you memorize them.
The power rule:
Derivative of sine:
Derivative of the exponential:
Derivative of the natural logarithm:
These four identities are not optional — they are the building blocks for chain-rule, partial-derivative, and Taylor-series exam problems. If you must pause to look them up during an exam, you lose time on every subsequent question.
Quick sanity check. Take . By the power rule, .
At : . Check with a tiny nudge :
The formula and the numerical approximation agree. That is the derivative at work.
Scope: The derivative exists only where the function is differentiable — meaning the limit in the definition above exists and is the same from both sides. Functions with sharp corners (like at ), jumps, or vertical tangents are not differentiable at those points.
Assumption: The identities above assume standard real-valued functions on open intervals. The power rule for with non-integer requires (e.g., is not differentiable at ).
9.1.2 Symbol Registry
- — a function of one variable — scalar-valued
- or — the first derivative — scalar
- — derivative operator with respect to
- — exponent in the power rule — any real number (with domain care)
9.1.3 Interpreting the Derivative on a Plot
Take . Its graph is a parabola — a U-shaped curve — with its lowest point at . The derivative is . The professor's words: "the derivative of this function with respect to would be ."
Visual intuition. Draw the parabola opening upward. Along the horizontal -axis, mark the -axis as . Label the following:
- At : the function value is . The derivative is . The tangent line slopes downward — the function is falling as you move right. You are on the left side of the bowl, sliding toward the bottom.
- At : the derivative is . The tangent line is flat. You are at the very bottom of the bowl — the minimum.
- At : the derivative is . The tangent line slopes upward steeply. You are on the right side, climbing fast.
The derivative at any point is the slope of the tangent line touching the curve at that point. A positive derivative means the function rises as you go right. A negative derivative means it falls. The magnitude tells you how steep the climb or descent is.
At the rate is 6. At the rate is 8. Each point has a different slope because the curve is not a straight line — it bends.
Pitfall 1 — Derivative vs. function value. The derivative is not the value of the function. At , (the height), but (the steepness). Students confuse the two constantly. The function tells you where you are. The derivative tells you which way and how fast you are going.
Pitfall 2 — Zero derivative does not guarantee max or min. means the graph is flat — but it could be a peak, a valley, or just a flat shelf (like at ). You need the second derivative to tell the difference. This is covered in Section 9.8.
Pitfall 3 — The derivative is a local property. The derivative at tells you the slope near . It says nothing about what the function does at . A large derivative at one point does not mean the function is large everywhere.
Pitfall 4 — Memorizing vs. understanding. The professor explicitly said to memorize the four identities. You cannot re-derive the power rule from scratch during the exam. Know them cold.
The ideas here are not just for exams. Physicists use derivatives to compute velocity and acceleration. Engineers use them to find stress points in a bridge — where the slope of the stress curve is steepest. In machine learning, every gradient descent step (Section 9.3) starts with computing a derivative. This is the atom of optimization.
The derivative is the instantaneous rate of change — the slope of the tangent. Memorize the four identities: power rule, sine, exponential, logarithm. They are the non-negotiable building blocks for everything ahead: partial derivatives, gradients, and Taylor series.
9.1.4 Student Questions and Answers
Q: When the derivative of is , at the value is not a relative rate, is it?
A: The derivative tells you how changes when you change . If you increase by a small amount, changes by roughly twice that amount. At each different -value the rate is different. At the rate is 6. At the rate is 8. The function itself tells you the absolute value. The derivative tells you the rate of change — how fast the value is moving.
9.1.5 Exam Notes
Exam note: These basic derivative identities are prerequisites for all calculus problems in the exam. You must know them without looking them up. The power rule, , , and — commit these to memory.
9.2 Partial Derivatives — Functions of Multiple Variables
9.2.1 Definition and Motivation
A single dial controls one thing. But what if you have two dials — say, a thermostat and a dimmer — and you want to know how the room's comfort level changes when you turn only the temperature dial and leave the lights alone? That is a partial derivative.
When a function depends on more than one variable, say , the function can change differently depending on which variable you nudge. Turning up the temperature changes comfort. Turning up the brightness changes comfort too, but in a different way and at a different rate. You cannot capture both effects with a single number. A partial derivative measures the rate of change with respect to one variable while holding all others constant. It answers: "If I tweak just this one input, how does the output respond?"
The notation uses the curly "" (called "del" or "partial") to remind you that the function has other variables you are ignoring for the moment. Some texts write or as shorthand.
For a function , the partial derivative with respect to is:
Every variable except is frozen. You treat them exactly like constants. The computation reduces to an ordinary single-variable derivative — the kind you already know from Section 9.1.
9.2.2 Symbol Registry
- — partial derivative of with respect to — scalar (for scalar-valued )
- — partial derivative of with respect to — scalar
- — a function of two (or more) variables — scalar-valued
- — alternative notations for
9.2.3 Computing Partial Derivatives
Take . Think of this as an upside-down bowl — an inverted paraboloid. The peak sits at where . Everywhere else, the function value is lower.
Step 1 — Compute . Treat as a constant. The constant 4 has derivative 0. The term is constant with respect to , so its derivative is also 0. Only contributes:
Step 2 — Compute . Now treat as constant:
Interpretation. At the point : - — if you walk east (increase ), the function drops at rate 2. - — if you walk north (increase ), the function drops faster, at rate 4.
The function is steeper in the -direction than the -direction at this point. Both partials are negative because you are on the downward slope of the bowl in both directions.
Sense-check: The bowl peaks at . From , moving toward should increase the function. The negative partials tell you that increasing or (which moves you away from the peak) makes the function go down. This matches.
Scope: Partial derivatives exist when the limit in the definition is well-defined. A function can have partial derivatives at a point but still not be differentiable (in the full multivariable sense) — differentiability requires continuity and well-behaved directional derivatives from all angles, not just along the coordinate axes.
Assumption: The "treat other variables as constants" rule works because the variables are independent. If and are themselves related (e.g., ), you cannot simply hold one constant — you need the chain rule (Section 9.4.6).
What breaks: For functions with sharp ridges or cusps, partial derivatives might exist along the axes but not elsewhere. A function like has partial derivatives at — both are zero — but the function is not differentiable there.
Visual intuition. Draw a 3D bowl opening downward. The -axis runs left-to-right, the -axis runs front-to-back, and the vertical -axis shows . Mark the peak at . Pick the point — here . From this point:
- If you walk along the -direction (keeping ), the curve on the bowl's surface you trace is a downward parabola. The slope of that curve at is — your .
- If you walk along the -direction (keeping ), the slope is steeper at — your .
The two slopes are different because the bowl is not symmetric around your current position.
Pitfall 1 — Forgetting to hold other variables constant. The most common mistake is differentiating a term with in it when computing . If the term has no , it is a constant. Its derivative is zero. Period. This trips up students on the first few problems every time.
Pitfall 2 — Mixing up and . Use for multivariable functions, not . The curly signals "there are other variables I am holding constant." Using on a multivariable function is notationally incorrect.
Pitfall 3 — Assuming the partials are equal. and are different functions. They tell you the slope in different directions. They can be wildly different numbers — do not assume symmetry unless the function has it.
Pitfall 4 — Confusing the number of partials with the number of variables. For a function of variables, you get partial derivatives — one per variable. Each is computed separately. For , you must compute , , and . All three together form the gradient (Section 9.3).
The partial derivative is the workhorse of every multivariable optimization problem. In economics, partial derivatives of a profit function with respect to price and quantity tell a firm which lever to pull for the biggest gain. In physics, partial derivatives of temperature with respect to position and time tell you how heat flows. In machine learning, every weight update in a neural network starts with a partial derivative of the loss.
A partial derivative measures how a function changes when you nudge one variable and freeze the rest. Compute it exactly like an ordinary derivative — treat every other variable as a constant. The collection of all partial derivatives forms the gradient, which you will use in the next section to find the direction of steepest climb.
9.2.4 Student Questions and Answers
Q: For a term like , when deriving with respect to we keep and as constants. Why can't we do the same for — why is the product rule needed?
A: When deriving with respect to , the term is a constant multiplier. The derivative is simply . You treat other variables as constants — that is absolutely correct. The product rule is a general procedure for any product. For , the term has no -dependence, so when deriving with respect to alone, is constant. You get . The product rule still applies — the extra term where you differentiate with respect to is zero. Same result, same logic. A constant factor inside a product still behaves like a constant.
9.3 The Gradient — Direction of Steepest Increase
9.3.1 Definition
You are standing on a mountainside in thick fog. You cannot see the peak. But you can feel the ground under your feet and tell which direction is steepest uphill. Your inner ear is computing a gradient.
A function of several variables has many partial derivatives — one per input. If you just list them, great, but that list does not tell you much by itself. The gradient bundles all the partial derivatives into a single arrow. That arrow points in the direction the function increases fastest. The professor's words: "We call the gradient of a function the assembly of the partial derivatives."
For a scalar-valued function , the gradient (pronounced "nabla f" or "del f") is the column vector of all first-order partial derivatives:
Each component tells you how fast changes when you nudge alone. Together, they form a vector that points in the direction of steepest increase of at any point.
Why does the gradient point to the steepest increase? Consider the directional derivative — the rate of change of in the direction of any unit vector :
Since , the directional derivative is , where is the angle between and . The cosine is largest () when — meaning points exactly along . So itself is the direction that maximizes the rate of increase. The negative gradient maximizes the rate of decrease. Moving perpendicular to (where ) gives zero change — you are walking along a level curve.
9.3.2 Symbol Registry
- — gradient of — vector in ,
- — -th partial derivative — scalar
- — nabla / del operator
- — directional derivative in direction
9.3.3 Geometric Intuition — The Hiker on a Mountain
Think of as a smooth hill. The peak — the highest point — is at where . Every other point is somewhere on the slope heading down.
Now stand at . The function value is . You are halfway up the hill. From Section 9.2 you know the partial derivatives are and . Plug in :
The professor's words: "At and , the gradient value points to ."
In the -plane (looking down from above), you stand at . The vector points diagonally toward the origin — toward . The origin is the peak. This makes perfect sense: the gradient points toward the highest function value.
Visual intuition. Draw a top-down contour map — concentric circles centered at . Each circle is a level curve: all points on a circle have the same height. The circles get smaller and higher as you approach the center. At any point on a circle, draw an arrow perpendicular to the circle, pointing inward. That arrow is the gradient. It always cuts straight across level curves, aiming directly at the peak. At , the gradient points toward the center. If you start anywhere and take tiny steps in the gradient direction, you climb toward the peak. This is gradient ascent.
9.3.4 Connection to Machine Learning — Gradient Descent
In machine learning, you almost always want to minimize something — a loss, an error, a cost. The gradient points uphill, toward higher values. To go downhill — toward the minimum — you move in the opposite direction: .
The professor's words: "Gradient points toward the direction of increase. But you do not want to go toward the increase of the function. Your idea is to minimize the error. So you take the negative of the gradient."
Gradient descent update rule. For a loss function depending on parameters , you iteratively adjust each parameter:
Here is the learning rate — a small scalar that controls step size. For two parameters :
The professor's words: "We start with simple approximations of and and keep seeing how the error changes. That is where calculus comes in."
Foggy mountain analogy for gradient descent. 1. You are on a foggy mountain and want the lowest valley. You cannot see the whole landscape. 2. Look at the ground under your feet. Find the direction of steepest downhill slope. 3. Take a small step in that direction. 4. Repeat.
Gradient descent is exactly this: compute the gradient (steepest uphill), flip the sign (steepest downhill), take a small step (controlled by ), and repeat until the ground is flat (). You end up at a local minimum.
Scope: Gradient descent finds a local minimum, not necessarily the global one. On a landscape with multiple valleys, your starting point determines which valley you end up in. This is a fundamental limitation — the gradient only has local information.
Assumptions: The loss function must be differentiable (or at least sub-differentiable). The learning rate must be chosen carefully — more on this in the pitfalls.
What breaks: If the loss surface has flat regions (plateaus), the gradient is near zero and progress stalls. If it has sharp cliffs, a step can overshoot wildly. These are real problems in deep learning that motivate advanced optimizers like Adam and momentum.
9.3.5 Linear Regression — A Concrete Gradient Descent Example
Suppose you have data points pairing years of experience () with salary (). You guess a linear relationship:
The professor's words: "You imagine that equals times plus . You do not know and . You only have an initial guess."
Setup: Start with guess , . Data points: (2 yrs, $10K) and (3 yrs, $19K) — note these are illustrative numbers.
For the first person with 2 years experience:
For the second person with 3 years:
You cannot just sum these errors — , which misleadingly suggests a small total error. The professor's words: "You do not want the errors to cancel. and sum to zero and you would think your model is perfect."
So you square each error. The mean squared error (MSE) loss for data points:
Now you compute the partial derivatives and . Then update:
Repeat until the gradient is close to zero. The line settles at the least-squares fit — the position that best explains the data.
The professor's physical analogy: imagine springs attached between each data point and the line. Each spring pulls the line toward the data point. The line settles where all spring tensions balance. That equilibrium is the least-squares solution.
Pitfall 1 — Learning rate too large. A big makes you leap over the minimum. You oscillate or diverge — the loss explodes instead of shrinking.
Pitfall 2 — Learning rate too small. A tiny means you inch toward the minimum. Training takes forever. You might run out of time or iterations before converging.
Pitfall 3 — Not normalizing features. If is in years (0–40) and another input is in dollars (0–1,000,000), the loss surface becomes a long skinny bowl. Gradient descent zigzags inefficiently. Scale your inputs to comparable ranges.
Pitfall 4 — Forgetting the negative sign. The gradient points uphill. If you write instead of minus, you maximize the loss. The professor explicitly warned about this: the entire idea of gradient descent is moving against the gradient.
The gradient is the mathematical engine of modern machine learning. Every neural network — from a simple linear regressor to GPT — trains by computing gradients and stepping downhill. In robotics, the Jacobian transpose (closely related to the gradient) maps desired hand velocities to joint motor commands. In computational chemistry, gradients of energy functions guide the search for stable molecular structures.
The gradient is the vector of partial derivatives — it points to the steepest uphill direction. For minimization, you go the opposite way: gradient descent. The negative gradient, scaled by a learning rate, becomes your step. This simple rule trains everything from linear regression to deep neural networks. Next, you will see a full worked gradient computation in three variables.
9.3.6 Student Questions and Answers
Q: Why do we use gradient in ML when the derivative increases the function? Don't we want to go to the minimum?
A: Several students asked this — and for good reason. We negate the gradient. The gradient points uphill — toward higher function values. Minimizing a loss requires going downhill, so you move in the direction of . That flips every component's sign and takes you toward the minimum. The professor's own words: "gradient points toward the direction of increase... so you take the negative of the gradient."
Q: Does the derivative alone tell us where the maximum or minimum is?
A: For a single variable, the derivative tells you the direction to move — not the location of the extremum. For multiple variables, the gradient does the same. To find the extremum, you solve — the gradient vanishes at critical points. But that only gives you candidates. Whether a candidate is a maximum, minimum, or saddle point is determined by the second derivative — the Hessian matrix for multiple variables (Section 9.8).
9.3.7 Key Intuitions
The professor says: "Think of the gradient as telling you where to move from wherever you are standing. If you are a hiker on a mountain, the gradient points the way up. For machine learning loss, you want to go down, so you reverse it." This is the single most important intuition: the gradient is a compass. Point it uphill or flip it downhill — the math is the same either way.
9.4 Worked Gradient Problem — Three Variables
9.4.1 Problem Statement
You now know the theory — gradient as a vector of partials, pointing uphill. The exam will not ask you to recite the definition. It will hand you a function, a point, and say: "Find the gradient. Is this vector orthogonal to another vector? Now chain it through a parameter." Let's solve that exact problem, step by step.
Problem: Find the gradient of at the point . Check whether the vector is orthogonal to the gradient at that point. Then, if , , , find .
9.4.2 Symbol Registry
- — the function — scalar-valued,
- — partial derivatives — scalars
- — the gradient vector — vector in
- — chain rule parameter — scalar
- — total derivative with respect to — scalar
9.4.3 Computing the Partial Derivatives
The professor's words: "First look into the function and find the partial derivatives."
Step-by-step partial derivative computation.
The function has four terms: , , , and .
For : Freeze and — treat them as constants. - - (no ) - (no ) - (the is a constant multiplier)
For : Freeze and . - -
For : Freeze and . - -
9.4.4 Evaluating at
Plug , , into each partial derivative.
The gradient at is:
Sense-check: The function is . At , the squared terms contribute and the cross term contributes , so . The gradient components are non-zero, which makes sense — you are not at a critical point. The signs indicate the function decreases if you increase , increases if you increase , and increases slightly if you increase .
9.4.5 Orthogonality Check
Question: Is orthogonal to ?
Two non-zero vectors and are orthogonal if and only if their dot product is zero:
The dot product is zero exactly when , meaning .
Compute the dot product:
Since , the vectors are not orthogonal.
Sense-check: The dot product is , so the angle is not . This is a clean, finite answer — typical of exam problems. They want you to compute the dot product and conclude.
9.4.6 Chain Rule Extension
Now the variables themselves depend on a parameter: , , . The total derivative captures how changes when changes, accounting for the ripple effect through all three variables.
Multivariable chain rule. For where , , depend on :
Think of it as: the change in = (how changes through times how changes with ) + (same for ) + (same for ). Each path from to contributes an additive term. The professor's words: "You will have to first find how changes with respect to , , and . Then find how changes with respect to , and so on."
Step 1 — Compute :
Step 2 — Substitute partial derivatives and derivatives of into the chain rule:
Step 3 — Replace with their expressions in :
Final answer:
Sense-check: When is small (say ), the term dominates (), and the higher powers are tiny — which makes sense because near the origin the part of dominates. The chain rule correctly captured how propagates through all three variables.
Scope: The chain rule formula works when each input variable depends on a single parameter . If inputs depend on multiple parameters (say and ), you get a matrix equation — the Jacobian times another Jacobian (see Section 9.6).
Assumption: The inner functions must be differentiable. If any of them has a kink or discontinuity, the chain rule fails at that point.
What breaks: A common mistake is mixing up (total derivative) with . If does not directly contain (it only depends on which depend on ), then — but is NOT zero because affects through . Use the chain rule, not direct differentiation.
Visual intuition. Draw a tree diagram: splits into three branches — , , . Each of these feeds into . The total derivative is the sum of the products along each path from to . This tree diagram is the mental model for every chain rule problem — draw it, label each edge with the derivative, multiply along each path, sum across paths.
Pitfall 1 — Forgetting to substitute back. After writing the chain rule expression, you must replace with their formulas in and simplify. Leaving the answer as an expression in is incomplete. The question asks how changes with respect to — the answer must be in only.
Pitfall 2 — Sign errors in partial derivatives. The term is particularly sneaky. When computing , students sometimes forget that the 3 is a constant multiplier. Write out each term separately and double-check the sign.
Pitfall 3 — Dot product for orthogonality. Two vectors are orthogonal only when the dot product is exactly zero. means not orthogonal, period. Don't overthink it. The exam might try to trick you with numbers that nearly cancel — compute exactly, compare to zero.
Pitfall 4 — Confusing the point of evaluation. The problem asks for the gradient at a specific point. The answer is a vector of numbers, not a symbolic expression. Compute the partial derivatives symbolically first, then plug in the numbers.
In physics, the chain rule through multiple variables appears whenever you track how a quantity changes through a system of interdependent parts. In machine learning, this is the exact computation that backpropagation automates. A deep network with a million parameters computes the loss gradient using the chain rule applied millions of times — the same rule you just used with three variables scales to any depth.
Gradient problem recipe: (1) find all partial derivatives symbolically, (2) evaluate at the given point, (3) assemble into a column vector. For the chain rule extension: multiply each partial by the corresponding derivative of the inner variable with respect to , sum, and simplify. This exact problem type is about 10% of the exam — practice it until it is automatic.
9.4.7 Student Questions and Answers
Q: Do we have to show the final answer in terms of ?
A: Yes. The problem asks how changes with respect to . After substituting , , into the expression, simplify to get a function of only — no , , or left. That is the final answer.
9.4.8 Exam Note
Exam note: This is a representative type of question. You will be given a function of two or three variables and asked to find its gradient at a specific point. About 10% of the exam will involve a gradient problem like this. The chain rule variant — where the variables themselves depend on a parameter — is also possible.
9.5 The Product Rule
9.5.1 Definition
Two things are changing at once, and they are multiplied together. If you differentiate each factor separately and multiply the results, you get garbage. The product rule tells you how two simultaneous rates combine when their values are entangled by multiplication.
Think of a rectangle whose length and width both depend on time . The area is . If you nudge a tiny bit, both the length and the width change. The change in area comes from two contributions: the length change times the original width, plus the original length times the width change. That is the product rule.
For , the derivative is:
The professor's words: "You first derive , keep as it is. Then you derive and keep as it is. Then you add them."
In the multivariate case with partial derivatives, the same structure holds:
When one factor does not depend on , its partial derivative with respect to is zero, and the product rule collapses to a simple constant-multiple rule. The formula still works — it just simplifies.
9.5.2 Symbol Registry
- — first factor function
- — second factor function
- or — derivative of the first factor
- or — derivative of the second factor
9.5.3 Worked Example —
The professor puts on the board and asks for .
Step 1 — Split the function into terms:
Step 2 — Apply product rule to Term 1 with respect to :
Treat as constant. The derivative of with respect to is . The derivative of with respect to is 0 (no in it).
The professor's words: "The very first term is . The derivative of with respect to is . Keep as it is. Then derive with respect to . Since contains no , its derivative is zero."
Step 3 — Differentiate Term 2:
has no , so .
Step 4 — Combine:
Sense-check: The function is . Since is constant with respect to , it vanishes. The product rule applied to gives because the second piece (differentiating the constant factor) goes to zero. The result matches what you would get by treating as a constant multiplier directly. The product rule and the constant-multiple rule agree — as they must.
Scope: The product rule applies to any product of two differentiable functions. For products of three or more factors, apply it pairwise: .
Assumption: Both factors must be differentiable at the point of interest. If one factor has a kink, the product may still be differentiable, but you cannot simply apply the rule across the kink.
What breaks: The product rule is not commutative with respect to which variable you differentiate. If depends on and depends on , then . The second term vanishes because is constant with respect to . This is correct and expected.
Visual intuition. Picture a rectangle on graph paper. The horizontal side stretches as changes, the vertical side as changes. When you nudge by , the area grows by two thin strips: one along the top (width = , height = ) and one along the right side (width = , height = ). The tiny corner piece is negligible. The product rule captures exactly those two strips.
Pitfall 1 — Multiplying derivatives instead of adding. Students who write are completely wrong. The correct rule is the sum of two cross-terms: . The rectangle area argument should make this intuitive — never just multiply.
Pitfall 2 — Applying the product rule for a constant factor when it is unnecessary. For , you can either use the product rule () or just pull out the constant. Both give . But on an exam, pulling out constants saves time.
Pitfall 3 — Forgetting the sum rule together with the product rule. In the example, has a sum. You must differentiate each term separately first, then apply the product rule to the term that is a product. Don't try to apply the product rule to the whole sum.
Pitfall 4 — Applying the product rule when one factor has no dependence on the differentiating variable. It works — the second term just becomes zero. But you should recognize this situation and simplify: for , you can just say . The professor explicitly made this point.
The product rule generalizes to the multivariate case (see T1, Section 5.2.1), where the order of factors matters because matrix multiplication is not commutative. For now, the scalar version covers every exam problem you will face.
The product rule: differentiate the first, keep the second; add the first times the derivative of the second. When one factor does not depend on the variable you are differentiating, the corresponding term vanishes. This rule shows up inside partial derivatives, gradient computations, and Taylor series expansions — it is not a standalone topic but a tool you will reach for in nearly every calculus problem ahead.
9.5.4 Student Questions and Answers
Q: Why do we add the two parts in the product rule? Why not just multiply derivative with ?
A: This is the standard product rule formula. When both and depend on , both pieces contribute to the total rate of change — the area of the rectangle changes from two sides simultaneously. In this specific example, has zero dependence on , so the second piece becomes zero and you get the same answer by simply treating as a constant. But the product rule is the general procedure — learn it, use it, then notice when it simplifies.
Q: This is the same formula from class 12, right?
A: Yes. It is covered in NCERT / CRT class 12 textbooks. The rule: derivative of the first times the second, plus the first times derivative of the second. If you already know it, this section is reinforcement. If you are fuzzy, treat this as your definitive reference.
9.6 The Jacobian — Gradient of a Vector-Valued Function
9.6.1 Motivation
So far, every function you have differentiated returns a single number. But what if one function returns two numbers — say, you feed in a rectangle's dimensions and get back both its area and its perimeter? You need a way to organize how each output responds to each input. A single vector will not do. You need a matrix.
The gradient of a scalar-valued function is a column vector — one component per input variable. The professor's words: "The gradient of a scalar-valued function is a vector. The gradient of a vector-valued function is a matrix." That matrix is the Jacobian.
9.6.2 The Carpet Example
A carpet has length and width . These two inputs determine two outputs: - Area: - Perimeter:
Package both outputs into a single vector-valued function :
The idea: "You want to see how area changes when inputs change. And how perimeter changes when inputs change." There are four questions to answer — (area vs. length), (area vs. width), (perimeter vs. length), (perimeter vs. width). Each answer is a partial derivative. The Jacobian organizes all four into a single matrix.
9.6.3 Computing the Jacobian
For , the Jacobian matrix is:
The entry is the partial derivative of the -th output with respect to the -th input. Row 1 = how area responds to each input. Row 2 = how perimeter responds to each input.
Compute each entry:
So:
The professor's words: "The first column says what is the effect of changing length on area and perimeter. The second column says what is the effect of changing width on area and perimeter."
Interpretation at : - If you increase length by 1 unit, area increases by 5 units and perimeter increases by 2 units. (Column 1) - If you increase width by 1 unit, area increases by 3 units and perimeter increases by 2 units. (Column 2)
9.6.4 Symbol Registry
- — Jacobian matrix — for
- — area function — scalar
- — perimeter function — scalar
- — vector-valued function —
- — input variables — scalars
Notation note: The textbook T1 (Mathematics for Machine Learning) defines the Jacobian with rows as outputs and columns as inputs. This is the "numerator layout". Some books use the transpose: columns for outputs, rows for inputs, the "denominator layout". The professor uses the numerator layout. This is the convention in most ML papers and in PyTorch. Stick with it for consistency.
9.6.5 General Definition
For with:
The Jacobian matrix has rows (one per output component) and columns (one per input variable):
Each entry answers: "How does output respond to a tiny nudge in input ?"
9.6.6 Geometric Intuition
The Jacobian is not just a bookkeeping device. Matrices transform space. At a point, the Jacobian captures how space around that point bends — how the transformation deforms the local grid. On a curved surface, grid lines stretch differently near different points. The Jacobian at each point gives the best linear approximation of that bending at that point. If the original transformation is already linear, the Jacobian is constant everywhere — it is exactly the transformation matrix.
The determinant of the Jacobian tells you how much a tiny volume expands or contracts under the transformation. A determinant of 3 means a small square at the input maps to a region with 3 times the area at the output. In the carpet example, . At , — the transformation expands area by a factor of 4.
9.6.7 Higher Orders — Tensors
The gradient of a scalar (0D output) gives a vector (1D). The gradient of a vector-valued function (1D output per component) gives a matrix (2D). The gradient of a matrix-valued function gives a 3D array — a tensor.
The professor's words: "The gradient of a matrix-valued function is a matrix of matrices. That is the origination of tensors."
This is why deep learning frameworks like PyTorch organize everything around tensors. A scalar is a rank-0 tensor. A vector is rank-1. A matrix is rank-2. When you differentiate an image (a matrix of pixels) with respect to many parameters, the result is a higher-rank tensor. This topic is beyond exam scope but explains why modern ML libraries have the architecture they do.
9.6.8 Exam Notes
Exam note: Jacobian problems are unlikely to appear on the exam. The professor said "I hardly doubt there will be any problem from Jacobian." Focus your exam prep on gradient problems for scalar-valued functions. Understand the Jacobian conceptually — it is the matrix form of the gradient when the output is a vector — but do not spend hours drilling Jacobian computations.
9.6.9 Industry Applications
In PyTorch and TensorFlow, calling `.backward()` on a loss tensor triggers automatic differentiation — the framework computes a chain of Jacobian-vector products through the entire computation graph using the chain rule. This is exactly the Jacobian concept scaled to millions of parameters.
In robotics, the manipulator Jacobian maps joint velocities to end-effector (hand) velocities. If you want the robot hand to move in a specific direction, you invert the Jacobian (or its transpose) to compute the required joint motions. The same math that computes a carpet's area and perimeter derivatives controls a robotic arm on a factory floor.
In 3D graphics and physics simulations, the Jacobian appears in inverse kinematics — given a desired pose for a character's hand, compute the joint angles. The Jacobian is the bridge between the parameter space (joints) and the output space (hand position).
Pitfall 1 — Mixing up rows and columns. In the Jacobian, row corresponds to output , column corresponds to input . Getting the orientation wrong flips the matrix and breaks any downstream computation. Always write a small label next to your Jacobian as a sanity check.
Pitfall 2 — Treating the Jacobian as a gradient. The Jacobian is not "the gradient" in the same sense as for scalar functions. For a scalar output, the Jacobian is a row vector — which is exactly . For multiple outputs, it is a full matrix. The term "gradient" is ambiguous in multivariable calculus; "Jacobian" is precise.
Pitfall 3 — Assuming the Jacobian is square. For , the Jacobian is . It is only square when (same number of inputs and outputs). Non-square Jacobians are common — e.g., a neural network layer mapping has a Jacobian.
Pitfall 4 — Forgetting the chain rule works with Jacobians. If and , then — the Jacobians multiply as matrices. The dimension check: .
The Jacobian generalizes the gradient to functions with multiple outputs. It is an matrix where entry is how output changes with input . Not exam-heavy, but conceptually essential: it is the bridge from scalar calculus to the tensor calculus that powers modern ML.
9.7 Taylor Series — Single Variable
9.7.1 Motivation — How Calculators Work
Your calculator has never seen before. It does not have a lookup table for every real number — that would be infinite. Yet it spits out the answer instantly. How? It builds a polynomial that impersonates the sine function near a known point, then evaluates that polynomial. That is a Taylor series.
The professor's words: "The value of these functions is found using approximations. We feed a few base values to calculators and they compute the rest using Taylor series."
A function like , , , or is not a polynomial — you cannot evaluate it just by adding and multiplying powers of . But if you know the function's value and all its derivatives at one convenient point (like ), you can construct a polynomial that matches the function more and more closely as you add terms. The polynomial is easy to evaluate — just arithmetic. The Taylor series is the infinite version; the Taylor polynomial is the finite approximation you actually use.
9.7.2 The Taylor Series Formula
Given a function and a base point where and all its derivatives are known, the Taylor series expansion around is:
In compact summation notation:
Where is the -th derivative of evaluated at , and is the factorial.
The professor's words: "You start with the value of the function at the known point. Then you add the first derivative times the distance, then the second derivative, and so on."
The Taylor polynomial of degree truncates the series after terms:
When , this is called the Maclaurin series — the special case where you expand around zero.
9.7.3 Symbol Registry
- — the function being approximated
- — the base point (point where you know and its derivatives)
- — the point where you want to approximate
- — first, second, third, -th derivatives evaluated at — scalars
- — factorial of —
- — Taylor polynomial of degree
- — the -th power of the distance from the base point
9.7.4 Interpreting the Terms
Term 1: . The most naive guess for is just — pretend the function is flat. This is the zeroth-order approximation . It is exactly right at and terrible everywhere else.
Term 2: . The linear correction. The slope tells you how fast the function rises at . Multiply by the distance to get the first-order adjustment. is the tangent line — a linear approximation.
Term 3: . The curvature correction. The second derivative captures whether the function bends up (convex) or down (concave). The quadratic term lets the polynomial curve to follow the function's bend.
The professor's words: "The first approximation is linear — a simple line. The second adds curvature. All higher-order derivatives are telling you more about how the function curves around that point."
Higher terms refine the curvature further. With each additional term, the polynomial matches another derivative at :
- : matches → constant
- : also matches → straight line
- : also matches → parabola
- : also matches → cubic
With just four non-zero terms, you can approximate around accurately over the entire interval .
Visual intuition. Plot (the wavy curve) on axes: horizontal from to , vertical from to . Now overlay the Taylor polynomials:
- : a straight diagonal line. Matches only near . By , it is visibly off.
- : a cubic that bends down after the peak. Hugs much longer — stays close through .
- : bends up again. Nearly indistinguishable from out to .
Each additional term extends the range of good agreement. The infinite series, if it converges, equals the function exactly.
9.7.5 Worked Example — Expansion
Expand as a Maclaurin series (base point ).
Step 1 — Compute derivatives of at :
The pattern repeats every four derivatives:
Step 2 — Plug into the Taylor formula:
Every odd-powered term has coefficient zero (because odd derivatives of at 0 are zero). Only even powers survive:
Step 3 — Quick numerical check at :
Using three terms: .
The actual . The error is about — less than 0.3%. With just three terms. The professor's words: "This is the expansion of . If you feed , you get an approximation. With three terms: gives roughly . The actual is about . Very close."
Sense-check: is an even function — . The series contains only even powers, which is exactly what you would expect. If any odd power had survived, the expansion would be wrong.
9.7.6 Approximating
Find using the first three non-zero terms.
The true value of is approximately . The approximation using only three terms is accurate to four decimal places.
Sense-check: should be close to 1 (since ) but slightly less. makes sense — the function is starting to drop from its peak.
9.7.7 Visualization Insight
The professor showed an animation of Taylor polynomials building up for around :
- First term (): a diagonal line. Matches only near zero — visibly wrong by .
- Second term (): a cubic that bends downward. Hugs past its first hump — good through .
- Third term (): bends back up to match the second oscillation. Covers well.
- Fourth term: nearly indistinguishable from over .
The takeaway: each derivative you include adds a new layer of curvature, extending the range over which the polynomial is a good surrogate for the original function. The visual makes it obvious why higher-order terms matter — and why truncating after two terms can be disastrous far from the base point.
9.7.8 Exam Note — Up to Degree Three
Exam note: When an exam says "find the Taylor polynomial up to degree three," include terms through — that is, terms for . The result:
The professor's words: "Up to degree three means you compute the third derivative."
If the question says "expand around ," then . Evaluate all derivatives at and write the polynomial in powers of . Leave as a variable — do NOT plug in a number for unless the question asks for the value at a specific point.
9.7.9 Student Questions and Answers
Q: In the Taylor series formula, do we replace with the target value in all places?
A: No. Replace with the base point in all derivatives — evaluate , etc. at . Leave as a variable. The expression becomes a polynomial in . Only when the question says "approximate " do you plug that number into the final polynomial. Many students mix this up — the derivatives are evaluated at , NOT at .
Q: In a problem where and they say "expand around point 1," do we just leave the expression as-is?
A: Yes. Evaluate all derivatives at — so . Write the polynomial in powers of : you will have terms like , , . Leave as a variable. Do not plug in any specific number for . That is the expansion.
Q: There is a practice problem with . In the solution, was not replaced with 1 everywhere. Is that correct?
A: The professor acknowledged an issue with that particular posted solution and said he will work through the correct solution in the next class. Do not rely on the posted solution for that specific problem. Wait for the corrected version.
9.7.10 Connection to Maxima and Minima
The Taylor series directly explains the second derivative test. At a critical point where , the Taylor expansion simplifies because the linear term vanishes:
Near , the term dominates. The sign of decides everything:
- If : for all , so — you are at a local minimum.
- If : for all , so — you are at a local maximum.
- If : the quadratic term vanishes too, and you need higher derivatives to decide. The test is inconclusive.
The professor's words: "The first derivative tells you the slope. The second derivative tells you the curvature — whether the function curves up or down." This is the geometric reason behind the rule: positive curvature means the graph cups upward, making a minimum; negative curvature means it arches downward, making a maximum.
9.7.11 Exam Notes
Exam note: Taylor series questions are almost certain. The professor's guarantee: "Taylor series is definite. You will get a two-variable expansion." For single variable, expand up to degree two or three. Know the formula, compute derivatives carefully, evaluate at the base point, and write the polynomial in .
Exam note: A past midterm exam question: "Find the Taylor polynomial of degree 3 of around ." This type is representative — expect a non-polynomial function expanded around a non-zero base point.
Scope: The Taylor series is an infinite sum. In practice, you always truncate it. The remainder is the error from truncation. Its bounds come from Taylor's theorem. The exam will not ask you to compute those bounds. It will only ask for the polynomial up to a specified degree.
Assumptions: The function must be infinitely differentiable at the base point for the full series to exist. For the Taylor polynomial of degree , you need derivatives up to order . Functions with discontinuities or non-differentiable points (like at ) do not have Taylor expansions around those points.
What breaks: The Taylor series may not converge to the function even if all derivatives exist. The classic counterexample is (with ) — all derivatives at 0 are zero, so the Taylor series is identically zero, but the function itself is positive for . For the functions you will encounter on the exam (), the series converges to the function within its radius of convergence.
Visual intuition (convergence radius). Imagine the Taylor series as a bridge extending outward from the base point . The bridge is solid and accurate within its radius of convergence. For , the bridge extends infinitely in both directions. For expanded around , the bridge collapses at — the series diverges. For around , the bridge holds for but crumbles at . On the exam, you are always evaluating inside the radius of convergence, so do not worry about divergence — but know that the concept exists.
Pitfall 1 — Evaluating derivatives at instead of . The formula has , not . You plug the base point into every derivative. is a number, not a function. This is the single most common exam mistake.
Pitfall 2 — Forgetting the factorial in the denominator. The -th term has in the denominator. It is not — it is . Without the factorial, the series diverges.
Pitfall 3 — Plugging in before writing the polynomial. If the question says "expand around ," you write the polynomial in . Do not replace with 1 — that would give you a single number, not an expansion.
Pitfall 4 — Miscounting the degree for zero derivatives. If but , the degree-1 term vanishes. The polynomial is degree 2 even though you called it "up to degree 3." That is fine — just include all terms through , and zero terms naturally drop out.
Pitfall 5 — Miscomputing higher derivatives. For , the derivatives cycle: . One sign error in the third derivative poisons the whole expansion. Write the derivative pattern explicitly before plugging in numbers.
The Taylor series is the mathematical bridge between local derivative information and global function behavior. It is how numerical libraries compute , , , and to machine precision. It is how the Extended Kalman Filter linearizes nonlinear dynamics for spacecraft navigation. It underpins the Laplace approximation in Bayesian statistics and the quadratic approximation used in Newton's method for optimization. Whenever you see "locally linearize" in an algorithm, a Taylor series — at least to first order — is doing the work.
The Taylor series builds a polynomial that matches a function at a base point — matching the value, then the slope, then the curvature, and so on. The formula: derivatives at , factorial denominators, powers of . For the exam: know the , , and expansions cold, compute derivatives carefully at the given base point, and do not plug in until asked. This is the most heavily tested topic in the calculus block.
9.8 Maxima, Minima, and Saddle Points
9.8.1 Symbol Registry
- — first and second derivatives — scalars
- — gradient vector —
- — Hessian matrix — , matrix of second-order partial derivatives
- — mixed second-order partial derivative — scalar
9.8.2 Critical Points — Where the Gradient Vanishes
You have been walking downhill in the fog, following the negative gradient. Suddenly the ground under your feet is perfectly flat — no slope in any direction. You stop. Have you reached the lowest valley? Or are you standing on a mountain pass — a saddle — where one trail goes up and another goes down?
A critical point is any point where the gradient is zero — meaning all partial derivatives vanish. The professor's words: "The slope is zero exactly at the minimum or maximum points. Where the slope is zero, you are either at a maximum or a minimum."
For a function of one variable, critical points solve . For multiple variables, they solve — a system of equations (one per partial derivative). Finding critical points is step one. Classifying them — telling a peak from a valley from a saddle — is step two, and that requires second derivatives.
A point is a critical point of if:
equivalently:
Critical points are candidates for local maxima, local minima, or saddle points. The gradient says "stop here" — the Hessian (or second derivative) says what you have found.
9.8.3 The Second Derivative Test (Single Variable)
For a single-variable function, the classification is simple. After solving :
- : The function curves upward. You are in a bowl — a local minimum. The professor: "If the derivative of the slope is positive, you are going upward. That point must be a minimum."
- : The function curves downward. You are at a peak — a local maximum.
- : The test is inconclusive. The point could be an inflection point (like at , where it flattens but keeps going), or it could still be an extremum (like at ). You need higher-order derivatives to decide.
The reasoning from Section 9.7.10 applies directly: at a critical point, the Taylor expansion is . The quadratic term's sign alone determines whether (minimum) or (maximum).
Visual intuition. Draw the three cases: - at : , . The parabola smiles — you are at the bottom of a bowl. Minimum. - at : , . The parabola frowns — you are at a peak. Maximum. - at : , . The curve flattens momentarily but continues rising — neither max nor min. Inflection point.
9.8.4 Saddle Points
In two or more dimensions, a new possibility emerges. The function might go up in one direction and down in another. The professor's words: "In one direction the function increases. In another direction it decreases. So that point is called a saddle point."
A saddle point is a critical point () that is neither a local maximum nor a local minimum. The function increases along some directions through the point and decreases along others.
The classic shape is a hyperbolic paraboloid — the Pringle shape. From the side, one cross-section is a U (going up). The orthogonal cross-section is an inverted U (going down). At the center, everything is flat (), but moving in one direction takes you up and moving in the orthogonal direction takes you down.
Visual intuition. Imagine a mountain pass between two peaks. Standing at the pass, one trail goes downhill into the valley ahead, another goes uphill behind you, and the trails to your left and right both go up toward the peaks. The pass is a saddle point — the lowest point along the ridge between peaks, but the highest point along the trail through the pass. A saddle point is simultaneously a minimum along one slice and a maximum along another.
In machine learning, saddle points are a serious problem. High-dimensional loss surfaces are littered with them. A naive gradient descent can get stuck near a saddle point — the gradient is near zero, so steps are tiny, but you are not at a minimum. Modern optimizers like Adam include momentum to roll through saddles.
9.8.5 Connection to the Hessian
For multiple variables, the Hessian matrix collects all second-order partial derivatives:
The professor's words: "The Hessian is a matrix of double derivatives. It tells you whether the function is at a max or min."
For a twice continuously differentiable function, Clairaut's theorem guarantees the Hessian is symmetric: .
How the Hessian classifies critical points:
- If the Hessian is positive definite (all eigenvalues positive): the function curves upward in every direction — local minimum.
- If the Hessian is negative definite (all eigenvalues negative): the function curves downward in every direction — local maximum.
- If the Hessian has both positive and negative eigenvalues: the function curves up in some directions and down in others — saddle point.
- If the Hessian is indefinite or has a zero eigenvalue: the test is inconclusive.
This is the multivariable generalization of the single-variable second derivative test. The positive/negative definiteness of plays the role of or .
Quick two-variable example. Consider .
The critical point is . The Hessian:
Eigenvalues: (up along ), (down along ). This is a saddle point — the classic Pringle-shaped surface. At , . Move along the -axis: for (you go up). Move along the -axis: for (you go down). Both partials are zero. Both second derivatives are non-zero with opposite signs. Textbook saddle.
Scope: The second derivative test (and its multivariable Hessian generalization) classifies local extrema only. A local minimum might not be the global minimum of a function with multiple valleys. Gradient descent stops at whatever local minimum it lands in.
Assumptions: The Hessian test assumes the function is twice continuously differentiable. The symmetry holds for functions. If mixed partials are not equal, the Hessian is not symmetric and the eigenvalue test does not apply.
What breaks with a zero eigenvalue: If the Hessian has a zero eigenvalue, the second-order information is insufficient. You need third or higher derivatives (or a direct inspection) to classify the point. This is analogous to in the single-variable case.
Visual intuition for the Hessian. For at , the Hessian is — both eigenvalues are 2. The surface is a bowl opening upward in every direction. For at , the Hessian is — a bowl opening downward. Both eigenvalues negative, so: maximum. For the saddle point , the mixed-sign eigenvalues tell you the curvature is different in different directions — the defining feature of a saddle.
Pitfall 1 — Forgetting to find the critical point first. You cannot classify a point without verifying there. Students sometimes compute the Hessian and check its eigenvalues at an arbitrary point. That tells you the curvature there, but not whether it is an extremum.
Pitfall 2 — Assuming means saddle point. In one variable, means the test is inconclusive, not that the point is a saddle. For , , , but is a minimum. For , it is an inflection point. You cannot tell without checking or beyond.
Pitfall 3 — Confusing the Hessian with the gradient. The gradient is the vector of first partials. The Hessian is the matrix of second partials. The gradient tells you where to move; the Hessian tells you the shape of the surface you are standing on.
Pitfall 4 — Computing mixed partials incorrectly. For , , then . Compute , then . They must match. If they do not, you made a mistake.
In machine learning, the Hessian appears in second-order optimization methods like Newton's method, which uses to take curvature-aware steps. In computational chemistry, the Hessian of the energy function determines vibrational frequencies — positive eigenvalues correspond to stable bonds, negative eigenvalues signal transition states. In economics, the Hessian of a profit function classifies whether a firm is at a profit maximum or a saddle.
Critical points solve . The Hessian matrix — the collection of all second-order partials — classifies them: positive definite = minimum, negative definite = maximum, mixed eigenvalues = saddle point, zero eigenvalue = inconclusive. This is the multivariable extension of the second derivative test. The Hessian and the Taylor series are the two highest-weight exam topics — expect to compute and classify.
9.8.6 Exam Notes
Exam note: The Hessian matrix is the second most important topic after Taylor series. A past exam question asked: "Find the Hessian matrix of a function." Questions combine gradient computation (find critical points) with Hessian-based classification. Know how to compute second-order partial derivatives, assemble them into the Hessian, and use eigenvalues or the determinant/trace test for matrices to classify.
Exam Guidance Summary
- The mid-semester exam covers material through Lecture 8. Topics from Lectures 6, 7, and 8 form the calculus block.
- Gradient problems are very likely — about 10% of the exam. Expect to compute the gradient of a scalar-valued function at a specific point.
- Taylor series is almost certain. The professor gave a guarantee: "Taylor series is definite. You will get a two-variable expansion." For single-variable, expand up to degree two or three. Know the formula and how to compute derivatives at the base point.
- Hessian matrix questions are the second most important after Taylor series. Expect to compute second-order partial derivatives, assemble them into a Hessian, and classify critical points.
- The calculus block is the most scoring segment. Past students score higher on calculus than on linear algebra.
- Previous exam questions included: Taylor polynomial of degree 3 of around , and find the Hessian matrix of a given function.
- Memorize the four basic derivative identities: power rule , , , . These are chained inside every partial-derivative and Taylor-series calculation.
- Gradient problem recipe: find all partial derivatives symbolically, evaluate at the given point, assemble into a column vector. The chain rule variant (with ) is also possible.
- Taylor series recipe: evaluate all derivatives at the base point , then write the polynomial in powers of . Do NOT plug in unless the question explicitly asks for the value at a specific point.
- Practice problem set is available on Microsoft Teams. The professor said: "If you solve this practice set, you are good enough for the exam."
- Lecture 8 (linearization, backpropagation) has redundant content relative to Lectures 6 and 7. Do not invest heavy exam-prep time in Lecture 8.
- Next class: two-variable Taylor series, Hessian matrix problems, linearization, and backpropagation.
Key Industry Applications
- PyTorch and TensorFlow — All computation is built on tensors. Automatic differentiation (autograd) computes Jacobian-vector products through the computation graph using the chain rule. This is the same math from Sections 9.4 and 9.6, scaled to millions of parameters. The tensor hierarchy mirrors the derivative hierarchy. A scalar's gradient is a vector. A vector's gradient is a matrix, the Jacobian. A matrix's gradient is a tensor.
- Gradient Descent — The core training algorithm for neural networks. Computing the gradient of the loss with respect to every parameter and taking a downhill step (Section 9.3) is the mathematical engine behind every deep learning model from image classifiers to large language models. Modern variants like Adam, RMSprop, and SGD with momentum all start from the simple update rule .
- Linear Regression / MSE Minimization — Minimizing mean squared error via gradient descent is the simplest complete ML pipeline. Tuning and to minimize (Section 9.3.5) demonstrates how derivatives directly optimize models. This same pattern scales to models with billions of parameters.
- Taylor Series in Numerical Computation — Calculators, numerical libraries, and compilers use Taylor expansions to compute , , , and from known base values. The CORDIC algorithm in older hardware and modern polynomial approximations both rely on the Taylor idea. In physics simulations, Taylor expansions linearize nonlinear dynamics for efficient computation.
- Geogebra — A free visualization tool for exploring 3D surfaces, gradient vectors, level curves, and transformations. Useful for building geometric intuition about partial derivatives, gradient descent paths, and saddle points.
- Robotics and Inverse Kinematics — The manipulator Jacobian maps joint velocities to end-effector (hand) velocities. Given a desired hand trajectory, you solve for the joint motions using the Jacobian — the same matrix structure introduced in Section 9.6.
- Computational Chemistry — The Hessian of a molecular energy function determines vibrational frequencies. Positive eigenvalues = stable bonds; negative eigenvalues = transition states. This is the saddle point concept from Section 9.8 applied directly to chemistry.
- Economics and Finance — Partial derivatives of cost/profit functions guide optimal pricing and production decisions. The Hessian classifies whether a firm is at a profit maximum or stuck at a saddle point.
MFML Lecture 09 notes · Gradients, the Jacobian, and Taylor Series
Sections Breakdown
The derivative as instantaneous rate of change, the four exam-critical identities, and how to read it on a plot.
Rate of change with respect to one variable while holding others constant, with a fully worked inverted-bowl example.
The gradient as the vector of partials, its geometric meaning, and gradient descent for minimizing a loss.
A full exam-style gradient computation, an orthogonality check, and a chain-rule extension through a parameter.
Differentiating a product of functions, including the multivariable partial-derivative form.
The matrix of all output-input partial derivatives, its layout convention, and geometric meaning.
Building a polynomial approximation from derivatives at a base point, with cosine and calculator examples.
Critical points from a vanishing gradient and classification using the Hessian matrix.
The professor's exam strategy for the calculus block: gradient, Taylor series, and Hessian questions.
Where these tools appear in practice: autodiff, gradient descent, linear regression, robotics, and chemistry.
Exam Revision Notes
Below is the distilled, exam-ready core of this lecture. Every entry is built from the full textbook notes above. Use this section for rapid review — but if something doesn't make sense, go back to the full explanation in the main content.
Single-Variable Derivatives
Must-know: The derivative is the instantaneous rate of change — the slope of the tangent line. You must know the four identities by heart: power rule , , , and .
⚠️ Top pitfall: Confusing the derivative with the function value . The derivative tells you the steepness at a point; the function tells you the height. They are different numbers.
Self-check: For , what is and what does it tell you about the curve at that point?
Connects to: Partial derivatives, the gradient, and Taylor series — every later tool chains these four identities.
Partial Derivatives
Must-know: A partial derivative measures change with respect to one input while freezing the rest. Compute it exactly like an ordinary derivative — treat every other variable as a constant. The collection of all partials forms the gradient.
⚠️ Top pitfall: Forgetting to hold other variables constant, or using instead of . Use the curly for multivariable functions. For , and .
Self-check: For , why is a different function from ?
Connects to: The Jacobian (one partial per output-input pair) and the gradient (all partials assembled).
The Gradient
Must-know: The gradient is the column vector of all first partial derivatives. It points in the direction of steepest increase. To minimize a loss, move opposite: gradient descent uses .
⚠️ Top pitfall: Forgetting the negative sign in gradient descent. The gradient points uphill; minimizing requires going downhill, so you move against it. A positive keeps the step small.
Self-check: At the point on , which way does point and why is that the peak direction?
Connects to: The worked gradient problem, the Jacobian, and the Hessian (the matrix of its second derivatives).
Worked Gradient Problem and the Chain Rule
Must-know: Recipe: find all partials symbolically, evaluate at the given point, assemble into a column vector. For the chain rule, multiply each partial by the derivative of the inner variable with respect to the parameter, then sum.
⚠️ Top pitfall: Leaving the chain-rule answer in terms of instead of substituting back to only. Two vectors are orthogonal only when their dot product is exactly zero — here , so not orthogonal.
Self-check: For at , what is and is it orthogonal to ?
Connects to: The gradient (the building block) and the Jacobian (where chain-rule terms become matrix products).
The Product Rule
Must-know: Differentiate the first factor and keep the second; add the first factor times the derivative of the second. When a factor has no dependence on the variable, its term vanishes.
⚠️ Top pitfall: Writing — that is wrong. The correct rule is the sum of two cross-terms. For , treat as a constant and get .
Self-check: Why does equal even though the product rule applies?
Connects to: Partial derivatives and the gradient — the product rule appears inside every derivative of a product.
The Jacobian
Must-know: The Jacobian generalizes the gradient to vector-valued functions. It is an matrix where entry is how output changes with input . For a scalar output it equals .
⚠️ Top pitfall: Mixing up rows and columns. Row is output ; column is input . The Jacobian is square only when the number of inputs equals the number of outputs. The professor said Jacobian problems are unlikely on the exam — focus on gradients.
Self-check: For , what is at ?
Connects to: The gradient (its scalar-output special case) and chain-rule matrix multiplication in backpropagation.
Taylor Series
Must-know: The Taylor series builds a polynomial that matches a function at a base point : value, then slope, then curvature, and so on. Evaluate every derivative at ; leave as a variable unless asked for a number.
⚠️ Top pitfall: Evaluating derivatives at instead of . The formula uses , a number. The professor guarantees a Taylor question appears; know the , , and expansions cold and expand up to degree two or three.
Self-check: For expanded around , why do all odd-powered terms vanish?
Connects to: Maxima and minima (the second-derivative test is the quadratic Taylor term) and the Hessian.
Maxima, Minima, and Saddle Points
Must-know: Critical points solve . The Hessian — the matrix of second-order partials — classifies them: positive definite means a minimum, negative definite a maximum, mixed-sign eigenvalues a saddle point.
⚠️ Top pitfall: Assuming means a saddle point. It only means the test is inconclusive — has a minimum there, has an inflection. The Hessian is the second most important exam topic after Taylor series; know how to compute and classify it.
Self-check: For , what is the critical point and what kind is it?
Connects to: The Taylor series (the quadratic term decides extrema) and the gradient (which vanishes at critical points).
Was this lecture useful?
BitsNotes AI Assistant
Subject Notes AssistantConfigure AI Chat
Choose how to access the chatbotSigned in as
Powered by BitsNotes — 20 messages per day. No API key needed. Want unlimited access? Use "Bring Your Own Key" mode.
Sign in to use AI Chat
Get 20 free AI messages per day to ask questions about your lecture notes. Sign in with Google or GitHub — it takes 5 seconds.
Sign In to BitsNotesSwitch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.