1.2.7 · D4Calculus & Optimization Basics

Exercises — Taylor series approximation

2,147 words10 min readBack to topic

Before we start, one reminder of the only formula the whole page depends on:


Level 1 — Recognition

These just ask you to spot and read off the pieces. No heavy algebra.

L1.1

The Maclaurin series of a function starts . What is the value of the coefficient (the number multiplying ), and what does tell you about ?

Recall Solution

WHAT: Read off the term: its coefficient is , so . WHY: Every Taylor coefficient obeys . Here and , so . Setting gives . Answer: , and .

L1.2

Which of these is a Maclaurin series (as opposed to a general Taylor series)? (a) expansion of around (b) expansion of around (c) expansion of around .

Recall Solution

A Maclaurin series is defined as a Taylor series with anchor point . Only (b) has . Answer: (b). (a) is anchored at ; (c) at — both are Taylor but not Maclaurin.

L1.3

For , write , , and .

Recall Solution

. . . Answer: . (These are the "value, velocity, vroom" of at zero.)


Level 2 — Application

Now you build the polynomials using the recipe.

L2.1

Find the 2nd-order Taylor polynomial of around .

Recall Solution

Step 1 — value. . Step 2 — slope. , so . Step 3 — curvature. , so . Assemble using : Check: at , , and — excellent.

L2.2

Use the Maclaurin series of to approximate with terms up to .

Recall Solution

At : . Answer: . True value , so we're off by about .

L2.3

Find the 3rd-order Maclaurin polynomial of and use it to estimate .

Recall Solution

From the parent note, , so . At : . Answer: . True — accurate to 5 decimals.


Level 3 — Analysis

Here you reason about why and how well.

L3.1

The geometric series converges only for . Compute the partial sum at and at , and explain what the two results reveal.

Recall Solution

At : . The true value . The partial sum is climbing toward — adding more terms keeps improving it. At : , while the true value . The partial sum is running away to , nowhere near . What it reveals: convergence is local. Inside the radius the series homes in on the function; outside it, the terms grow and the sum diverges even though the function itself is perfectly finite. See Approximation error and Big-O.

L3.2

Look at Figure s01. For near , why does the order-2 curve hug the true function over a wider interval than the order-1 line?

Figure — Taylor series approximation
Recall Solution

WHAT the figure shows: the black curve is ; the coral line is ; the mint curve is . WHY is better: Taylor's remainder says the leftover error of an order- polynomial shrinks like . For () the error scales like ; for () it scales like . When , a cube is much smaller than a square, so 's error is dramatically smaller. WHAT IT LOOKS LIKE: the coral line peels away from the curve as soon as bends; the mint curve, having matched the curvature too, follows the bend and stays glued far longer.

L3.3

Show that the even-order derivatives of at are all zero, and explain why this forces the Maclaurin series of to contain only odd powers.

Recall Solution

The derivatives cycle every 4 steps: At : , , , , then repeat. So the even-order derivatives () are (all the ones), and the odd-order derivatives are Since the coefficient , every even is — those terms vanish — leaving only odd powers This mirrors the fact that is an odd function (): only odd powers respect that symmetry.


Level 4 — Synthesis

Combine Taylor with the multivariable / optimization picture.

L4.1

Let (a 1-D loss). Write its exact 2nd-order Taylor expansion around in terms of a step , then find the step that Newton's method would take. Confirm it lands exactly at the minimum.

Recall Solution

, , . At : , , . Expansion (which is exact here because is already degree 2, so all higher derivatives are 0): Newton step . New point: , and is the true minimum. Newton reaches it in one step because a quadratic is its own 2nd-order Taylor model — the model has no error to correct. See Newton's Method.

L4.2

For the same at , a gradient descent step is . Take learning rate and compute the new . Why does gradient descent not reach the minimum in one step, unlike Newton?

Recall Solution

, so new . Why not the minimum: gradient descent uses only the 1st-order Taylor picture, . This straight-line model has no bottom of its own — it just says "downhill is negative " — so we must guess a step size and creep. Newton adds the curvature term, which does have a bottom, and jumps straight to it. See Gradient Descent.

L4.3

Consider at the point . Its Hessian is . Write the 2nd-order Taylor form and evaluate it for the step . Compare to the exact value.

Recall Solution

Gradient: , so at , . Value: . Terms with :

  • Gradient term: .
  • Curvature term: . Taylor estimate: . Exact: . They match exactly — again because is quadratic, so the 2nd-order Taylor model is perfect (no cubic-and-up terms exist). The Hessian matrix carries all the curvature.

Level 5 — Mastery

Deepest cases: degenerate behaviour, error bounds, and the limits of Taylor's promise.

L5.1

The infamous counterexample (with ) has every derivative equal to at . Its Maclaurin series is therefore the zero series . Compute the true and compare it to what the Maclaurin series predicts there. What does this prove?

Recall Solution

Maclaurin series predicts (every term is zero). True value: . What it proves: a function can be perfectly smooth (infinitely differentiable) yet its Taylor series fails to equal it at any nonzero point. Matching all derivatives at one spot does not guarantee reconstruction. This is the sharpest warning that Taylor is a local, conditional tool — echoing the parent note's first mistake callout.

L5.2

Use the Lagrange remainder to bound the error when approximating by (from L2.2). Here , , , and . Give a rigorous upper bound.

Recall Solution

, so with . Since increases, the largest possible value is , but a safe simple bound is (since ). Bound: . Check against reality: the actual error from L2.2 was , which indeed sits under our bound . ✓ The bound is honest and not violated.

L5.3

A function is convex on an interval when its graph never dips below any of its tangent lines. Using the 1st-order Taylor picture plus the remainder, explain why everywhere guarantees convexity.

Recall Solution

Write the exact order-1 Taylor with remainder: The tangent-line part is exactly the straight line touching at . The remainder has always. If everywhere, then . Therefore for every — the graph never falls below any tangent. That is precisely the definition of convexity. See Convex functions. The Hessian being positive semi-definite () is the multivariable version of "".


Recall One-line self-test after finishing

If you can (a) build for any at any , (b) explain why the error scales like , (c) derive Newton's step from a 2nd-order expansion, and (d) name why breaks the "series = function" myth — you've mastered this node. Return to Taylor series approximation to see the map.

Connections

  • Derivatives and gradients — every coefficient is a derivative.
  • Gradient Descent — L4.2 is the 1st-order truncation in action.
  • Newton's Method — L4.1 shows the 2nd-order one-step jump.
  • Hessian matrix — the curvature in L4.3.
  • Convex functions — L5.3 links to convexity.
  • Approximation error and Big-O — L3.1 and L5.2 are the remainder in practice.