πŸ“ Week 12 (Part IV: Integral Calculus & Applications) β€’ Student Lecture Materials
🐍 Download Notebook (.ipynb) πŸ“‘ Download Blank Slides (PDF) πŸ“Š Download Dataset (.csv)

Week 12 β€” Anti-Derivatives & Indefinite Integrals (Reversing the Derivative Machine)

Engineering Focus: Reconstructing Rocket-Sled Velocity & Track Position from IMU Acceleration Logs, Finding Boundary Constants \(+C\), and Why \(x^{-1}\) Jumps to \(\ln|x|\) Companion Dataset: Week12_Rocket_Sled_Accelerometer_and_Beam_Load_Data.csv


1. β€œCalculus Made Easy” Intuition: What Is Integration? Just Undoing Differentiation!

For eight weeks we used differentiation to slice a big quantity up into tiny rates of change (\(v = ds/dt\), \(a = dv/dt\)). Now we put the film into reverse!

Look at Leibniz’s famous integral sign: \(\int\). It is literally an elongated capital letter S standing for β€œthe Sum of all the little bits”!

2. Complete Mathematical Derivations & Reference Guide

2.1 Reverse Power Rule & Why \(n = -1\) Bridges to \(\ln|x|\)

To reverse \(\frac{d}{dx}(x^k) = k x^{k-1}\), add \(+1\) to the exponent and divide by the new exponent: \[\int x^n\,dx = \frac{x^{n+1}}{n+1} + C \qquad (n \neq -1)\] Wait: what happens if \(n = -1\) (\(\int \frac{1}{x}\,dx\))? Adding \(+1\) gives \(\frac{x^0}{0}\) β€” division by zero! Why? Remember Week 09! Which function differentiates cleanly into \(\frac{1}{x}\)? The natural logarithm! \[\mathbf{\int \frac{1}{x}\,dx = \ln|x| + C}\] (Why absolute value \(|x|\)? Because \(\frac{d}{dx}\ln(-x) = \frac{-1}{-x} = +\frac{1}{x}\) tooβ€”covering negative \(x\) domains as well as positive ones!)

2.2 Master Indefinite Integrals Table (Verify Every Single Entry by Differentiating Right Back!)

Integrand Antiderivative Formula Reversed Rule Check (Differentiate Back!)
\(\int k\,dx\) \(kx + C\) \((kx+C)' = k\)
\(\int x^n\,dx\ (n\neq -1)\) \(\frac{x^{n+1}}{n+1} + C\) \(\frac{d}{dx}\left(\frac{x^{n+1}}{n+1}\right) = x^n\)
\(\int x^{-1}\,dx = \int \frac{dx}{x}\) \(\ln|x| + C\) \(\frac{d}{dx}\ln|x| = \frac{1}{x}\)
\(\int e^{kx}\,dx\) \(\frac{1}{k}e^{kx} + C\) \(\frac{1}{k}\cdot k e^{kx} = e^{kx}\)
\(\int \sin(kx)\,dx\) \(-\frac{1}{k}\cos(kx) + C\) Watch the minus sign! \((-\cos)' = +\sin\)
\(\int \cos(kx)\,dx\) \(+\frac{1}{k}\sin(kx) + C\) \((+\sin)' = +\cos\)
\(\int \sec^2(kx)\,dx\) \(\frac{1}{k}\tan(kx) + C\) \((\tan)' = \sec^2\)
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. Rocket-Sled IMU Acceleration Integration & Boundary Recovery

We load Week12_Rocket_Sled_Accelerometer_and_Beam_Load_Data.csv, containing raw accelerometer telemetry \(a(t)\) during a rocket-sled burn and coast test starting from \(v(0) = 15.0\text{ m/s}\) (\(+C_1\)!) and track station \(s(0) = 100.0\text{ m}\) (\(+C_2\)!). Integrating twice recovers velocity and down-track distance cleanly!

df = load_week_csv("Week12_Rocket_Sled_Accelerometer_and_Beam_Load_Data.csv")
print("Week 12 Rocket-Sled IMU Acceleration Log (first 6 rows):")
print(df.head(6).to_string(index=False))

t_s = df["Time_s"].values
a_ms2 = df["IMU_Accel_m_s2"].values
v0_C1, s0_C2 = 15.0, 100.0
# Cumulative trapezoidal antiderivative reconstruction + exact initial conditions C1, C2
v_rec = np.zeros_like(t_s); s_rec = np.zeros_like(t_s)
v_rec[0] = v0_C1; s_rec[0] = s0_C2
for i in range(1, len(t_s)):
    dt_i = t_s[i] - t_s[i - 1]
    v_rec[i] = v_rec[i - 1] + 0.5 * (a_ms2[i] + a_ms2[i - 1]) * dt_i
    s_rec[i] = s_rec[i - 1] + 0.5 * (v_rec[i] + v_rec[i - 1]) * dt_i

print(f"\n[Antiderivative Reconstruction] Peak speed v_max = {v_rec.max():.2f} m/s | Final track position s = {s_rec[-1]:.1f} m")

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(11.8, 4.3))
ax1.plot(t_s, a_ms2, "o-", color="#dc2626", lw=2.0, label="Measured Acceleration $a(t)$")
ax1.axhline(0, color="#64748b", lw=1.0)
ax1.set_title("Raw IMU Acceleration Telemetry $a(t)$")
ax1.set_xlabel("Time $t$ [s]")
ax1.set_ylabel("Acceleration $a$ [m/s$^2$]")
ax1.legend(fontsize=8.5)

ax2.plot(t_s, v_rec, "s-", color="#0284c7", lw=2.0, label=f"Velocity $v(t) = \\int a\\,dt + {v0_C1}$")
ax2_r = ax2.twinx()
ax2_r.plot(t_s, s_rec, "^--", color="#059669", lw=1.8, label=f"Position $s(t) = \\int v\\,dt + {s0_C2}$")
ax2.set_title("Twice-Integrated Speed & Position (+C Anchored)")
ax2.set_xlabel("Time $t$ [s]")
ax2.set_ylabel("Velocity [m/s]", color="#0284c7")
ax2_r.set_ylabel("Track Distance [m]", color="#059669")
ax2.legend(loc="upper left", fontsize=8.0)

plt.tight_layout()
plt.show()
# Verified Output:
Week 12 Rocket-Sled IMU Acceleration Log (first 6 rows):
 Time_s  IMU_Accel_m_s2
    0.0          42.000
    0.5          37.473
    1.0          33.161
    1.5          29.101
    2.0          25.316
    2.5          21.820

[Antiderivative Reconstruction] Peak speed v_max = 135.13 m/s | Final track position s = 928.9 m
Week 12 Engineering Plot

4. Three Unabridged Worked Engineering Problems

Worked Example 1 β€” Split-First Reverse Power Rule & \(1/x\) Log Rule

Problem: Evaluate \(\int \left(6x^2 - \frac{4}{x} + \frac{3}{\sqrt{x}} + 5e^{-2x}\right)dx\), and verify your answer by differentiating back!

Unabridged Hand Solution:

  1. Rewrite every piece in clean power / exponential form: \[\int \left(6x^2 - 4\,x^{-1} + 3\,x^{-1/2} + 5e^{-2x}\right)dx\]

  2. Integrate piece-by-piece carefully:

    • \(\int 6x^2\,dx = 6\frac{x^3}{3} = 2x^3\)
    • \(\int (-4\,x^{-1})\,dx = -4\ln|x|\)
    • \(\int 3\,x^{-1/2}\,dx = 3\frac{x^{1/2}}{1/2} = 6\sqrt{x}\)
    • \(\int 5e^{-2x}\,dx = -\frac{5}{2}e^{-2x}\)
  3. Final antiderivative: \(\mathbf{2x^3 - 4\ln|x| + 6\sqrt{x} - \frac{5}{2}e^{-2x} + C}\).


Worked Example 2 β€” Double Integration for Free-Fall Rocket Drop With Initial Velocity

Problem: An instrument pod is ejected downward with initial speed \(v(0) = -12\text{ m/s}\) from height \(y(0) = 800\text{ m}\) under constant gravity \(a(t) = -9.81\text{ m/s}^2\). Find explicit formulas for velocity \(v(t)\) and altitude \(y(t)\) using indefinite integrals and lock down both constants \(C_1, C_2\).

Unabridged Hand Solution:

  1. First integral: \(v(t) = \int (-9.81)\,dt = -9.81t + C_1\). Apply \(v(0) = -12 \implies C_1 = -12\), so \(v(t) = \mathbf{-9.81t - 12}\).
  2. Second integral: \(y(t) = \int (-9.81t - 12)\,dt = -4.905t^2 - 12t + C_2\). Apply \(y(0) = 800 \implies C_2 = 800\): \[\mathbf{y(t) = -4.905t^2 - 12t + 800\ [\text{m}]}\]

Worked Example 3 β€” Recovering Structural Beam Deflection \(w(x)\) from Shear & Boundary Clamps

Problem: A cantilevered beam of length \(L = 2.0\text{ m}\) has internal bending moment \(M(x) = EI\,w''(x) = -24(2 - x)\ [\text{N}\cdot\text{m}]\) and flexural rigidity \(EI = 1.0\times 10^4\ \text{N}\cdot\text{m}^2\). Integrate twice and apply clamped wall conditions \(w'(0) = 0\) and \(w(0) = 0\) to compute tip deflection \(w(2.0)\).

Unabridged Hand Solution:

  1. First divide by \(EI\): \(w''(x) = -0.0024(2 - x) = -0.0048 + 0.0024x\).
  2. Integrate once for slope: \(w'(x) = -0.0048x + 0.0012x^2 + C_1\). Since \(w'(0) = 0 \implies C_1 = 0\).
  3. Integrate again for deflection: \(w(x) = -0.0024x^2 + 0.0004x^3 + C_2\). Since \(w(0) = 0 \implies C_2 = 0\).
  4. Tip deflection at \(x = 2.0\text{ m}\): \[w(2.0) = -0.0024(4) + 0.0004(8) = -0.0096 + 0.0032 = \mathbf{-0.0064\text{ m} = -6.40\text{ mm}}\]
x_s = sp.Symbol("x", real=True, positive=True)
expr1 = 6*x_s**2 - 4/x_s + 3/sp.sqrt(x_s) + 5*sp.exp(-2*x_s)
antideriv1 = sp.integrate(expr1, x_s)
print("[Example 1] Antiderivative =", antideriv1, "+ C")
assert sp.simplify(sp.diff(antideriv1, x_s) - expr1) == 0
print("[Example 2] Altitude at t=5s:", -4.905*25 - 12*5 + 800, "m")
print(f"[Example 3] Cantilever tip deflection w(2.0) = {(-0.0024*4 + 0.0004*8)*1000:.2f} mm")
# Verified Output:
[Example 1] Antiderivative = 6*sqrt(x) + 2*x**3 - 4*log(x) - 5*exp(-2*x)/2 + C
[Example 2] Altitude at t=5s: 617.375 m
[Example 3] Cantilever tip deflection w(2.0) = -6.40 mm

5. Engineering Practice Problems (Self-Study Exercises)

Practice Problem 1 β€” Dividing by Single-Term Denominator Before Integrating

Find \(\int \frac{t^4 - 2t + 7}{t^2}\,dt\).

πŸ” Click to View Complete Step-by-Step Solution
  1. Split fractions cleanly first: \(\int (t^2 - 2t^{-1} + 7t^{-2})\,dt\).
  2. Integrate term-by-term: \(\mathbf{\frac{t^3}{3} - 2\ln|t| - \frac{7}{t} + C}\).

Practice Problem 2 β€” Harmonic Acceleration Back to Position

A shaker vibrates with acceleration \(a(t) = -20\cos(2t)\ [\text{m/s}^2]\) starting from \(v(0) = 0\) and \(y(0) = 5.0\text{ m}\). Find \(y(t)\)!

πŸ” Click to View Complete Step-by-Step Solution
  1. \(v(t) = \int (-20\cos(2t))\,dt = -10\sin(2t) + C_1\). Using \(v(0)=0 \implies C_1=0\).
  2. \(y(t) = \int (-10\sin(2t))\,dt = +5\cos(2t) + C_2\). Using \(y(0)=5 \implies 5(1)+C_2=5 \implies C_2=0\).
  3. Thus \(\mathbf{y(t) = 5\cos(2t)\ [\text{m}]}\).

Practice Problem 3 β€” Recovering Thermal Energy Added from Specific Heat \(c_p(T)\)

A ceramic heat shield has specific heat \(c_p(T) = 800 + 0.40\,T\ [\text{J/(kg}\cdot\text{K)}]\). Find the specific enthalpy change function \(h(T) = \int c_p(T)\,dT\) anchored at reference \(h(300\text{ K}) = 0\).

πŸ” Click to View Complete Step-by-Step Solution
  1. \(h(T) = 800T + 0.20 T^2 + C\).
  2. Apply reference datum \(h(300) = 0\): \(800(300) + 0.20(90{,}000) + C = 0 \implies C = -258{,}000\text{ J/kg}\).
  3. \(\mathbf{h(T) = 800T + 0.20T^2 - 258{,}000\ [\text{J/kg}]}\).

Practice Problem 4 β€” Why \(1/x\) Cannot Use the Power Rule

Explain why trying the reverse power rule on \(\int \frac{1}{x}\,dx\) breaks, and compute the specific antiderivative \(F(x)\) satisfying \(F(e^2) = 10\) (\(x > 0\)).

πŸ” Click to View Complete Step-by-Step Solution
  1. Reverse power rule for \(n=-1\) gives \(\frac{x^0}{0}\), which is undefined! Instead, \(\int \frac{dx}{x} = \ln x + C\) (\(x>0\)).
  2. Set \(F(e^2) = \ln(e^2) + C = 2 + C = 10 \implies C = 8\), so \(\mathbf{F(x) = \ln x + 8}\).

References

🎬 Visual Intuition Animation β€” Davis Vertical Shift Family And Log Gap