168. Differentiating the Normal Distribution

𝑓(𝑥)=12𝜋𝜎2exp((𝑥𝜇)22𝜎2)

We want 𝑓(𝑥)=dd𝑥𝑓(𝑥)

Step 1. Structure

Two factors:

𝑓(𝑥)=12𝜋𝜎2constantexp((𝑥𝜇)22𝜎2)function of𝑥

First factor is a constant (does not depend on 𝑥):

𝑓(𝑥)=12𝜋𝜎2dd𝑥exp((𝑥𝜇)22𝜎2)

Step 2: Set up the chain rule

𝑢(𝑥)=(𝑥𝜇)22𝜎2

Then

exp((𝑥𝜇)22𝜎2)=exp(𝑢(𝑥))

The chain rule:

dd𝑥exp(𝑢(𝑥))=exp(𝑢(𝑥))𝑢(𝑥)

We need 2 things:

Step 3. Differentiate 𝑢(𝑥)

𝑢(𝑥)=(𝑥𝜇)22𝜎2

3.a. Pull out constant

𝑢(𝑥)=12𝜎2(𝑥𝜇)2

The factor 12𝜎2 depends only on 𝜎, not 𝑥. Constants pull out of derivatives:

𝑢(𝑥)=12𝜎2dd𝑥(𝑥𝜇)2

Now we need dd𝑥(𝑥𝜇)2

3.b. Apply chain rule again to (𝑥𝜇)2

This is itself a composition:

Chain rule:

dd𝑥(𝑥𝜇)2=dd𝑣(𝑣2)d𝑣d𝑥

Outer derivative:

dd𝑣(𝑣2)=2𝑣=2(𝑥𝜇)

Inner derivative: 𝑣(𝑥)=𝑥𝜇

Since 𝜇 is a constant, d𝑢d𝑥=0. So:

d𝑣d𝑥=dd𝑥(𝑥𝜇)=dd𝑥(𝑥)dd𝑥(𝜇)=10=1

Combine:

dd𝑥(𝑥𝜇)2=2(𝑥𝜇)1=2(𝑥𝜇)

3.c. Put Step 3 together

Substitute back into expression for 𝑢(𝑥)

𝑢(𝑥)=12𝜎2(𝑥𝜇)

Simplify be canceling the 2′s:

𝑢(𝑥)=(2𝑥𝜇2𝜎2)=𝑥𝜇𝜎2

So:

𝑢(𝑥)=𝑥𝜇𝜎2

Step 4. Apply chain tule from Step 2

We had:

dd𝑥exp(𝑢(𝑥))=exp(𝑢(𝑥))𝑢(𝑥)

Plug in:

So:

dd𝑥exp((𝑥𝜇)22𝜎2)=exp((𝑥𝜇)22𝜎2)(𝑥𝜇𝜎2)

Move the factor to the front for clarity:

𝑥𝜇𝜎2exp((𝑥𝜇)22𝜎2)

Step 5. Putting everything together

Recall from Step 1:

𝑓(𝑥)=12𝜋𝜎2dd𝑥exp((𝑥𝜇)22𝜎2)

Substitute what we found:

𝑓(𝑥)=12𝜋𝜎2[𝑥𝜇𝜎2exp((𝑥𝜇)22𝜎2)]

Pull the 𝑥𝜇𝜎2 out front:

𝑓(𝑥)=𝑥𝜇𝜎212𝜋𝜎2exp((𝑥𝜇)22𝜎2)

Step 6. Recognize 𝑓(𝑥) on the right side

Look at the last two factors

12𝜋𝜎2exp((𝑥𝜇)22𝜎2)=𝑓(𝑥)

That’s exactly the original PDF. So:

𝑓(𝑥)=𝑥𝜇𝜎2𝑓(𝑥)

Step 7. Standard Normal

Does this collapse to 𝜙(𝑧) when 𝜇=0 and 𝜎=1?

Plug in 𝜇=0, 𝜎=1:

𝑓(𝑥)=𝑥012𝑓(𝑥)=𝑥𝑓(𝑥)

With 𝜇=0 and 𝜎=1, 𝑓(𝑥) becomes 𝜙(𝑥), so:

𝜙(𝑥)=𝑥𝜙(𝑥)
DistributionDerivative
General Normal 𝑓(𝑥)𝑓(𝑥)=𝑥𝜇𝜎2𝑓(𝑥)
Standard Normal 𝜙(𝑥)𝜙(𝑧)=𝑧𝜙(𝑧)