derive_blog1.gif
When mentioning derivatives, many people often think of difficult mathematical formulas. However, from a real-life perspective, this concept is very familiar. Imagine you are looking to buy a house: the price changes based on area, location, house type, or market trends. You want to know which factor has the strongest impact? If the area increases slightly or the location is closer to the center, how will the price fluctuate?

That is when the derivative appears — a tool to measure the rate of change and understand the impact of each factor. Beyond such practical examples, derivatives also play a fundamental role in many modern fields, including Artificial Intelligence. Powerful AI models today rely on derivatives to learn and optimize, demonstrating the profound importance of this concept.

Understanding the true meaning of derivatives not only helps you master mathematical foundations but also opens up a more practical view of how the world operates. In this article, we will explore derivatives through the most intuitive and relatable everyday examples.


Derivative

In mathematics, the derivative of a function at a point indicates the instantaneous rate of change of the function as the variable changes. In other words: the derivative tells us how the output fluctuates when the input changes by a very small amount.

Definition: $$ f'(x_0) = \lim_{\Delta x \to 0} \frac{f(x_0 + \Delta x) - f(x_0)}{\Delta x} $$

derive_blog1.gif

This is the ratio between the change in the function's value and the change in the variable as that change approaches zero. The derivative represents the slope of the curve at a specific point — whether it is steep or shallow, increasing fast or slow.

The House Buying Story

Imagine you are a homebuyer, assuming that the house price only depends on its area. The larger the area, the higher the price. But the questions are:
- Is the rate of price increase the same for all house sizes?
- Does adding 1 m² to a small house increase the price as much as adding 1 m² to a large house?

This is a question about the rate of change of price relative to area – and that is the practical essence of a derivative.

Illustrative Example

Suppose the house price depends on the area according to the formula:
$$ f(x) = 500x^2 \quad \text{(unit: thousand VND), with $x$ as area (m$^2$)} $$
To know how much the price increases when the area increases "a little bit," we calculate the derivative:
$$ f_x' = 1000x $$
The derivative tells us how much each additional m² will increase the price, and this figure depends on the current area.

*Hình 1: Độ dốc đạo hàm tại điểm x = 10 và x = 50*

When the house has an area of 10 m²:
$$ f_x'(10) = 1000 \times 10 = 10{,}000 $$
The price increases by 10 million VND for every additional m².

When the house has an area of 50 m²:
$$ f_x'(50) = 1000 \times 50 = 50{,}000 $$
The price increases by 50 million VND for every additional m².

From this hypothetical model, we can see:
- Small houses have a slower rate of price increase.
- Large houses have a fast rate of price increase; each additional m² will be much more expensive.

Conclusion: The derivative shows us that the rate of price increase is not fixed but changes according to the house's area.

When you understand that the derivative indicates the rate of change of a function with respect to exactly one variable, the next question is: what if the final value depends on an intermediate variable?
That is when the Chain Rule appears.


Chain Rule

Before discussing the Chain Rule, let's recall the concept of a composite function. A function is called "composite" when the input value must pass through an intermediate layer before producing the final result.
Example: Usage Demand $\rightarrow$ affects Area $\rightarrow$ affects House Price.
Thus, the house price does not depend directly on demand, but indirectly through the area — this is the essence of a composite function.

Formula:
- Outer function: $$F=f(u)$$
- Inner function: $$u = g(x)$$
- Composite function: $$F(x) = f(g(x))$$
- Chain Rule: $$F_x'=f_u'.g_x'$$

Chain Rule in the House Buying Story

Suppose the house price depends on the area, and the area depends on the usage demand. When demand increases (adding rooms), the area increases, leading to a price increase. The questions are:
- If demand increases slightly, how will the house price change?
- How does increasing demand for a large house versus a small house affect the price?

This is the situation where the Chain Rule is needed.

Illustrative Example

Suppose:
- Price depends on area: $$f(u) = 500u^2$$
- Area depends on demand: $$u = g(x) = 20x $$ (where $x$ is the number of rooms, each adding 20 m²).
- House price based on demand: $$f(g(x)) = 500(20x)^2 = 200 000x^2$$

To find how price changes with demand ($x$), we use the Chain Rule: $$f_x'=f_u'.g_x'= 400 000x $$

plot2_2.png

If the demand is 3 rooms (x=3):
$$f_x'(3) = 400 000 . 3 = 1 200 000$$
$\rightarrow$ The price increases by 1.2 billion VND for each additional room.

If the demand is 1 room (x=1):
$$f_x'(1) = 400 000 . 1 = 400 000$$
$\rightarrow$ The price increases by 400 million VND for each additional room.

From the hypothetical model above, we see:
- When demand increases $\rightarrow$ area increases $\rightarrow$ price increases.
- Adding a room to a house that already has a large area will cause the price to increase significantly more than for a small house, even if the added area per room is the same.

Conclusion: When there is a need for extra rooms, houses that already have a large area will have a much higher rate of price increase compared to smaller houses.

In this part, we have seen how price changes when demand affects the area, which in turn affects the price. But in reality, house prices depend on location, orientation, surrounding amenities... And such "multi-factor influence" situations lead us to the next topic: partial derivatives.


Partial Derivative

In reality, many quantities depend simultaneously on various factors. In such cases, we cannot consider the derivative relative to just one variable. Instead, we need Partial Derivatives.

What is a Partial Derivative?

A partial derivative indicates the rate of change of a function with respect to one variable while holding the other variables constant.
Function of 2 variables: $$z = f(x,y)$$
Partial derivative:
$$ f_x = \frac{\partial f}{\partial x} = \lim_{h \to 0} \frac{f(x + h, y) - f(x, y)}{h} $$

$$ f_y = \frac{\partial f}{\partial y} = \lim_{h \to 0} \frac{f(x, y + h) - f(x, y)}{h} $$

partial_derivative_3d.png

With multi-variable functions, we have many directions to measure the slope of the tangent, each with a different slope. The partial derivative is how we observe the surface in each independent direction to determine that slope. When we want to calculate the rate of change for all variables at once, we group the partial derivatives into a vector called the Gradient.

Gradient: $$ \nabla f(x, y) = \left( \frac{\partial f}{\partial x},\; \frac{\partial f}{\partial y} \right) $$

The Gradient tells us:
- The rate of change for each variable.
- The direction in which the function increases most rapidly.

Applying Partial Derivatives to House Pricing

Back to our house price survey. In reality, price is influenced by many factors like area and location.
- Which factor affects the house price the most?
- If factors change simultaneously, how does the price fluctuate?

To answer these questions, let's practice with partial derivatives and the gradient.

Illustrative Example

Suppose house price depends on two variables:
$x$: Area ($m^2$)
$y$: Distance to the center (km)

Model: $$f(x,y) = 500x^2 - 50000y^2$$

Gradient: $$ \nabla f(x, y) = \left( \frac{\partial f}{\partial x},\; \frac{\partial f}{\partial y} \right) = (1000x, -100000y) $$

This means:
- 1000x: The rate of price increase as area increases.
- –100,000y: The rate of price decrease as distance from the center increases.

plot3_2.png

From the chart above, we see:
- Contour lines are denser as $x$ increases because $$\frac{\partial f}{\partial x} = 1000x$$
$\rightarrow$ large $x$ $\rightarrow$ price increases rapidly with area $\rightarrow$ contour lines are thick along the x-direction.

  • Contour lines are denser as $y$ increases because $$\frac{\partial f}{\partial y} = -100000y$$
    $\rightarrow$ large $y$ $\rightarrow$ price decreases rapidly with distance $\rightarrow$ contour lines are strongly tilted.

  • The gradient field tilts towards increasing area and decreasing $y$.

At Point A (50, 2): House area 50 $m^2$, distance 2 km.
$\rightarrow$ Gradient: $$\nabla f_A = (50\,000,\; -200\,000)$$
This means: For a house with an area of 50 $m^2$,
- Adding 1 m² increases the price by 50 million VND.
- Increasing distance by 1 km decreases the price by 200 million VND.

At Point B (100, 9): House area 100 $m^2$, distance 9 km.
$\rightarrow$ Gradient: $$\nabla f_B = (100\,000,\; -900\,000)$$
This means: For a house with an area of 100 $m^2$,
- Adding 1 m² increases the price by 100 million VND.
- Increasing distance by 1 km decreases the price by 900 million VND.

Comparison:
- Both points show that distance ($y$) dominates the price impact more than area ($x$).
- The impact at B is stronger than at A because both $x$ and $y$ are larger at B.
- The Gradient direction at B is more vertical than at A, as the distance effect at B is overwhelmingly large.

Conclusion: According to the hypothetical model above, distance to the center influences house prices the most. The larger and farther the house is, the higher its "price sensitivity" becomes.


Conclusion

Through three concepts — single-variable derivatives, the chain rule, and partial derivatives — the house price example shows that the derivative is a quantitative tool for measuring the variation of an output in response to each input factor. By isolating direct, indirect, and independent impacts, we have a rigorous analytical framework to determine which factors dominate in any context. Derivatives are the foundation for modern AI models, where derivative-based optimization plays a central role. We hope that after this blog, you can answer the two core questions: "What is a derivative?" and "What is the meaning of a derivative?" — the first stepping stones to understanding the world of modeling and machine learning.