We want a polynomial P(x)=c0+c1(x−a)+c2(x−a)2+… that agrees with f as closely as possible at x=a.
Step 1 — Match the value.
Set x=a: every term with (x−a) vanishes, so P(a)=c0. We want P(a)=f(a), so c0=f(a).
Why this step? The constant term controls the height at a; nothing else touches it.
Step 2 — Match the slope.
Differentiate: P′(x)=c1+2c2(x−a)+3c3(x−a)2+…. Set x=a: P′(a)=c1. We want P′(a)=f′(a), so c1=f′(a).
Why this step? Matching slope makes the line touch f tangentially, not just cross it.
Step 3 — Match the curvature.
Differentiate again: P′′(x)=2c2+6c3(x−a)+…. Set x=a: P′′(a)=2c2, so c2=2f′′(a).
Why this step? The factor 2 appears because (x−a)2 differentiated twice gives 2. This is the seed of the factorial.
Step 4 — See the pattern.
Differentiate n times: the term cn(x−a)n becomes n!cn at x=a (all lower terms die, all higher terms still have (x−a)). So
f(n)(a)=n!cn⇒cn=n!f(n)(a).Why this step? The n! is not magic — it's exactly the number that xn spits out when differentiated n times. Dividing by it "undoes" that factor.
Plugging back gives the definition. We derived it by simply demanding all derivatives match.
n!f(n)(a) — the n-th derivative at a divided by n!.
Why is there a factorial in the denominator?
Differentiating (x−a)n exactly n times yields n!; dividing by it cancels that factor so derivatives match.
What is a Maclaurin series?
A Taylor series expanded around a=0.
Give the Maclaurin series of ex.
1+x+2!x2+3!x3+…
How does the truncation error scale near a?
Like (x−a)k+1 for an order-k polynomial (Lagrange remainder).
Which Taylor order corresponds to gradient descent?
First order: L(θ0+Δ)≈L(θ0)+∇L⊤Δ.
Which order corresponds to Newton's method?
Second order, giving step Δ=−H−1∇L.
Does a Taylor series always equal its function?
No — only within its radius of convergence, and some smooth functions (e.g. e−1/x2) aren't equal to their series at all.
Multivariable 2nd-order Taylor form?
f(x0+Δ)≈f(x0)+∇f⊤Δ+21Δ⊤HΔ.
Recall Explain to a 12-year-old (Feynman)
Imagine you know exactly where a toy car is, how fast it's going, and how fast it's speeding up — all at one moment. From just those three facts you can guess pretty well where it'll be a split-second later. Taylor series does this for any curve: it uses the height, slope, bend, twist... at one spot to draw a copy of the curve nearby. The more facts (derivatives) you use, the better the copy — but only for spots close to where you started. Far away, your guess falls apart.
Dekho, Taylor series ka core idea simple hai: koi bhi complicated function agar tum ek point ke paas dekho, to woh ek polynomial jaisa behave karta hai. Us point par function ki height (value), slope (pehla derivative), curvature (doosra derivative) — bas yeh saari cheezein match kar lo, aur tumne function ki ek local copy bana li. Jitne zyada derivatives match karoge (higher order), utni achhi copy — lekin sirf us point ke nazdeek. Door jaake sab galat ho jaata hai.
Factorial kyun aata hai? Kyunki jab tum (x−a)n ko n baar differentiate karte ho to n! nikalta hai. Us n! ko cancel karne ke liye hi hum divide karte hai. Agar factorial bhool gaye, to ex ka series x=1 par infinity ban jaata — bilkul bekaar. Isliye yaad rakho: "divide by n-factorial or terms go feral".
ML mein yeh direct kaam aata hai. Loss function L(θ) ka first-order Taylor lo — value plus gradient·step — aur usse tumhe gradient descent milta hai (niche ki taraf chalo). Second-order lo — gradient plus Hessian curvature — aur usse Newton's method milta hai, jahan tum ek parabola fit karke seedha uske bottom par jump karte ho. Matlab jo optimizers tum roz use karte ho, woh actually truncated Taylor series hi hai.
Ek warning: Taylor series hamesha function ke barabar nahi hoti. 1−x1 ka series sirf ∣x∣<1 mein chalta hai. Aur point sahi choose karna — lnx ko x=1 ke paas expand karo, x=0 par nahi (wahan defined hi nahi hai). Yaad rakho: Taylor local hai, global nahi.