Lesson 5 of 18
Partial Derivative ∂f/∂x
Partial Derivatives
A function of two variables, , has two partial derivatives — one for each variable.
The partial derivative with respect to treats as a constant and differentiates normally:
This is the central difference approximation — more accurate than a one-sided difference.
Intuition
- measures the rate of change of as you move in the -direction
- Think of it as the slope of along the -axis, holding frozen
Examples
For :
- (treat as constant → derivative is 0)
For :
- (treat as a constant multiplier)
For :
Your Task
Implement double partial_x(double (*f)(double, double), double x, double y, double h) that approximates at using step size .
TCC compiler loading...
Loading...
Click "Run" to execute your code.