1.2.2 · D4Calculus & Optimization Basics

Exercises — Derivatives and rules (product, quotient, chain)

1,890 words9 min readBack to topic

Reminders you will lean on (all built in the parent note):

Two derivatives we will reuse (each is itself a chain-rule fact you can re-derive):


Level 1 — Recognition

Goal: name the rule and apply it once, no nesting deeper than one layer.

Problem 1.1

Differentiate .

Recall Solution 1.1

What is this? A product of two things I can each differentiate. So: product rule. Let , and . Why the minus? It is not the product rule flipping — it comes from . Keep the two effects separate.

Problem 1.2

Differentiate .

Recall Solution 1.2

What is this? A quotient. Use "Lo D-Hi minus Hi D-Lo over Lo-Lo." Top ; bottom .

Problem 1.3

Differentiate .

Recall Solution 1.3

What is this? A shell wrapped around an inside . That is a chain. Outer ; inner .


Level 2 — Application

Goal: turn the crank cleanly, including one nested chain.

Problem 2.1

Differentiate .

Recall Solution 2.1

Product, with the second factor needing a small chain. . For : outer (derivative ), inner (derivative ), so . Why factor out ? It never vanishes, so pulling it out shows the zeros cleanly ( and ).

Problem 2.2

Differentiate .

Recall Solution 2.2

Chain. Outer has derivative ; inner has derivative . Why not alone? That would pretend the inside is frozen. The is how fast the inside moves — the gear ratio.

Problem 2.3

Differentiate and evaluate .

Recall Solution 2.3

Quotient. ; . At : . Nice bonus: the numerator is , so is never decreasing — flat only at .


Level 3 — Analysis

Goal: read meaning — slopes, maxima, monotonicity — off the derivative.

Problem 3.1

For , find all where the tangent line is horizontal, and classify each as a peak or valley.

Figure — Derivatives and rules (product, quotient, chain)
Recall Solution 3.1

Horizontal tangent means ==slope ==, i.e. . Quotient rule: ; . The denominator is always positive, so exactly when the numerator . Classify by sign of (look at the figure): the numerator is a downward parabola — positive between and , negative outside.

  • At : slope goes (falling then rising) → valley (minimum). Value .
  • At : slope goes (rising then falling) → peak (maximum). Value .

Problem 3.2

Show that is strictly increasing everywhere, and find where its slope is largest.

Recall Solution 3.2

From the parent note, . Since for every real (it is a probability-like squash), both factors are positive ⇒ everywhere ⇒ strictly increasing. Where is the slope largest? is a downward parabola in the variable , peaking at . And when . Maximum slope at . Why ML cares: this cap is the seed of the vanishing gradient problem — see Activation Functions and Backpropagation.


Level 4 — Synthesis

Goal: all three rules braided into one expression.

Problem 4.1

Differentiate .

Recall Solution 4.1

Product on the outside (, ); the needs a chain. . .

Problem 4.2

Differentiate .

Recall Solution 4.2

Quotient outside; the top needs a chain. . . Simplify the bracket: . Why factor before simplifying? Pulling out turns a scary difference into a tidy product — and reveals the zeros at .

Problem 4.3

Differentiate two ways and check they agree.

Recall Solution 4.3

Way A — chain on the outer square. Let . Then . Inner product: . Way B — expand first. . Product rule: , . Same answer . ✓


Level 5 — Mastery

Goal: use derivatives the way ML actually uses them — composed layers, gradients, and optimization.

Problem 5.1 (Backprop by hand)

A tiny network computes for fixed input and target , where is the sigmoid. Find at .

Recall Solution 5.1

This is a 3-gear chain: . Multiply the gear ratios. Evaluate at , , :

  • , so .
  • .
  • .
  • . Meaning for training: the gradient is positive, so Gradient Descent would decrease to shrink the loss. Each factor is one layer's Backpropagation message. See also Gradient and Partial Derivatives.

Problem 5.2 (Product-of-many pattern)

Let of three factors: . Show that (the "log-derivative" trick), then compute .

Recall Solution 5.2

Why this identity? Repeatedly applying the product rule to a product of factors gives a sum where each term differentiates one factor and leaves the rest. Dividing by turns each term into . Concretely, with (each derivative ): Divide by : . ✓ Now and . Sanity by expansion: . ✓

Problem 5.3 (One optimization step)

The loss is minimized by gradient descent with learning rate , starting at . Compute (one update). Where is the true minimum, and is the step moving toward it?

Recall Solution 5.3

Gradient: . At : . Update rule (from Gradient Descent): step against the gradient. True minimum: . Since we moved from to , we stepped toward . ✓ Why negative gradient? The derivative points uphill (direction of steepest increase); subtracting it walks downhill toward smaller loss.


6. Score yourself

Recall Rubric
  • Got L1–L2 (5 problems): you can apply each rule. Solid foundation.
  • Add L3 (2 problems): you can interpret derivatives — you're ready for optimization.
  • Add L4 (3 problems): you can handle any algebraic mess.
  • Add L5 (3 problems): you can do backprop and a descent step by hand — genuine ML mastery.
Recall Quick self-quiz

Slope of ::: Where is maximal ::: at , value Max slope of sigmoid and where ::: , at One GD step for , , ::: for :::

Connections