อ่านอย่างเดียว35 นาที

Calculus: Differentiation & Integration — บทเรียนฉบับสมบูรณ์

Part 1 / 4

Calculus: Differentiation & Integration

วิชา FMMD 1103 · คณิตศาสตร์และฟิสิกส์สำหรับวิทยาศาสตร์สุขภาพ


ส่วนที่ 1 — แนวคิด Differentiation และ Derivative

ศัพท์พื้นฐานที่ต้องรู้

คำศัพท์ความหมายตัวอย่างสัญลักษณ์
Derivativeฟังก์ชันที่วัดการเปลี่ยนแปลงของ f(x) เทียบกับ xf'(x)
Differentialการเปลี่ยนแปลงเล็กน้อยของค่าdx, dy, dt
Differentiateกระบวนการแปลงฟังก์ชันให้กลายเป็น derivativedf(x)/dx
Limitให้ตัวแปรเข้าใกล้ค่าหนึ่ง แล้วดูว่า f(x) มีค่าเท่าไหร่lim f(x) เมื่อ x→0

Rate of Change คืออะไร?

เมื่อ x เปลี่ยนจาก x₁ ไป x₂:

  • การเปลี่ยนแปลงของฟังก์ชัน: Delta y = f(x₂) - f(x₁)
  • Rate of change (อัตราการเปลี่ยนแปลง): Delta y / Delta x = [f(x₂) - f(x₁)] / (x₂ - x₁)

ปัญหาคือ: ถ้ากราฟขึ้นๆ ลงๆ (เช่น กราฟ sine) เส้นลาด (slope) ระหว่าง x₁ กับ x₂ที่ห่างกันมาก ไม่ได้บอกอะไรที่มีความหมาย เพราะมันเฉลี่ยรวมทั้งขาขึ้นและขาลง


วิธีหา Slope ณ จุดใดจุดหนึ่ง → ใช้ Limit

วิธีแก้คือ ดึงจุดสองจุดให้เข้าหากัน โดยให้ Delta x → 0:

Delta y / Delta x = [f(x₁ + Delta x) - f(x₁)] / Delta x

เมื่อ Delta x → 0 สูตรจะกลายเป็น:

f'(x₁) = lim (Delta x → 0) [f(x₁ + Delta x) - f(x₁)] / Delta x

นั่นคือ derivative ณ จุด x₁ = ความชันของ tangent line ที่จุดนั้นพอดี

ตัวอย่าง: f(x) = x²

f'(x) = lim [( x₁ + Δx)² - x₁²] / Δx
       = lim [x₁² + 2x₁Δx + (Δx)² - x₁²] / Δx
       = lim [2x₁Δx + (Δx)²] / Δx
       = lim 2x₁ + Δx
       = 2x₁

ดังนั้น: d(x²)/dx = 2x → ได้สูตรทั่วไปสำหรับ polynomial ว่า d(x^n)/dx = n·x^(n-1)


กฎการ Differentiate (Differentiation Rules)

กฎสูตร
Constantd(c)/dx = 0
Constant multiple[c·f]' = c·f'
Sum[f + g]' = f' + g'
Difference[f - g]' = f' - g'
Product[f·g]' = f·g' + g·f' (หน้าดิฟหลัง + หลังดิฟหน้า)
Quotient[f/g]' = (g·f' - f·g') / g² (ล่างดิฟบน - บนดิฟล่าง หารด้วยล่างกำลังสอง)
Power ruled(x^n)/dx = n·x^(n-1)

ตัวอย่าง Polynomial:

  1. d/dx [x⁵ - (1/2)x²] = 5x⁴ - x
  2. d/dx [2x⁻² - x⁻¹] = -4x⁻³ + x⁻²
  3. d/dx [(x² + 1)(2x - 2)] ใช้ Product rule: (x² + 1)(2) + (2x - 2)(2x) = 6x² - 4x + 2
  4. d/dx [x³/(x-1)] ใช้ Quotient rule: [(x-1)(3x²) - x³(1)] / (x-1)² = (2x³ - 3x²) / (x² - 2x + 1)
Part 2 / 4

ส่วนที่ 2 — Trigonometric Derivatives, Chain Rule, และ Higher Derivatives

Derivatives ของ Trigonometric Functions

สูตรที่ต้องจำ (จากกราฟ sin และ cos จะเห็นว่า slope ของ sin x ณ จุดต่างๆ ตรงกับค่าของ cos x พอดี):

ฟังก์ชันDerivative
d/dx (sin x)cos x
d/dx (cos x)-sin x
d/dx (tan x)sec² x
d/dx (cot x)-csc² x
d/dx (sec x)sec x · tan x
d/dx (csc x)-cot x · csc x

ตัวอย่างการคำนวณ (ใช้ร่วมกับ Chain Rule และ Product Rule):

  1. d/dx [2 sin(3x)] = 2 · cos(3x) · 3 = 6 cos(3x)
  2. d/dx [(cos x)²] = 2 cos(x) · (-sin x) = -2 cos(x) sin(x)
  3. d/dx [sin x · cos 2x] ใช้ Product rule: = sin x · d(cos 2x)/dx + cos 2x · d(sin x)/dx = sin x · (-sin(2x) · 2) + cos(2x) · cos x = -2 sin(x) sin(2x) + cos(x) cos(2x)

Chain Rule — ดิฟฟังก์ชันซ้อน

Chain rule ใช้เมื่อมีฟังก์ชันซ้อนกัน เช่น f(g(h(x)))

d/dx f(g(h(x))) = f'(g(h)) · g'(h) · h'

ตัวอย่าง: f(x) = x², g(x) = sin x, h(x) = 2x³

ดังนั้น f(g(h(x))) = [sin(2x³)]²

d/dx [sin(2x³)]² = 2[sin(2x³)] × cos(2x³) × 6x²

วิธีคิด: "ดิฟก้อนนอกก่อน แล้วค่อยดิฟสิ่งที่อยู่ข้างในทีละชั้น"


Second Derivative และ Higher Derivatives

Second derivative = derivative ของ derivative → บอก rate of change ของ rate of change เช่น acceleration (ความเร่ง)

สัญลักษณ์: f''(x) หรือ d²/dx²

ตัวอย่าง: f(x) = x·cos x

  • f'(x) = -x sin x + cos x (ใช้ Product rule)
  • f''(x) = (-x cos x - sin x) - sin x = -x cos x - 2 sin x

Higher derivatives เขียนสัญลักษณ์เป็น f^(n)

ตัวอย่าง: y = x³ - 6x² - 5x + 3

  • y' = 3x² - 12x - 5
  • y'' = 6x - 12
  • y''' = 6
  • y^(4) = 0 (polynomial ที่ degree n จะมี derivative เป็น 0 ที่ order n+1)

ตัวอย่าง: Velocity จาก Position (Sample 3)

โจทย์: อนุภาคเคลื่อนที่ตาม s(t) = sin(2t) + cos(3t) หาความเร็วที่ t = π/6

velocity = v(t) = ds/dt = d/dt [sin(2t) + cos(3t)] = 2 cos(2t) - 3 sin(3t)

แทน t = π/6: = 2 cos(2π/6) - 3 sin(3π/6) = 2 cos(π/3) - 3 sin(π/2) = 2(1/2) - 3(1) = 1 - 3 = -2 m/s

Part 3 / 4

ส่วนที่ 3 — Integration: แนวคิดและการคำนวณ

Integration คืออะไร?

คำศัพท์ความหมาย
Integralฟังก์ชันที่อธิบายผลรวมของส่วนย่อยๆ เช่น area under the curve, งานที่แรงกระทำ
Integrationกระบวนการหา integral
Integrateรวมส่วนย่อยเข้าเป็นส่วนรวม
Integrandฟังก์ชันที่ถูก integrate
Summation (Σ)รวมค่าหลายค่าเข้าด้วยกัน เป็นต้นแบบของ integration

Integration เป็น ปฏิบัติการตรงข้ามกับ Differentiation (antiderivative)


แนวคิด: Area Under the Curve

ต้องการหาพื้นที่ใต้กราฟ f(x) ระหว่าง x₁ ถึง xn

  1. แบ่งพื้นที่เป็นสี่เหลี่ยมผืนผ้าแคบๆ แต่ละแท่งมี ความสูง = f(xᵢ) และ ความกว้าง = Δx
  2. รวมพื้นที่ทุกแท่ง: Area ≈ f(x₁)Δx + f(x₂)Δx + f(x₃)Δx + ... = Σ f(xᵢ)Δx
  3. ให้ Δx → 0 (แท่งยิ่งแคบ ยิ่งแม่นยำ) → จำนวนแท่ง n → ∞
lim (n→∞) Σ f(xᵢ)Δx = ∫ f(x) dx

นี่คือที่มาของสัญลักษณ์ ∫ (integral) ซึ่งมาจาก "S" ย่อมาจาก Sum และ dx แทน Δx ที่เล็กมากๆ


สัญลักษณ์และ Sign ของ Area

  • พื้นที่ใต้กราฟ (กราฟอยู่เหนือแกน x): เป็น บวก (+)
  • พื้นที่เหนือกราฟ (กราฟอยู่ใต้แกน x): เป็น ลบ (-)
  • เมื่อรวมกัน = Net area (พื้นที่สุทธิ)
  • Integration จาก a ไป b = lower x → higher x

Integral Properties

  1. Integral (a→b) f(x) dx = - Integral (b→a) f(x) dx
  2. Integral (a→a) f(x) dx = 0
  3. Integral (a→b) c dx = c(b - a)
  4. Integral (a→b) c·f(x) dx = c · Integral (a→b) f(x) dx
  5. Integral [f(x) + g(x)] dx = Integral f(x) dx + Integral g(x) dx
  6. Integral [f(x) - g(x)] dx = Integral f(x) dx - Integral g(x) dx
  7. Integral (a→b) f(x) dx = Integral (a→c) f(x) dx + Integral (c→b) f(x) dx

Definite vs. Indefinite Integral

Definite integral มีขอบเขต (range) → ผลลัพธ์เป็น ตัวเลข

ตัวอย่าง: Integral (-2→1) x³ dx = -15/4

Indefinite integral ไม่มีขอบเขต → ผลลัพธ์เป็น ฟังก์ชัน และต้องบวก constant c เสมอ (เพราะ derivative ของ constant = 0 จึงไม่รู้ว่าตอนเริ่มต้นมี constant อะไร)

ตัวอย่าง: Integral x³ dx = (1/4)x⁴ + c

สูตร Integration พื้นฐาน (ตรงข้ามกับ Power rule ของ Differentiation):

Integral x^n dx = x^(n+1) / (n+1) + c   (n ≠ -1)

สูตร Integration ของ Trigonometric Functions:

Integralผลลัพธ์
Integral sin x dx-cos x + c
Integral cos x dxsin x + c

ตัวอย่าง Indefinite Integral:

  1. Integral x^(-3/4) dx = x^(1/4) / (1/4) + c = 4x^(1/4) + c
  2. Integral (1-t)(2+t²) dt = Integral (2 + t² - 2t - t³) dt = -t⁴/4 + t³/3 - t² + 2t + c
  3. Integral (4 sin θ - 3 cos θ) dθ = -4 cos θ - 3 sin θ + c
Part 4 / 4

ส่วนที่ 4 — Area Under the Curve: การคำนวณจริง

พื้นที่ระหว่าง 2 เส้นกราฟ

พื้นที่ระหว่าง f(x) (กราฟบน) และ g(x) (กราฟล่าง) ในช่วง [a, b]:

Area = ∫(a→b) [f(x) - g(x)] dx

ตัวอย่างที่ 1: f(x) = x + 4 และ g(x) = 3 - x/2 ในช่วง [1, 4]

∫(1→4) [(x+4) - (3-x/2)] dx
= ∫(1→4) [3x/2 + 1] dx
= [3x²/4 + x] ตั้งแต่ 1 ถึง 4
= (16/4·3 + 4) - (3/4 + 1)
= (12 + 4) - (3/4 + 1)
= 16 - 7/4 = 57/4

ตัวอย่างที่ 2 (ต้องหา crossing point ก่อน): g(x) = 6 - x และ f(x) = 9 - (x/2)²

ขั้นที่ 1: หาจุดตัด → 6 - x = 9 - (x/2)² จัดรูป: x² - 4x - 12 = 0 → (x-6)(x+2) = 0 → x = 6, -2

ขั้นที่ 2: ใน [−2, 6] กราฟ f(x) อยู่บน g(x) → integrate f - g:

∫(-2→6) [(9-(x/2)²) - (6-x)] dx
= ∫(-2→6) [3 - x²/4 + x] dx
= [3x - x³/12 + x²/2] ตั้งแต่ -2 ถึง 6
= (18 - 18 + 18) - (-6 + 2/3 + 2)
= 18 - (-4 + 2/3)
= 18 + 4 - 2/3
= 64/3 unit²

ระวัง: เมื่อกราฟสลับกัน (Sample 2)

โจทย์: หาพื้นที่ระหว่าง f(x) = sin x และ g(x) = cos x ใน [0, π]

ในช่วงนี้กราฟสลับกัน (cos > sin ใน [0, π/4] แต่ sin > cos ใน [π/4, π]) ดังนั้นต้องแบ่งเป็น 2 sub-regions:

Area = ∫(0→π/4) [cos x - sin x] dx + ∫(π/4→π) [sin x - cos x] dx
= [sin x + cos x](0→π/4) + [-cos x - sin x](π/4→π)
= (sin(π/4) + cos(π/4) - sin(0) - cos(0)) + (-cos(π) - sin(π) + cos(π/4) + sin(π/4))
= (√2/2 + √2/2 - 0 - 1) + (1 - 0 + √2/2 + √2/2)
= (√2 - 1) + (1 + √2)
= 2√2

หลักการสำคัญ: ก่อน integrate พื้นที่ระหว่างเส้นกราฟ ต้องตรวจสอบเสมอว่ากราฟไหนอยู่บน ถ้ากราฟสลับกัน ให้แยก integrate ทีละช่วง แล้วค่อยรวมกัน


สรุปความสัมพันธ์ Differentiation ↔ Integration

f(x)  --[Differentiate]-->  f'(x)
f(x)  <--[Integrate]------  f'(x)
  • Differentiation = หา slope / rate of change
  • Integration = หา area / accumulation ของค่า
  • ทั้งสองอย่างเชื่อมกันผ่าน Fundamental Theorem of Calculus

ถามเพิ่ม

สงสัยตรงไหน ถามได้เลย — ระบบตอบจากเนื้อหาในบทนี้ และนำคำถามไปพัฒนาเนื้อหาให้ละเอียดขึ้น

ที่มา: 2.diff&integrate.pdf