📐 Week 05 (Part II: Limits & Derivative Rules) • Student Lecture Materials
🐍 Download Notebook (.ipynb) 📑 Download Blank Slides (PDF) 📊 Download Dataset (.csv)

Week 05 — Constant, Power & Sum Rules (Degrees of Smallness)

Engineering Focus: Thermal Area/Volume Expansion, Structural Beam Bending–Moment–Shear Chains & Handling Radicals/Fractions Effortlessly Companion Dataset: Week05_Cantilever_Beam_Laser_Deflection_Data.csv


1. “Calculus Made Easy” Intuition: Throwing Away Dust on a Mountain

Why spend half a page expanding \((x+dx)^7\) every time you differentiate \(x^7\)? Silvanus Thompson discovered the secret that turns differentiation into pure joy: orders of smallness.

Suppose you measure the width \(x\) of a \(1\text{-meter}\) square copper heat-spreader plate (\(A = x^2\)), and heat expands each side by a tiny speck \(dx = 0.001\text{ m}\) (\(1\text{ mm}\)):

Thompson’s Golden Rule of Smallness: A little bit \(dx\) is small enough; \((dx)^2\) is a tiny bit of a tiny bit, so throw it in the trash! Immediately: \[d(x^2) = 2x\,dx \implies \mathbf{\frac{d}{dx}(x^2) = 2x}\]

Now do the exact same thing to a cube of volume \(V = x^3\): growing all three faces adds three thin wafer slabs \(3 x^2\,dx\), three tiny edge needles \(3x\,(dx)^2\) (second-order small—trash!), and one corner speck \((dx)^3\) (third-order small—double trash!). Thus \(d(x^3) = 3x^2\,dx\)! And for any exponent \(n\) (positive, negative, whole, or fractional!): \[\mathbf{\frac{d}{dx}\left(x^n\right) = n\,x^{n-1}}\]

2. Complete Mathematical Derivations & Reference Guide

2.1 Why Constants Disappear & Sums Split Cleanly

  1. Constant Rule (\(\frac{d}{dx}[C] = 0\)): If an altitude sensor is stuck at \(y = 400\text{ m}\) all day, \(y\) changes by \(0\) when \(x\) nudges by \(dx\), so its rate of change is \(\mathbf{0}\)! Geometrically, a horizontal flat line has zero slope everywhere.
  2. Constant Multiple Rule (\(\frac{d}{dx}[c\,f(x)] = c\,f'(x)\)): Stretch a bridge ramp vertically by \(3\times\), and every incline slope also scales by \(3\times\).
  3. Sum / Difference Rule (\(\frac{d}{dx}[f \pm g] = f' \pm g'\)): If total upward lift is \(f(t) + g(t)\) from two thrusters, total rate of lift gain is simply thruster 1’s rate plus thruster 2’s rate!

2.2 The Secret Weapon for Roots & Fractions: Rewrite Everything as \(a\,x^n\)!

Students often get tricked by \(\sqrt{x}\) or \(\frac{5}{x^3}\). You do not need special rules yet—just convert radicals and denominators into clean fractional/negative powers before applying \(n x^{n-1}\):

2.3 Structural Engineering Goldmine: Euler–Bernoulli Beam Ladder

For any civil/aerospace beam under load, four physical diagrams are one power-rule ladder apart:

Function Form Power Rewrite Derivative \(\frac{df}{dx}\) Engineering Example
\(C\) (constant) \(C x^0\) \(0\) Static tare load / datum
\(x^n\) (any real \(n\)) \(x^n\) \(n x^{n-1}\) Polynomial beam deflection
\(c\sqrt{x}\) \(c x^{1/2}\) \(\frac{c}{2\sqrt{x}}\) Torricelli tank velocity sensitivity
\(c / x^k\) \(c x^{-k}\) \(-c k / x^{k+1}\) Coulomb \(1/r^2\) or pipe headloss \(D^{-5}\)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sympy as sp
from pathlib import Path

plt.rcParams.update({
    "figure.dpi": 150,
    "font.size": 10,
    "axes.grid": True,
    "grid.alpha": 0.30,
    "axes.spines.top": False,
    "axes.spines.right": False,
})

def load_week_csv(filename):
    for p in [Path("datasets") / filename, Path("../datasets") / filename]:
        if p.exists():
            return pd.read_csv(p)
    raise FileNotFoundError(f"Dataset not found: {filename}")

3. Real-World Laser Profilometer Cantilever Beam Analysis

We read Week05_Cantilever_Beam_Laser_Deflection_Data.csv, containing laser-measured vertical deflection \(w(x)\) along a \(2.0\text{ m}\) steel cantilever beam carrying a uniform load \(q_0\). Fitting the 4th-degree elastic curve recovers slope, bending moment curvature, and shear force via successive Power & Sum rules!

df = load_week_csv("Week05_Cantilever_Beam_Laser_Deflection_Data.csv")
print("Week 05 Cantilever Laser Deflection Data (first 6 rows):")
print(df.head(6).to_string(index=False))

x_m = df["Position_x_m"].values
w_mm = df["Measured_Deflection_mm"].values
# Fit 4th-order beam polynomial & take analytical power-rule derivatives
coeffs = np.polyfit(x_m, w_mm, 4)
p_w = np.poly1d(coeffs)
p_slope = np.polyder(p_w, 1)
p_curv = np.polyder(p_w, 2)
print(f"\n[Power-Rule Fit] Tip deflection w(2.0 m) = {p_w(2.0):.3f} mm")
print(f"[Power-Rule Fit] Tip slope w'(2.0 m) = {p_slope(2.0):.3f} mm/m")
print(f"[Power-Rule Fit] Root curvature w''(0.0 m) = {p_curv(0.0):.3f} mm/m^2 (Peak bending moment at wall!)")

xg = np.linspace(0, 2.0, 200)
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(11.8, 4.3))
ax1.plot(xg, p_w(xg), "-", color="#0284c7", lw=2.2, label="Fitted Elastic Curve $w(x)$")
ax1.plot(x_m, w_mm, "ko", ms=4.5, label="Laser Sensor Data")
ax1.set_title("Cantilever Beam Deflection Curve $w(x)$")
ax1.set_xlabel("Axial Position $x$ [m]")
ax1.set_ylabel("Downward Deflection [mm]")
ax1.legend(fontsize=8.6)

ax2.plot(xg, p_slope(xg)/np.max(np.abs(p_slope(xg))), lw=2.1, label="Normalized Slope $w'(x)$")
ax2.plot(xg, p_curv(xg)/np.max(np.abs(p_curv(xg))), "--", lw=2.1, label="Normalized Moment $w''(x)$")
ax2.set_title("Successive Power-Rule Derivatives Along Span")
ax2.set_xlabel("Axial Position $x$ [m]")
ax2.set_ylabel("Normalized Response [-]")
ax2.legend(fontsize=8.6)

plt.tight_layout()
plt.show()
# Verified Output:
Week 05 Cantilever Laser Deflection Data (first 6 rows):
 Position_x_m  Measured_Deflection_mm
        0.000                   0.000
        0.125                   0.203
        0.250                   0.919
        0.375                   1.961
        0.500                   3.232
        0.625                   4.884

[Power-Rule Fit] Tip deflection w(2.0 m) = 31.192 mm
[Power-Rule Fit] Tip slope w'(2.0 m) = 20.638 mm/m
[Power-Rule Fit] Root curvature w''(0.0 m) = 31.106 mm/m^2 (Peak bending moment at wall!)
Week 05 Engineering Plot

4. Three Unabridged Worked Engineering Problems

Worked Example 1 — Rewriting Radicals & Negative Powers in Pipe Hydraulics

Problem: Differentiate cleanly term-by-term: \[f(x) = 4x^3 - \frac{3}{2}x^2 + 9x - 14, \qquad g(x) = 6\sqrt{x} - \frac{8}{x^2} + \frac{5}{\sqrt[3]{x}}\]

Unabridged Hand Solution:

  1. Polynomial \(f(x)\): Apply \(\frac{d}{dx}(x^n) = n x^{n-1}\) directly, remembering constant \(-14 \to 0\): \[f'(x) = 4(3x^2) - \frac{3}{2}(2x) + 9(1) - 0 = \mathbf{12x^2 - 3x + 9}\]

  2. Rewrite \(g(x)\) into clean powers first: \[g(x) = 6x^{1/2} - 8x^{-2} + 5x^{-1/3}\]

  3. Apply Power Rule carefully (subtract \(1\) from every exponent!): \[g'(x) = 6\left(\frac{1}{2}x^{-1/2}\right) - 8\left(-2x^{-3}\right) + 5\left(-\frac{1}{3}x^{-4/3}\right)\] \[= \mathbf{\frac{3}{\sqrt{x}} + \frac{16}{x^3} - \frac{5}{3 x^{4/3}}}\] (Check the signs carefully! Two negatives \(-8 \times (-2)\) turned into \(+16\)!)


Worked Example 2 — Neglecting \((dr)^2\) in Thermal Expansion of a Wafer & Sphere

Problem: A silicon wafer disk of radius \(r = 150.0\text{ mm}\) warms up and expands radially by \(dr = 0.04\text{ mm}\). Compare the exact increase in area \(\Delta A = \pi(r+dr)^2 - \pi r^2\) against the first-order power-rule differential \(dA = 2\pi r\,dr\), and prove why \((dr)^2\) is tiny.

Unabridged Hand Solution:

  1. Exact expansion: \(\Delta A = \pi\left(r^2 + 2r\,dr + (dr)^2 - r^2\right) = 2\pi r\,dr + \pi(dr)^2\).

  2. Power-rule differential (\(dA\)): Since \(A(r) = \pi r^2\), \(A'(r) = 2\pi r\), so \(dA = 2\pi r\,dr\): \[dA = 2\pi(150.0)(0.04) = 12\pi \approx \mathbf{37.69911\text{ mm}^2}\]

  3. Neglected second-order corner \(\pi(dr)^2\): \[\pi(0.04)^2 = \mathbf{0.00503\text{ mm}^2} \quad (\text{only } 0.013\% \text{ of } dA!)\]


Worked Example 3 — Complete Bending Moment & Shear Derivation for a Cantilever Beam

Problem: A \(L = 2.0\text{ m}\) cantilever beam deflects under uniform snow load according to \(w(x) = c\left(x^4 - 4Lx^3 + 6L^2 x^2\right)\) where \(c = \frac{q_0}{24EI}\). Differentiate three times to find slope, bending moment \(M(x) = EI\,w''(x)\), and shear \(V(x) = EI\,w'''(x)\), and evaluate moment at wall (\(x=0\)) and free tip (\(x=L\)).

Unabridged Hand Solution:

  1. First derivative (Slope): \(w'(x) = c\left(4x^3 - 12L x^2 + 12L^2 x\right)\). Note at \(x=0\), \(w'(0) = 0\) (clamped horizontal wall!).

  2. Second derivative (Bending Moment): Multiply by \(EI\), noting \(c\,EI = q_0 / 24\): \[M(x) = EI\,w''(x) = \frac{q_0}{24}\left(12x^2 - 24Lx + 12L^2\right) = \mathbf{\frac{q_0}{2}(L - x)^2}\] Check endpoints: at clamped root \(x=0\), \(M(0) = \frac{1}{2}q_0 L^2\) (maximum bending!). At free tip \(x=L\), \(M(L) = 0\)!

  3. Third derivative (Shear Force): \[V(x) = EI\,w'''(x) = \frac{q_0}{24}(24x - 24L) = \mathbf{-q_0(L - x)}\] At the wall (\(x=0\)), upward wall reaction balances the entire weight \(q_0 L\)!

x_s, L_s = sp.symbols("x L", positive=True)
f_s1 = 4*x_s**3 - sp.Rational(3, 2)*x_s**2 + 9*x_s - 14
g_s1 = 6*sp.sqrt(x_s) - 8/(x_s**2) + 5/(x_s**sp.Rational(1, 3))
w_beam = x_s**4 - 4*L_s*x_s**3 + 6*(L_s**2)*(x_s**2)

print("[Example 1] f'(x) =", sp.diff(f_s1, x_s))
print("[Example 1] g'(x) =", sp.diff(g_s1, x_s))
dA_lin = 2 * np.pi * 150.0 * 0.04
dA_2nd = np.pi * (0.04**2)
print(f"[Example 2] dA = {dA_lin:.5f} mm^2 vs. neglected pi*(dr)^2 = {dA_2nd:.5f} mm^2")
print("[Example 3] Factored beam curvature w''(x)/c =", sp.factor(sp.diff(w_beam, x_s, 2)))
# Verified Output:
[Example 1] f'(x) = 12*x**2 - 3*x + 9
[Example 1] g'(x) = 16/x**3 + 3/sqrt(x) - 5/(3*x**(4/3))
[Example 2] dA = 37.69911 mm^2 vs. neglected pi*(dr)^2 = 0.00503 mm^2
[Example 3] Factored beam curvature w''(x)/c = 12*(-L + x)**2

5. Engineering Practice Problems (Self-Study Exercises)

Practice Problem 1 — Headloss Sensitivity to Pipe Diameter

By Darcy–Weisbach hydraulics, turbulent friction pressure drop in a fixed flow pipe scales as \(\Delta P(D) = \frac{K}{D^5}\) where \(K\) is constant. Compute \(\frac{d(\Delta P)}{dD}\) and explain physically why a small reduction in pipe diameter \(D\) causes a dramatic spike in pump pressure.

🔍 Click to View Complete Step-by-Step Solution
  1. Rewrite using negative power: \(\Delta P(D) = K\,D^{-5}\).

  2. Apply Power Rule: \[\frac{d(\Delta P)}{dD} = K(-5\,D^{-6}) = \mathbf{-\frac{5K}{D^6}}\]

  3. Physically, dividing through by \(\Delta P = K D^{-5}\) shows \(\frac{d(\Delta P)}{\Delta P} = -5\,\frac{dD}{D}\): shrinking pipe diameter by just \(10\%\) raises pumping pressure drop by roughly \(50\%\)!


Practice Problem 2 — Combine Fractions Before Differentiating

Differentiate \(h(t) = \frac{3t^3 - 5t + \sqrt{t}}{t}\) cleanly using the Power Rule (without any Quotient Rule!).

🔍 Click to View Complete Step-by-Step Solution
  1. Split the single-term denominator first: \[h(t) = \frac{3t^3}{t} - \frac{5t}{t} + \frac{t^{1/2}}{t^1} = 3t^2 - 5 + t^{-1/2}\]

  2. Differentiate term-by-term: \[h'(t) = 6t - 0 - \frac{1}{2}t^{-3/2} = \mathbf{6t - \frac{1}{2t^{3/2}}}\]


Practice Problem 3 — Tank Torricelli Drain Rate Sensitivity

Water drains out the bottom of a tank with exit velocity \(v(h) = \sqrt{2gh}\), where \(g = 9.81\text{ m/s}^2\). Find \(v'(h)\) and evaluate how rapidly velocity drops per meter of water height lost at \(h = 2.0\text{ m}\).

🔍 Click to View Complete Step-by-Step Solution
  1. Rewrite as \(v(h) = \sqrt{2g}\,h^{1/2}\).
  2. Differentiate: \(v'(h) = \sqrt{2g}\cdot\frac{1}{2}h^{-1/2} = \sqrt{\frac{g}{2h}}\).
  3. Plug in \(g = 9.81\), \(h = 2.0\): \[v'(2.0) = \sqrt{\frac{9.81}{4.0}} = \sqrt{2.4525} = \mathbf{1.566\ (\text{m/s})/\text{m}}\]

Practice Problem 4 — Spherical Balloon Surface & Volume Growth Ratio

Using \(V(r) = \frac{4}{3}\pi r^3\) and \(S(r) = 4\pi r^2\), verify \(\frac{dV}{dr} = S(r)\) and give Thompson’s geometric picture of why this happens!

🔍 Click to View Complete Step-by-Step Solution
  1. Power Rule on \(V(r) = \frac{4}{3}\pi r^3\): \[\frac{dV}{dr} = \frac{4}{3}\pi(3r^2) = \mathbf{4\pi r^2 = S(r)}\]

  2. Geometric Intuition: When a sphere swells in radius by tiny thickness \(dr\), the extra volume \(dV\) added is literally a thin spherical paint shell wrapping the outside surface area \(S(r)\) to thickness \(dr\) (\(dV = S(r)\,dr\))!

References

🎬 Visual Intuition Animation — Visual Power Rule Square And Cube