Welcome to the World of 3D Math!

In H2 Mathematics, you mastered functions like \(y = f(x)\), where one input gives one output. But the real world is rarely that simple. Think about the temperature in a room: it doesn't just depend on how far you are from the door (\(x\)); it also depends on how far you are from the window (\(y\)).

In this chapter, we explore Functions of Two Variables, \(z = f(x, y)\). You will learn how to navigate these 3D "landscapes," find the steepest paths uphill, and locate the highest peaks and deepest valleys. Don't worry if visualizing 3D shapes feels tricky at first—we will break it down step-by-step!

1. Understanding Surfaces: \(z = f(x, y)\)

When we have two input variables (\(x\) and \(y\)), the output (\(z\)) creates a surface in three-dimensional space.

Analogy: Imagine you are standing on a hilly park. Your horizontal position is given by coordinates \((x, y)\), and the height of the ground beneath your feet is \(z\). The entire park is the "surface" defined by the function.

Quick Review:
- In 2D, \(y = f(x)\) is a curve.
- In 3D, \(z = f(x, y)\) is a surface.

2. Partial Derivatives: One Step at a Time

How do we find the "slope" of a 3D surface? Since we can move in many directions, we start by looking at how \(z\) changes when we move only in the \(x\) direction or only in the \(y\) direction.

First-Order Partial Derivatives

To find the partial derivative with respect to \(x\) (written as \(\frac{\partial z}{\partial x}\) or \(f_x\)), we treat \(y\) as if it is a constant number (like 5 or \(\pi\)) and differentiate normally.

Example: If \(f(x, y) = x^2 + 3xy + y^2\)
To find \(f_x\): Treat \(y\) as a constant. The derivative of \(x^2\) is \(2x\). The derivative of \(3xy\) is \(3y\). The derivative of \(y^2\) is \(0\).
So, \(f_x = 2x + 3y\).

Second-Order Partial Derivatives

Just like in 2D calculus, we can differentiate again. There are four possibilities:
1. \(f_{xx}\): Differentiate with respect to \(x\) twice.
2. \(f_{yy}\): Differentiate with respect to \(y\) twice.
3. \(f_{xy}\): Differentiate with respect to \(x\), then differentiate the result with respect to \(y\).
4. \(f_{yx}\): Differentiate with respect to \(y\), then differentiate the result with respect to \(x\).
Did you know? For most functions you'll see, the "mixed partials" are equal: \(f_{xy} = f_{yx}\). If you get different answers, double-check your work!

Key Takeaway: Partial differentiation is just normal differentiation where you "freeze" the variables you aren't interested in.

3. The Gradient and Directional Derivatives

What if you want to walk diagonally? We use the Gradient Vector and Directional Derivatives.

The Gradient Vector (\(\nabla f\))

The gradient, denoted by \(\nabla f\) (pronounced "del f"), is a vector made of the first partial derivatives:
\(\nabla f = \begin{pmatrix} f_x \\ f_y \end{pmatrix}\)

Why it matters: The gradient vector at a point \((a, b)\) points in the direction of the steepest ascent (the fastest way up the hill). Its magnitude \(|\nabla f|\) is the value of that steepest slope.

Directional Derivatives

To find the slope in the direction of a unit vector \(\mathbf{u} = \begin{pmatrix} u_1 \\ u_2 \end{pmatrix}\), we use the formula:
Directional Derivative = \(\nabla f \cdot \mathbf{u} = f_x u_1 + f_y u_2\)

Common Mistake: Always ensure your direction vector \(\mathbf{u}\) is a unit vector (length = 1) before using this formula. If it isn't, divide the vector by its magnitude first!

4. Tangent Planes and Local Linearisation

If you zoom in close enough to any smooth surface, it looks like a flat plane. This is the tangent plane.

Equation of the Tangent Plane

The equation of the tangent plane to the surface \(z = f(x, y)\) at the point \((x_0, y_0, z_0)\) is:
\(z - z_0 = f_x(x_0, y_0)(x - x_0) + f_y(x_0, y_0)(y - y_0)\)

Local Linearisation

This is just a fancy way of saying "using the tangent plane to estimate values." For points \((x, y)\) very close to \((x_0, y_0)\):
\(f(x, y) \approx f(x_0, y_0) + f_x(x_0, y_0)\Delta x + f_y(x_0, y_0)\Delta y\)

Memory Aid: This is exactly like the linear approximation formula in 2D (\(y \approx y_0 + f'(x_0)\Delta x\)), just with an extra term for \(y\)!

5. Quadratic Approximations

If a flat plane isn't accurate enough, we can add quadratic terms (the second derivatives) to catch the "curvature" of the surface. The quadratic approximation of \(f(x, y)\) near \((0, 0)\) is:
\(f(x, y) \approx f(0, 0) + f_x x + f_y y + \frac{1}{2}(f_{xx} x^2 + 2f_{xy} xy + f_{yy} y^2)\)
Note: Derivatives are evaluated at (0, 0).

6. Stationary Points: Peaks, Valleys, and Passes

A stationary point occurs where the surface is perfectly flat. This happens when both partial derivatives are zero:
\(f_x = 0\) and \(f_y = 0\)

Types of Stationary Points

1. Local Maximum: Like the top of a mountain.
2. Local Minimum: Like the bottom of a bowl.
3. Saddle Point: A point that looks like a maximum from one direction but a minimum from another (like a horse saddle or a mountain pass).

The Second Derivative Test

To classify a point, calculate \(D = f_{xx}f_{yy} - (f_{xy})^2\):
- If \(D > 0\) and \(f_{xx} > 0\): It's a Local Minimum.
- If \(D > 0\) and \(f_{xx} < 0\): It's a Local Maximum.
- If \(D < 0\): It's a Saddle Point.
- If \(D = 0\): The test is inconclusive (it could be anything!).

Key Takeaway: Finding stationary points is a two-step process: solve the simultaneous equations \(f_x=0, f_y=0\), then use the \(D\) test to see what you've found.

Summary Checklist

Can you:
1. Calculate first and second partial derivatives? (\(f_x, f_y, f_{xx}, f_{yy}, f_{xy}\))
2. Find the gradient vector and use it for directional derivatives?
3. Write the equation of a tangent plane?
4. Use the \(D\) test to classify stationary points?
5. Apply these steps to solve real-world "max/min" word problems?

Don't worry if this seems tricky at first! Practicing the differentiation steps is the best way to build confidence. You've got this!