<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Mathematics on Blog</title><link>https://svfcode.github.io/en/tags/mathematics/</link><description>Recent content in Mathematics on Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 13 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://svfcode.github.io/en/tags/mathematics/index.xml" rel="self" type="application/rss+xml"/><item><title>Math Analysis — Derivatives</title><link>https://svfcode.github.io/en/p/math-derivatives/</link><pubDate>Fri, 13 Mar 2026 00:00:00 +0000</pubDate><guid>https://svfcode.github.io/en/p/math-derivatives/</guid><description>&lt;blockquote>
&lt;p>&lt;strong>Without this you can&amp;rsquo;t understand how neural networks learn.&lt;/strong>&lt;/p>
&lt;/blockquote>
&lt;p>A common example is the speed of a car. We&amp;rsquo;ll do the same.&lt;/p>
&lt;h2 id="what-is-speed">What is speed?&lt;/h2>
&lt;p>It&amp;rsquo;s the ratio of distance to time.&lt;/p>
&lt;p>A car traveling at an average speed of 60 km/h — if we increase time \( t \) by one unit, distance \( s \) increases by 60 units. If we multiply \( t \) by 10, \( s \) is multiplied by 10 as well. The growth is linear; on a graph it&amp;rsquo;s a straight line.&lt;/p>
&lt;div class="chart-wrap" style="max-width: 360px; margin: 1em 0;">
&lt;canvas id="chart-linear-ef65e140a99a3aa68a1c55eb91ebca46" height="200">&lt;/canvas>
&lt;div class="chart-legend" style="display: flex; justify-content: center; gap: 1rem; margin-top: 0.5rem; font-size: 0.9rem; color: var(--content-color, #374151);">
&lt;span style="display: flex; align-items: center; gap: 0.4rem;">&lt;span style="width: 24px; height: 3px; background: #3b82f6; border-radius: 2px;">&lt;/span>s = 60t&lt;/span>
&lt;/div>
&lt;/div>
&lt;script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.6/dist/chart.umd.min.js">&lt;/script>
&lt;script>
(function() {
var id = 'chart-linear-ef65e140a99a3aa68a1c55eb91ebca46';
var canvas = document.getElementById(id);
if (!canvas) return;
function init() {
if (!window.Chart) return;
var ctx = canvas.getContext('2d');
if (!ctx) return;
var labels = [0, 1, 2, 3, 4];
var data = [0, 60, 120, 180, 240];
new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [{
label: 's = 60t',
data: data,
borderColor: '#3b82f6',
backgroundColor: 'transparent',
borderWidth: 2.5,
fill: false,
pointRadius: 0,
tension: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: true,
aspectRatio: 1.6,
plugins: {
legend: { display: false },
title: { display: false }
},
scales: {
x: { title: { display: true, text: 't' }, grid: { color: 'rgba(107,114,128,0.3)' } },
y: { title: { display: true, text: 's' }, min: 0, grid: { color: 'rgba(107,114,128,0.3)' } }
}
}
});
}
document.readyState === 'loading' ? document.addEventListener('DOMContentLoaded', init) : init();
})();
&lt;/script>
&lt;p>But over time the car moves unevenly — speed increases and decreases.&lt;/p>
&lt;div class="chart-wrap" style="max-width: 360px; margin: 1em 0;">
&lt;canvas id="chart-nonuniform-ef65e140a99a3aa68a1c55eb91ebca46" height="200">&lt;/canvas>
&lt;div class="chart-legend" style="display: flex; justify-content: center; gap: 1rem; margin-top: 0.5rem; font-size: 0.9rem; color: var(--content-color, #374151); flex-wrap: wrap;">
&lt;span style="display: flex; align-items: center; gap: 0.4rem;">&lt;span style="width: 24px; height: 3px; background: #3b82f6; border-radius: 2px;">&lt;/span>s(t) — distance&lt;/span>
&lt;span style="display: flex; align-items: center; gap: 0.4rem;">&lt;span style="width: 24px; border-bottom: 2px dashed #f59e0b;">&lt;/span>v(t) — velocity&lt;/span>
&lt;/div>
&lt;/div>
&lt;script>
(function() {
var id = 'chart-nonuniform-ef65e140a99a3aa68a1c55eb91ebca46';
var canvas = document.getElementById(id);
if (!canvas) return;
function run() {
if (!window.Chart) return;
var ctx = canvas.getContext('2d');
if (!ctx) return;
var labels = [];
var sData = [];
var vData = [];
for (var t = 0; t &lt;= 1.02; t += 0.02) {
labels.push(t.toFixed(2));
var u = Math.max(0, Math.min(1, t));
var s = 60 * u * u * (3 - 2 * u);
var v = 360 * u * (1 - u);
sData.push(s);
vData.push(v);
}
new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [
{
label: 's(t) — distance',
data: sData,
borderColor: '#3b82f6',
borderWidth: 2.5,
fill: false,
pointRadius: 0,
tension: 0.3,
yAxisID: 'y'
},
{
label: 'v(t) — velocity',
data: vData,
borderColor: '#f59e0b',
borderWidth: 2,
borderDash: [6, 4],
fill: false,
pointRadius: 0,
tension: 0.3,
yAxisID: 'y1'
}
]
},
options: {
responsive: true,
maintainAspectRatio: true,
aspectRatio: 1.6,
plugins: { legend: { display: false } },
scales: {
x: { title: { display: true, text: 't' }, grid: { color: 'rgba(107,114,128,0.3)' } },
y: {
type: 'linear',
position: 'left',
title: { display: true, text: 's' },
min: 0,
max: 70,
grid: { color: 'rgba(107,114,128,0.3)' }
},
y1: {
type: 'linear',
position: 'right',
title: { display: true, text: 'v' },
min: 0,
max: 100,
grid: { drawOnChartArea: false },
ticks: { color: 'rgba(107,114,128,0.8)' }
}
}
}
});
}
function init() {
if (window.Chart) run();
else {
var s = document.createElement('script');
s.src = 'https://cdn.jsdelivr.net/npm/chart.js@4.4.6/dist/chart.umd.min.js';
s.onload = run;
document.head.appendChild(s);
}
}
document.readyState === 'loading' ? document.addEventListener('DOMContentLoaded', init) : init();
})();
&lt;/script>
&lt;details style="background: rgba(239, 68, 68, 0.08); padding: 0.75em 1em; border-radius: 8px; margin: 0.5em 0; border-left: 3px solid #ef4444;">
&lt;summary>Impossible&lt;/summary>
&lt;p>Distance traveled cannot decrease. Such an s(t) graph would be wrong:&lt;/p>
&lt;div class="chart-impossible-wrap" style="max-width: 360px; margin: 0.75em 0;">
&lt;canvas id="chart-impossible-st-ef65e140a99a3aa68a1c55eb91ebca46" height="200">&lt;/canvas>
&lt;div class="chart-legend" style="display: flex; justify-content: center; gap: 1rem; margin-top: 0.5rem; font-size: 0.9rem; color: var(--content-color, #374151);">
&lt;span style="display: flex; align-items: center; gap: 0.4rem;">&lt;span style="width: 24px; height: 3px; background: #3b82f6; border-radius: 2px;">&lt;/span>s(t) — wrong&lt;/span>
&lt;/div>
&lt;/div>
&lt;script>
(function() {
var id = 'chart-impossible-st-ef65e140a99a3aa68a1c55eb91ebca46';
var canvas = document.getElementById(id);
if (!canvas) return;
function run() {
if (!window.Chart) return;
var ctx = canvas.getContext('2d');
if (!ctx) return;
var labels = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
var data = [0, 3, 7, 11, 14, 11, 6, 2, 5, 9, 13];
new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [{
label: 's(t) — wrong',
data: data,
borderColor: '#3b82f6',
backgroundColor: 'transparent',
borderWidth: 2.5,
fill: false,
pointRadius: 0,
tension: 0.3
}]
},
options: {
responsive: true,
maintainAspectRatio: true,
aspectRatio: 1.6,
plugins: {
legend: { display: false },
tooltip: { enabled: true },
title: { display: false }
},
scales: {
x: {
title: { display: true, text: 't', font: { size: 12 } },
grid: { color: 'rgba(107,114,128,0.3)' },
ticks: { maxTicksLimit: 6 }
},
y: {
title: { display: true, text: 's', font: { size: 12 } },
min: 0,
max: 16,
grid: { color: 'rgba(107,114,128,0.3)' },
ticks: { stepSize: 2 }
}
}
}
});
}
function init() {
if (window.Chart) run();
else {
var s = document.createElement('script');
s.src = 'https://cdn.jsdelivr.net/npm/chart.js@4.4.6/dist/chart.umd.min.js';
s.onload = run;
document.head.appendChild(s);
}
}
document.readyState === 'loading' ? document.addEventListener('DOMContentLoaded', init) : init();
})();
&lt;/script>
&lt;/details>
&lt;details class="quiz-nonuniform" style="margin: 1.5em 0; padding: 1rem; background: var(--card-background, #f8fafc); border-radius: 10px; border: 1px solid var(--card-separator-color, rgba(0,0,0,0.08));">
&lt;summary style="cursor: pointer; font-size: 1.15rem; font-weight: 600;">Self-check questions&lt;/summary>
&lt;div style="margin-top: 1rem;">&lt;div class="quiz-item" style="margin-bottom: 1.25rem;">
&lt;p style="margin: 0 0 0.5rem; font-weight: 500;">1. When is the speed at its maximum?&lt;/p>
&lt;details style="margin: 0.4rem 0;">&lt;summary style="cursor: pointer; color: var(--link-color);">Hint&lt;/summary>
&lt;p style="margin: 0.4rem 0; opacity: 0.9;">Look at the v(t) graph. Where does it reach its highest value?&lt;/p>&lt;/details>
&lt;div style="margin-top: 0.5rem;">
&lt;button type="button" class="quiz-reveal" data-answer="In the middle of the interval, at t ≈ 0.5">Check&lt;/button>
&lt;span class="quiz-answer" style="display: none; margin-left: 0.5rem;">&lt;/span>
&lt;/div>
&lt;/div>
&lt;div class="quiz-item" style="margin-bottom: 1.25rem;">
&lt;p style="margin: 0 0 0.5rem; font-weight: 500;">2. What does the slope of s(t) at a given point represent?&lt;/p>
&lt;details style="margin: 0.4rem 0;">&lt;summary style="cursor: pointer; color: var(--link-color);">Hint&lt;/summary>
&lt;p style="margin: 0.4rem 0; opacity: 0.9;">Velocity is the ratio of distance change to time. How does that relate to slope?&lt;/p>&lt;/details>
&lt;div style="margin-top: 0.5rem;">
&lt;button type="button" class="quiz-reveal" data-answer="The instantaneous velocity v(t) at that moment">Check&lt;/button>
&lt;span class="quiz-answer" style="display: none; margin-left: 0.5rem;">&lt;/span>
&lt;/div>
&lt;/div>
&lt;div class="quiz-item" style="margin-bottom: 0;">
&lt;p style="margin: 0 0 0.5rem; font-weight: 500;">3. Why does v(t) first increase and then decrease?&lt;/p>
&lt;details style="margin: 0.4rem 0;">&lt;summary style="cursor: pointer; color: var(--link-color);">Hint&lt;/summary>
&lt;p style="margin: 0.4rem 0; opacity: 0.9;">v is the derivative of s. How does the slope of s(t) change from start to end? Recall the S-shape.&lt;/p>&lt;/details>
&lt;div style="margin-top: 0.5rem;">
&lt;button type="button" class="quiz-reveal" data-answer="The slope of s(t) first increases (acceleration), then decreases (deceleration). s has an inflection point.">Check&lt;/button>
&lt;span class="quiz-answer" style="display: none; margin-left: 0.5rem;">&lt;/span>
&lt;/div>
&lt;/div>&lt;/div>
&lt;/details>
&lt;script>
(function() {
document.querySelectorAll('.quiz-reveal').forEach(function(btn) {
btn.addEventListener('click', function() {
var span = this.nextElementSibling;
if (span &amp;&amp; span.classList.contains('quiz-answer')) {
if (span.style.display === 'none' || !span.style.display) {
span.textContent = 'Correct answer: ' + this.getAttribute('data-answer');
span.style.display = 'inline';
btn.textContent = 'Hide';
} else {
span.textContent = '';
span.style.display = 'none';
btn.textContent = 'Check';
}
}
});
});
})();
&lt;/script></description></item><item><title>Essential Mathematics — Overview</title><link>https://svfcode.github.io/en/p/math-essentials-overview/</link><pubDate>Thu, 12 Mar 2026 00:00:00 +0000</pubDate><guid>https://svfcode.github.io/en/p/math-essentials-overview/</guid><description>&lt;p>This is the intro to the «Essential Mathematics» series — an overview of which math areas are needed for AI and machine learning, and what they are used for.&lt;/p>
&lt;h2 id="linear-algebra">Linear Algebra&lt;/h2>
&lt;p>&lt;strong>What you need:&lt;/strong> vectors, matrices, matrix multiplication, linear transformations, dot product, vector norm, eigenvalues and eigenvectors (advanced).&lt;/p>
&lt;p>&lt;strong>Why:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Vectors — the basic way to represent data: a word, an image, or a model&amp;rsquo;s «thought» is encoded as a vector of numbers&lt;/li>
&lt;li>Matrices — all neural network operations (convolutions, attention, linear layers) boil down to matrix multiplication&lt;/li>
&lt;li>Linear transformations — understanding how a layer «mixes» and combines features&lt;/li>
&lt;li>Without linear algebra you cannot read formulas in papers or understand what the code does (e.g. &lt;code>W @ x&lt;/code> is weight matrix times input vector)&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>&lt;/li>
&lt;/ul>
&lt;h2 id="derivatives">Derivatives&lt;/h2>
&lt;p>&lt;strong>What you need:&lt;/strong> derivatives, partial derivatives, gradient, chain rule, function optimization.&lt;/p>
&lt;p>&lt;strong>Why:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Neural networks are trained via gradient descent: we move weights in the direction that reduces the error&lt;/li>
&lt;li>Gradient — a vector of partial derivatives showing which way to «tweak» each parameter&lt;/li>
&lt;li>Chain rule is the backbone of backpropagation — the algorithm that computes gradients for all layers&lt;/li>
&lt;li>Without calculus you cannot understand where weight updates come from or why training works at all&lt;/li>
&lt;/ul>
&lt;h2 id="probability-and-statistics">Probability and Statistics&lt;/h2>
&lt;p>&lt;strong>What you need:&lt;/strong> distributions (normal, Bernoulli, etc.), expectation, variance, conditional probability, Bayes&amp;rsquo; theorem, maximum likelihood estimation (MLE).&lt;/p>
&lt;p>&lt;strong>Why:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Models are often formulated probabilistically: «probability of the next word», «how confident is the model»&lt;/li>
&lt;li>Loss functions often derive from likelihood (cross-entropy, MSE, etc.)&lt;/li>
&lt;li>Statistics for working with data: normalization, quality assessment, understanding metrics (precision, recall, AUC)&lt;/li>
&lt;li>Bayes — foundation of many classical algorithms and the way to «update beliefs» on new data&lt;/li>
&lt;/ul>
&lt;h2 id="computer-vision-cv">Computer Vision (CV)&lt;/h2>
&lt;p>&lt;strong>On top of the general minimum:&lt;/strong> discrete convolution (2D), affine and projective transformations, basic image geometry (camera calibration, epipolar geometry).&lt;/p>
&lt;p>&lt;strong>Why:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Convolution — the core of CNNs: understanding how a filter «slides» over an image, and what kernel, padding, stride mean&lt;/li>
&lt;li>Affine transformations (rotation, scale, shift) — for augmentations and understanding invariance&lt;/li>
&lt;li>Projective geometry and homographies — for stereo vision, 3D reconstruction, AR&lt;/li>
&lt;li>For classical methods (SIFT, optical flow) — image derivatives and per-pixel gradients are useful&lt;/li>
&lt;/ul>
&lt;h2 id="optional-but-helpful">Optional but helpful&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Information theory&lt;/strong> (entropy, cross-entropy) — deeper understanding of loss functions and data compression&lt;/li>
&lt;li>&lt;strong>Convex optimization&lt;/strong> — when the problem is «nice» and when SGD converges&lt;/li>
&lt;li>&lt;strong>Differential geometry&lt;/strong> — for advanced topics (diffusion models, representations)&lt;/li>
&lt;/ul>
&lt;h2 id="practical-minimum">Practical minimum&lt;/h2>
&lt;p>To comfortably read papers and code:&lt;/p>
&lt;ul>
&lt;li>Be able to multiply matrices and understand what a linear layer does&lt;/li>
&lt;li>Understand what a gradient is and why it matters for training&lt;/li>
&lt;li>Know basic distributions and quality metrics&lt;/li>
&lt;/ul>
&lt;p>You can pick up the rest as needed — when it appears in a specific problem or paper.&lt;/p>
&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>&lt;code>W @ x&lt;/code> — in Python (NumPy, PyTorch) the matrix multiplication operator: the weight matrix W is multiplied by the input vector x. The result is the output vector. A linear layer essentially computes &lt;code>W·x + b&lt;/code>.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description></item><item><title>Math Analysis — Derivatives</title><link>https://svfcode.github.io/en/p/math-derivatives-bkp/</link><pubDate>Thu, 12 Mar 2026 00:00:00 +0000</pubDate><guid>https://svfcode.github.io/en/p/math-derivatives-bkp/</guid><description>&lt;p>Second article in the «Essential Mathematics» series — on derivatives, gradient, and chain rule.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Without this you can&amp;rsquo;t understand how neural networks learn.&lt;/strong>&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>Prerequisites:&lt;/strong> limits — foundation for defining the derivative and continuity.&lt;/p>
&lt;h2 id="contents">Contents&lt;/h2>
&lt;ol>
&lt;li>&lt;a class="link" href="#what-is-a-derivative" >What is a derivative&lt;/a>
&lt;ul>
&lt;li>&lt;a class="link" href="#simple-explanation" >Simple explanation&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="#the-simplest-explanation" >The simplest explanation&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="#rules-and-basics" >Rules and basic derivative facts&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="#numerical-example-linear-function" >Numerical example: linear function \( g(x) = 3x - 1 \)&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="#numerical-example-quadratic-function" >Numerical example: quadratic function \( f(x) = x^2 \)&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="#interactive-exercise" >Interactive exercise&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="#self-check-tasks" >Self-check tasks&lt;/a>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;a class="link" href="#summary" >Summary&lt;/a>&lt;/li>
&lt;/ol>
&lt;h2 id="what-is-a-derivative">What is a derivative&lt;/h2>
&lt;h3 id="formal-definition">Formal definition&lt;/h3>
&lt;p>The derivative of a function at a point shows the &lt;strong>rate of change&lt;/strong>: how fast the function grows (or decreases) for a small shift in the argument.&lt;/p>
&lt;p>For a single-variable function \( f(x) \), the derivative \( f'(x) \) is the limit of the ratio of the change in \( f \) to the change in \( x \) as the change goes to zero:&lt;/p>
\[
f'(x) = \lim_{\Delta x \to 0} \frac{f(x + \Delta x) - f(x)}{\Delta x}
\]
&lt;p>Here \( \Delta x \) is the increment of the argument (a small step). In the examples below we use \( h \) for the same quantity.&lt;/p>
&lt;p>Geometrically — the slope of the tangent line at \( x \):&lt;/p>
&lt;ul>
&lt;li>\( f'(x) > 0 \) — function is increasing&lt;/li>
&lt;li>\( f'(x) &lt; 0 \) — function is decreasing&lt;/li>
&lt;li>\( f'(x) = 0 \) — possible minimum or maximum&lt;/li>
&lt;/ul>
&lt;p>&lt;em>If it didn&amp;rsquo;t click — open the simple explanation.&lt;/em>&lt;/p>
&lt;h3 id="simple-explanation">Simple explanation&lt;/h3>
&lt;details style="background: rgba(59, 130, 246, 0.08); padding: 0.75em 1em; border-radius: 8px; margin: 0.5em 0; border-left: 3px solid #3b82f6;">
&lt;summary>Simple explanation&lt;/summary>
&lt;p>&lt;strong>The speedometer&lt;/strong> — that&amp;rsquo;s essentially a derivative: how fast the distance traveled changes. Accelerating — speed goes up. Braking — it drops. So the derivative answers: &amp;ldquo;how much does one quantity change when you change another one a little?&amp;rdquo;&lt;/p>
&lt;p>&lt;strong>A hill.&lt;/strong> The steepness of a slope — &amp;ldquo;how far down you go when you take a step forward.&amp;rdquo; Steep slope — large derivative. Gentle — small. Flat road — zero.&lt;/p>
&lt;p>&lt;strong>A function graph.&lt;/strong> If you have a graph \( y = f(x) \), the derivative at a point is the &lt;strong>slope&lt;/strong> of the graph at that point. For a straight line \( y = kx + b \) the slope is the familiar coefficient \( k \). For a curve, each point has its own slope — that&amp;rsquo;s the derivative.&lt;/p>
&lt;ul>
&lt;li>Graph steeply going up → positive derivative&lt;/li>
&lt;li>Going down → negative derivative&lt;/li>
&lt;li>Flat (top or bottom) → derivative equals zero&lt;/li>
&lt;/ul>
&lt;/details>
&lt;p>&lt;em>If it&amp;rsquo;s still not crystal clear — open the simplest explanation.&lt;/em>&lt;/p>
&lt;h3 id="the-simplest-explanation">The simplest explanation&lt;/h3>
&lt;details style="background: rgba(59, 130, 246, 0.08); padding: 0.75em 1em; border-radius: 8px; margin: 0.5em 0; border-left: 3px solid #3b82f6;">
&lt;summary>The simplest explanation&lt;/summary>
&lt;p>&lt;strong>A car drives at constant speed.&lt;/strong> Distance \( s \) (km) depends on time \( t \) (h): \( s(t) = 60t \). In one hour we cover 60 km.&lt;/p>
&lt;p>Speed is &amp;ldquo;how many km per hour.&amp;rdquo; The ratio of change in distance to change in time:&lt;/p>
\[
\text{speed} = \frac{s(1) - s(0)}{1 - 0} = \frac{60 - 0}{1} = 60 \text{ km/h}
\]
&lt;p>That&amp;rsquo;s the derivative: the &lt;strong>rate of change&lt;/strong> of one quantity (distance) with respect to another (time).&lt;/p>
&lt;p>&lt;strong>Numeric example:&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>\( t \) (h)&lt;/th>
&lt;th>\( s(t) \) (km)&lt;/th>
&lt;th>\( s(t+0.5) - s(t) \)&lt;/th>
&lt;th>\( \frac{\Delta s}{\Delta t} \)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>0&lt;/td>
&lt;td>0&lt;/td>
&lt;td>30&lt;/td>
&lt;td>60&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>60&lt;/td>
&lt;td>30&lt;/td>
&lt;td>60&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2&lt;/td>
&lt;td>120&lt;/td>
&lt;td>30&lt;/td>
&lt;td>60&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Everywhere we get 60. &lt;strong>Yes: 60 (the speed in km/h) is the derivative&lt;/strong> — \( s'(t) = 60 \). It&amp;rsquo;s constant because the speed doesn&amp;rsquo;t change.&lt;/p>
&lt;p>&lt;strong>The graph&lt;/strong> — a straight line. The slope of this line is also 60 — the same number:&lt;/p>
&lt;div style="margin: 1em 0; aspect-ratio: 320/160; min-height: 160px; max-height: 320px; overflow: hidden; border-radius: 8px; background: #1a1a1a;">
&lt;iframe src="https://svfcode.github.io/games/derivative-graph-linear.html" style="width: 100%; height: 100%; border: none; display: block; background: #1a1a1a;" title="Graph of y = 3x − 1" scrolling="no">&lt;/iframe>
&lt;/div>
&lt;hr>
&lt;p>&lt;strong>What if the speed varied?&lt;/strong> First 30 min at 40 km/h, next 30 min at 80 km/h. Total: 20 + 40 = 60 km in 1 h. &lt;strong>Average&lt;/strong> speed is 60 km/h — but at each moment it was either 40 or 80.&lt;/p>
&lt;div style="margin: 1em 0; aspect-ratio: 320/160; min-height: 160px; max-height: 320px; overflow: hidden; border-radius: 8px; background: #1a1a1a;">
&lt;iframe src="https://svfcode.github.io/games/derivative-graph-piecewise.html" style="width: 100%; height: 100%; border: none; display: block; background: #1a1a1a;" title="Graph of s(t) and s'(t): smooth acceleration" scrolling="no">&lt;/iframe>
&lt;/div>
&lt;p>&lt;em>The graph shows a smooth variant: speed increases from 40 to 80 km/h. Green curve — distance s(t), dashed line — derivative s&amp;rsquo;(t) (instantaneous speed).&lt;/em>&lt;/p>
&lt;p>We compute the &lt;strong>instantaneous&lt;/strong> speed (derivative) at several points — using \( \frac{s(t+h) - s(t)}{h} \) with small \( h = 0.1 \) h:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>\( t \) (h)&lt;/th>
&lt;th>\( s(t) \) (km)&lt;/th>
&lt;th>\( s(t+0.1) - s(t) \)&lt;/th>
&lt;th>\( \frac{\Delta s}{\Delta t} \)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>0.1&lt;/td>
&lt;td>4&lt;/td>
&lt;td>4&lt;/td>
&lt;td>&lt;strong>40&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>0.25&lt;/td>
&lt;td>10&lt;/td>
&lt;td>4&lt;/td>
&lt;td>&lt;strong>40&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>0.5&lt;/td>
&lt;td>20&lt;/td>
&lt;td>—&lt;/td>
&lt;td>40 (from left) / &lt;strong>80&lt;/strong> (from right)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>0.75&lt;/td>
&lt;td>40&lt;/td>
&lt;td>8&lt;/td>
&lt;td>&lt;strong>80&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>60&lt;/td>
&lt;td>8&lt;/td>
&lt;td>&lt;strong>80&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>In the first half-hour the derivative is 40 everywhere; in the second, 80. At \( t = 0.5 \) the graph has a &amp;ldquo;kink&amp;rdquo;: slope 40 on the left, 80 on the right. The average 60 is just an average over the whole trip; the derivative tells you the speed &lt;strong>at that exact moment&lt;/strong>.&lt;/p>
&lt;/details>
&lt;h3 id="rules-and-basics">Rules and basic derivative facts&lt;/h3>
&lt;details style="background: rgba(59, 130, 246, 0.08); padding: 0.75em 1em; border-radius: 8px; margin: 0.5em 0; border-left: 3px solid #3b82f6;">
&lt;summary>Main rules and facts&lt;/summary>
&lt;p>&lt;strong>The derivative is the rate of change.&lt;/strong> How fast the function grows (or decreases) for a small shift in the argument. Geometrically — the &lt;strong>slope of the tangent&lt;/strong> to the graph.&lt;/p>
&lt;p>&lt;strong>Sign and behavior:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>\( f'(x) > 0 \) — function is increasing&lt;/li>
&lt;li>\( f'(x) &lt; 0 \) — function is decreasing&lt;/li>
&lt;li>\( f'(x) = 0 \) — possible minimum or maximum (peak, valley)&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Main rules (brief):&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Function&lt;/th>
&lt;th>Derivative&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>\( C \) (constant)&lt;/td>
&lt;td>\( 0 \)&lt;/td>
&lt;td>constant does not change; rate of change is zero&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\( x \)&lt;/td>
&lt;td>\( 1 \)&lt;/td>
&lt;td>linear growth at rate 1&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\( x^n \)&lt;/td>
&lt;td>\( n \cdot x^{n-1} \)&lt;/td>
&lt;td>exponent &amp;ldquo;comes down&amp;rdquo; as factor; power decreases by 1&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\( kx + b \)&lt;/td>
&lt;td>\( k \)&lt;/td>
&lt;td>linear function: slope equals coefficient \( k \)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\( f + g \)&lt;/td>
&lt;td>\( f' + g' \)&lt;/td>
&lt;td>derivative of sum equals sum of derivatives&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>\( C \cdot f \)&lt;/td>
&lt;td>\( C \cdot f' \)&lt;/td>
&lt;td>constant can be factored out of the derivative&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>Examples:&lt;/strong> \( (5)' = 0 \), \( (x^2)' = 2x \), \( (x^3)' = 3x^2 \), \( (7x - 2)' = 7 \).&lt;/p>
&lt;p>&lt;strong>Why it matters in ML:&lt;/strong> training minimizes the loss. The derivative points in the direction of increase; gradient descent moves the opposite way (\( -\nabla L \))&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup> so the loss decreases.&lt;/p>
&lt;details style="background: rgba(16, 185, 129, 0.08); padding: 0.6em 0.9em; border-radius: 6px; margin-top: 0.75em; border-left: 3px solid #10b981;">
&lt;summary>Why \( (x^n)' = n \cdot x^{n-1} \)?&lt;/summary>
&lt;p>For natural \( n \) we can derive from the definition. Example for \( n = 2 \):&lt;/p>
\[
\frac{(x+h)^2 - x^2}{h} = \frac{x^2 + 2xh + h^2 - x^2}{h} = 2x + h \to 2x
\]
&lt;p>As \( h \to 0 \) we get \( (x^2)' = 2x \). For \( n = 3 \): expanding \( (x+h)^3 \), the \( h^2 \) term vanishes in the limit, leaving \( 3x^2 \).&lt;/p>
&lt;p>&lt;strong>Intuition:&lt;/strong> the power \( n \) «comes down» as a multiplier; the exponent drops by 1. Higher power means steeper growth — so the derivative has \( n \) and \( x^{n-1} \).&lt;/p>
&lt;p>&lt;strong>Example: parabola \( y = x^2 \)&lt;/strong> — in detail&lt;/p>
&lt;p>For \( f(x) = x^2 \) the formula gives \( f'(x) = 2x \). Each point has its own slope:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Point \( x \)&lt;/th>
&lt;th>\( f(x) = x^2 \)&lt;/th>
&lt;th>\( f'(x) = 2x \) (slope)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>0&lt;/td>
&lt;td>0&lt;/td>
&lt;td>0&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>1&lt;/td>
&lt;td>2&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2&lt;/td>
&lt;td>4&lt;/td>
&lt;td>&lt;strong>4&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>3&lt;/td>
&lt;td>9&lt;/td>
&lt;td>6&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>4&lt;/td>
&lt;td>16&lt;/td>
&lt;td>&lt;strong>8&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>At \( x = 2 \): the parabola is tangent to a line with slope 4 (tangent \( y = 4x - 4 \) passes through (2, 4)).&lt;br>
At \( x = 4 \): slope is 8 — the parabola is steeper, tangent \( y = 8x - 16 \).&lt;br>
At \( x = 0 \): vertex of the parabola, slope 0 — tangent is horizontal.&lt;/p>
&lt;div style="margin: 0.75em 0; aspect-ratio: 320/240; min-height: 200px; max-height: 400px; overflow: hidden; border-radius: 8px; background: #1a1a1a;">
&lt;iframe src="https://svfcode.github.io/games/derivative-graph-parabola.html" style="width: 100%; height: 100%; border: none; display: block; background: #1a1a1a;" title="Parabola y = x² and tangents" scrolling="no">&lt;/iframe>
&lt;/div>
&lt;p>&lt;em>On the graph:&lt;/em> green curve — \( y = x^2 \); dashed lines — tangents at (2, 4) and (4, 16). Slopes 4 and 8 match \( f'(2) = 4 \), \( f'(4) = 8 \).&lt;/p>
&lt;p>&lt;strong>Example: square&lt;/strong> — \( x \) as side length, area \( A(x) = x^2 \)&lt;/p>
&lt;p>ΔA is the increment (change) of area A. If area is given by function \( A(x) \), then:
&lt;/p>
\[
\Delta A = A(x + \Delta x) - A(x)
\]
&lt;p>
So ΔA is how much area is added when side \( x \) increases by Δx.&lt;/p>
&lt;p>Increase the side by \( \Delta x \). To the original square we add: two &amp;ldquo;strips&amp;rdquo; of area \( x \cdot \Delta x \) (right and top) and a small square \( (\Delta x)^2 \) in the corner. So:
&lt;/p>
\[
\Delta A = 2x \cdot \Delta x + (\Delta x)^2,\quad \frac{\Delta A}{\Delta x} = 2x + \Delta x \to 2x
\]
&lt;p>
as \( \Delta x \to 0 \). Derivative \( A'(x) = 2x \) — for the same \( \Delta x \), larger \( x \) gives more area gain.&lt;/p>
&lt;div style="margin: 0.75em 0; min-height: 360px;">
&lt;iframe src="https://svfcode.github.io/games/derivative-square-area-en.html" style="width: 100%; height: 360px; border: none; display: block; background: #1a1a1a; border-radius: 8px;" title="Square: area and increment">&lt;/iframe>
&lt;/div>
&lt;p>&lt;em>Change x and Δx&lt;/em> — observe how the &amp;ldquo;strips&amp;rdquo; and \( \Delta A / \Delta x \approx 2x \) change.&lt;/p>
&lt;p>It&amp;rsquo;s important to distinguish two cases.&lt;/p>
&lt;p>\( \Delta A/\Delta x \approx 2x \) — yes, this is an approximation. It holds when \( \Delta x \) is small but nonzero. The smaller \( \Delta x \), the more accurate:
&lt;/p>
\[
\frac{\Delta A}{\Delta x} = 2x + \Delta x \approx 2x \quad \text{for small } \Delta x
\]
&lt;p>The formula \( (x^n)' = nx^{n-1} \) — this is not an approximation, but an exact expression. The derivative is defined as the limit:
&lt;/p>
\[
f'(x) = \lim_{\Delta x \to 0} \frac{f(x + \Delta x) - f(x)}{\Delta x}
\]
&lt;p>
We take this limit first, then obtain the exact formula.&lt;/p>
&lt;p>\( \Delta A/\Delta x \) — approximation, because \( \Delta x \) is still finite. \( A'(x) = 2x \) and \( (x^n)' = nx^{n-1} \) — exact formulas, because they are the result of the limit \( \Delta x \to 0 \).&lt;/p>
&lt;p>&lt;em>In short:&lt;/em> approximation applies to finite differences; the derivatives themselves and their formulas are exact.&lt;/p>
&lt;/details>
&lt;details style="background: rgba(16, 185, 129, 0.08); padding: 0.6em 0.9em; border-radius: 6px; margin-top: 0.75em; border-left: 3px solid #10b981;">
&lt;summary>Why \( (C \cdot f)' = C \cdot f' \)?&lt;/summary>
&lt;p>The constant can be factored out of the derivative because it does not depend on \( x \) and merely scales the rate of change of the function.&lt;/p>
&lt;p>&lt;strong>From the definition:&lt;/strong>
&lt;/p>
\[
(C \cdot f)'(x) = \lim_{h \to 0} \frac{C \cdot f(x+h) - C \cdot f(x)}{h} = C \cdot \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} = C \cdot f'(x)
\]
&lt;p>The constant \( C \) does not depend on \( h \), so it can be taken outside the limit.&lt;/p>
&lt;p>&lt;strong>Examples:&lt;/strong> \( (5x^2)' = 5 \cdot 2x = 10x \), \( (-3x^3)' = -3 \cdot 3x^2 = -9x^2 \).&lt;/p>
&lt;/details>
&lt;/details>
&lt;p>&lt;em>Now a few numerical examples.&lt;/em>&lt;/p>
&lt;h3 id="numerical-example-linear-function">Numerical example: linear function \( g(x) = 3x - 1 \)&lt;/h3>
&lt;details style="background: rgba(59, 130, 246, 0.08); padding: 0.75em 1em; border-radius: 8px; margin: 0.5em 0; border-left: 3px solid #3b82f6;">
&lt;summary>Numerical example: linear function \( g(x) = 3x - 1 \)&lt;/summary>
&lt;p>For a straight line the slope is the same everywhere. At any point, e.g. \( x = 5 \):&lt;/p>
\[
\frac{g(5 + h) - g(5)}{h} = \frac{(3(5+h) - 1) - g(5)}{h} = \frac{14 + 3h - 14}{h} = \frac{3h}{h} = 3
\]
&lt;p>
where \( g(5) = 3 \cdot 5 - 1 = 14 \).&lt;/p>
&lt;p>For any \( h \neq 0 \) we get &lt;strong>3&lt;/strong> — the derivative is constant, same as the coefficient of \( x \) in the line equation.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>\( x \)&lt;/th>
&lt;th>\( g(x) \)&lt;/th>
&lt;th>\( g(x+0.1) - g(x) \)&lt;/th>
&lt;th>\( \frac{g(x+0.1)-g(x)}{0.1} \)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>5&lt;/td>
&lt;td>14&lt;/td>
&lt;td>0.3&lt;/td>
&lt;td>3&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>10&lt;/td>
&lt;td>29&lt;/td>
&lt;td>0.3&lt;/td>
&lt;td>3&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>-2&lt;/td>
&lt;td>-7&lt;/td>
&lt;td>0.3&lt;/td>
&lt;td>3&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;div style="margin: 1em 0; aspect-ratio: 320/160; min-height: 160px; max-height: 320px; overflow: hidden; border-radius: 8px; background: #1a1a1a;">
&lt;iframe src="https://svfcode.github.io/games/derivative-graph-linear.html" style="width: 100%; height: 100%; border: none; display: block; background: #1a1a1a;" title="Graph of y = 3x − 1" scrolling="no">&lt;/iframe>
&lt;/div>
&lt;/details>
&lt;h3 id="numerical-example-quadratic-function">Numerical example: quadratic function \( f(x) = x^2 \)&lt;/h3>
&lt;details style="background: rgba(59, 130, 246, 0.08); padding: 0.75em 1em; border-radius: 8px; margin: 0.5em 0; border-left: 3px solid #3b82f6;">
&lt;summary>Numerical example: quadratic function \( f(x) = x^2 \)&lt;/summary>
&lt;p>Approximate the derivative at \( x = 2 \) using &amp;ldquo;change in \( f \) over change in \( x \)&amp;rdquo;. Take a small step \( h \):&lt;/p>
\[
\frac{f(2 + h) - f(2)}{h} = \frac{(2+h)^2 - 4}{h}
\]
&lt;p>&lt;strong>At \( x = 2 \)&lt;/strong> (\( f(2) = 4 \)):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>\( h \)&lt;/th>
&lt;th>\( f(2+h) \)&lt;/th>
&lt;th>\( f(2+h) - f(2) \)&lt;/th>
&lt;th>\( \frac{f(2+h)-f(2)}{h} \)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>9&lt;/td>
&lt;td>5&lt;/td>
&lt;td>5&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>0.1&lt;/td>
&lt;td>4.41&lt;/td>
&lt;td>0.41&lt;/td>
&lt;td>4.1&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>0.01&lt;/td>
&lt;td>4.0401&lt;/td>
&lt;td>0.0401&lt;/td>
&lt;td>4.01&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>0.001&lt;/td>
&lt;td>4.0004…&lt;/td>
&lt;td>0.004…&lt;/td>
&lt;td>4.001&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The ratio tends to &lt;strong>4&lt;/strong> → \( f'(2) = 4 \).&lt;/p>
&lt;p>&lt;strong>At \( x = 4 \)&lt;/strong> (\( f(4) = 16 \)):&lt;/p>
\[
\frac{f(4 + h) - f(4)}{h} = \frac{(4+h)^2 - 16}{h} = \frac{8h + h^2}{h} = 8 + h \to 8
\]
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>\( h \)&lt;/th>
&lt;th>\( f(4+h) \)&lt;/th>
&lt;th>\( f(4+h) - f(4) \)&lt;/th>
&lt;th>\( \frac{f(4+h)-f(4)}{h} \)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>25&lt;/td>
&lt;td>9&lt;/td>
&lt;td>9&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>0.1&lt;/td>
&lt;td>16.81&lt;/td>
&lt;td>0.81&lt;/td>
&lt;td>8.1&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>0.01&lt;/td>
&lt;td>16.0801&lt;/td>
&lt;td>0.0801&lt;/td>
&lt;td>8.01&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The ratio tends to &lt;strong>8&lt;/strong> → \( f'(4) = 8 \). By \( (x^2)' = 2x \): at \( x = 2 \) we get 4, at \( x = 4 \) — 8. For a curve, the derivative is different at each point.&lt;/p>
&lt;div style="margin: 1em 0; aspect-ratio: 320/240; min-height: 240px; max-height: 480px; overflow: hidden; border-radius: 8px; background: #1a1a1a;">
&lt;iframe src="https://svfcode.github.io/games/derivative-graph-parabola.html" style="width: 100%; height: 100%; border: none; display: block; background: #1a1a1a;" title="Graph of y = x² and tangent" scrolling="no">&lt;/iframe>
&lt;/div>
&lt;p>&lt;strong>Why it matters in ML:&lt;/strong> training is minimization of the loss function. We need to know which direction to change the weights so that the loss decreases. The derivative points in the direction of increase; we go the opposite way so the loss drops.&lt;/p>
&lt;/details>
&lt;h3 id="interactive-exercise">Interactive exercise&lt;/h3>
&lt;details style="background: rgba(59, 130, 246, 0.08); padding: 0.75em 1em; border-radius: 8px; margin: 0.5em 0; border-left: 3px solid #3b82f6;">
&lt;summary>Car and Bezier curve&lt;/summary>
&lt;p>&lt;strong>1. Car.&lt;/strong> Change the speed — the distance graph \( s(t) \) and derivative table update. Derivative \( s'(t) \) = speed (constant for uniform motion).&lt;/p>
&lt;div style="margin: 1em 0; min-height: 380px; overflow: hidden; border-radius: 8px; background: #1a1a1a;">
&lt;iframe src="https://svfcode.github.io/games/derivative-car-interactive-en.html" style="width: 100%; height: 420px; border: none; display: block; background: #1a1a1a;" title="Car: speed and derivative" scrolling="no">&lt;/iframe>
&lt;/div>
&lt;p>&lt;strong>2. Draw a Bezier curve.&lt;/strong> Drag 4 control points — a cubic Bezier curve is built. Place the orange point on the curve — the derivative calculation appears on the right.&lt;/p>
&lt;div style="margin: 1em 0; min-height: 420px; overflow: hidden; border-radius: 8px; background: #1a1a1a;">
&lt;iframe src="https://svfcode.github.io/games/derivative-draw-curve-en.html" style="width: 100%; height: 520px; border: none; display: block; background: #1a1a1a;" title="Bezier curve and derivative" scrolling="no">&lt;/iframe>
&lt;/div>
&lt;/details>
&lt;h3 id="self-check-tasks">Self-check tasks&lt;/h3>
&lt;details style="background: rgba(59, 130, 246, 0.08); padding: 0.75em 1em; border-radius: 8px; margin: 0.5em 0; border-left: 3px solid #3b82f6;">
&lt;summary>Tasks with hints and verification&lt;/summary>
&lt;p>Solve the tasks. Open the hint if needed. Enter your answer and click &amp;ldquo;Check&amp;rdquo;.&lt;/p>
&lt;div style="margin: 0.5em 0; min-height: 480px;">
&lt;iframe src="https://svfcode.github.io/games/derivative-selfcheck-en.html" style="width: 100%; height: 480px; border: none; display: block; background: #1a1a1a; border-radius: 6px;" title="Self-check tasks">&lt;/iframe>
&lt;/div>
&lt;/details>
&lt;h2 id="summary">Summary&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Derivative&lt;/strong> — rate of change, direction of increase&lt;/li>
&lt;li>&lt;strong>Partial derivative&lt;/strong> — with respect to one variable, others fixed&lt;/li>
&lt;li>&lt;strong>Gradient&lt;/strong> — vector of partial derivatives, direction of steepest increase&lt;/li>
&lt;li>&lt;strong>Chain rule&lt;/strong> — how to compute derivatives along a chain of layers&lt;/li>
&lt;li>&lt;strong>Gradient descent&lt;/strong> — update weights in the \( -\nabla L \) direction &lt;sup id="fnref1:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>&lt;/li>
&lt;/ul>
&lt;p>PyTorch, TensorFlow, etc. compute gradients automatically (autograd) — but understanding what happens under the hood helps when you hit «exploding gradients» or «model won&amp;rsquo;t learn».&lt;/p>
&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>\( \nabla L \) — the gradient of the loss (vector of partial derivatives). It points in the direction of steepest increase of \( L \). So \( -\nabla L \) is the direction of steepest decrease; we move that way in gradient descent.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&amp;#160;&lt;a href="#fnref1:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description></item><item><title>Math Analysis — Example of Analysis (Finding πr²)</title><link>https://svfcode.github.io/en/p/math-circle-area/</link><pubDate>Thu, 12 Mar 2026 00:00:00 +0000</pubDate><guid>https://svfcode.github.io/en/p/math-circle-area/</guid><description>&lt;p>How do we find the area of a circle &lt;strong>analytically&lt;/strong>?&lt;/p>
&lt;h2 id="slicing-into-rectangles">Slicing into Rectangles&lt;/h2>
&lt;p>&lt;strong>Idea:&lt;/strong> slice the circle into thin concentric rings and «unroll» each ring into a rectangle.&lt;/p>
&lt;p>A ring of radius r and width Δr has circumference 2πr. Unrolled, it becomes a rectangle:&lt;/p>
&lt;ul>
&lt;li>length: 2πr&lt;/li>
&lt;li>width: Δr&lt;/li>
&lt;li>area: 2πr · Δr&lt;/li>
&lt;/ul>
&lt;p>The total area is the sum of all such rings, from r = 0 to r = R. The smaller Δr, the better the approximation.&lt;/p>
&lt;svg viewBox="0 0 360 200" xmlns="http://www.w3.org/2000/svg" style="max-width: 360px; display: block; margin: 1em 0;">
&lt;defs>
&lt;linearGradient id="ring-en" x1="0%" y1="0%" x2="100%" y2="0%">
&lt;stop offset="0%" stop-color="#3b82f6"/>
&lt;stop offset="100%" stop-color="#60a5fa"/>
&lt;/linearGradient>
&lt;/defs>
&lt;circle cx="100" cy="100" r="85" fill="none" stroke="#4b5563" stroke-width="1"/>
&lt;path d="M 100 15 A 85 85 0 0 1 185 100 A 85 85 0 0 1 100 185 A 85 85 0 0 1 15 100 A 85 85 0 0 1 100 15" fill="url(#ring-en)" fill-opacity="0.12" stroke="#60a5fa" stroke-width="1.5"/>
&lt;path d="M 100 30 A 70 70 0 0 1 170 100 A 70 70 0 0 1 100 170 A 70 70 0 0 1 30 100 A 70 70 0 0 1 100 30" fill="url(#ring-en)" fill-opacity="0.2" stroke="#60a5fa" stroke-width="1.5"/>
&lt;path d="M 100 45 A 55 55 0 0 1 155 100 A 55 55 0 0 1 100 155 A 55 55 0 0 1 45 100 A 55 55 0 0 1 100 45" fill="url(#ring-en)" fill-opacity="0.28" stroke="#60a5fa" stroke-width="1.5"/>
&lt;path d="M 100 60 A 40 40 0 0 1 140 100 A 40 40 0 0 1 100 140 A 40 40 0 0 1 60 100 A 40 40 0 0 1 100 60" fill="url(#ring-en)" fill-opacity="0.35" stroke="#60a5fa" stroke-width="1.5"/>
&lt;path d="M 100 75 A 25 25 0 0 1 125 100 A 25 25 0 0 1 100 125 A 25 25 0 0 1 75 100 A 25 25 0 0 1 100 75" fill="url(#ring-en)" fill-opacity="0.5" stroke="#60a5fa" stroke-width="1.5"/>
&lt;circle cx="100" cy="100" r="12" fill="#1e3a5f" stroke="#3b82f6" stroke-width="2"/>
&lt;line x1="100" y1="100" x2="100" y2="30" stroke="#f59e0b" stroke-width="2" stroke-dasharray="4 2"/>
&lt;text x="115" y="60" font-size="14" fill="#f59e0b">R&lt;/text>
&lt;text x="100" y="108" font-size="12" fill="#e5e7eb" text-anchor="middle">r=0&lt;/text>
&lt;text x="250" y="100" font-size="13" fill="#9ca3af">Rings r = 0 … R&lt;/text>
&lt;/svg>
&lt;p>If we arrange these cut strips (each of length 2πr) on a graph from left to right — from r = 0 to r = R — we get a triangle. Base R, height 2πR: the area of the triangle is ½ · R · 2πR = πR².&lt;/p>
&lt;svg viewBox="0 0 320 220" xmlns="http://www.w3.org/2000/svg" style="max-width: 320px; display: block; margin: 1em 0;">
&lt;defs>
&lt;linearGradient id="strip-en" x1="0%" y1="0%" x2="100%" y2="0%">
&lt;stop offset="0%" stop-color="#3b82f6"/>
&lt;stop offset="100%" stop-color="#60a5fa"/>
&lt;/linearGradient>
&lt;/defs>
&lt;!-- Axes -->
&lt;line x1="40" y1="180" x2="260" y2="180" stroke="#6b7280" stroke-width="1.5"/>
&lt;line x1="40" y1="180" x2="40" y2="20" stroke="#6b7280" stroke-width="1.5"/>
&lt;!-- Strips: height 2πr at left edge (not above the line), width Δr -->
&lt;rect x="40" y="172" width="22" height="8" fill="url(#strip-en)" fill-opacity="0.6" stroke="#60a5fa" stroke-width="1"/>
&lt;rect x="62" y="164" width="22" height="16" fill="url(#strip-en)" fill-opacity="0.6" stroke="#60a5fa" stroke-width="1"/>
&lt;rect x="84" y="148" width="22" height="32" fill="url(#strip-en)" fill-opacity="0.6" stroke="#60a5fa" stroke-width="1"/>
&lt;rect x="106" y="132" width="22" height="48" fill="url(#strip-en)" fill-opacity="0.6" stroke="#60a5fa" stroke-width="1"/>
&lt;rect x="128" y="116" width="22" height="64" fill="url(#strip-en)" fill-opacity="0.6" stroke="#60a5fa" stroke-width="1"/>
&lt;rect x="150" y="100" width="22" height="80" fill="url(#strip-en)" fill-opacity="0.6" stroke="#60a5fa" stroke-width="1"/>
&lt;rect x="172" y="84" width="22" height="96" fill="url(#strip-en)" fill-opacity="0.6" stroke="#60a5fa" stroke-width="1"/>
&lt;rect x="194" y="68" width="22" height="112" fill="url(#strip-en)" fill-opacity="0.6" stroke="#60a5fa" stroke-width="1"/>
&lt;rect x="216" y="52" width="22" height="128" fill="url(#strip-en)" fill-opacity="0.6" stroke="#60a5fa" stroke-width="1"/>
&lt;rect x="238" y="36" width="22" height="144" fill="url(#strip-en)" fill-opacity="0.6" stroke="#60a5fa" stroke-width="1"/>
&lt;!-- Line 2πr (from r=0 to r=R) -->
&lt;line x1="40" y1="180" x2="260" y2="20" stroke="#f59e0b" stroke-width="2"/>
&lt;text x="270" y="185" font-size="14" fill="#9ca3af">r&lt;/text>
&lt;text x="25" y="35" font-size="14" fill="#9ca3af" text-anchor="end">2πr&lt;/text>
&lt;text x="255" y="195" font-size="12" fill="#f59e0b">R&lt;/text>
&lt;text x="35" y="45" font-size="12" fill="#f59e0b" text-anchor="end">2πR&lt;/text>
&lt;text x="150" y="110" font-size="12" fill="#9ca3af" text-anchor="middle">½·R·2πR = πR²&lt;/text>
&lt;/svg>
&lt;p>&lt;strong>Result:&lt;/strong> area of the circle S = πR². The same approach — slicing a shape into «small pieces», summing their areas, and taking the limit — underlies integral calculus and, as we will see, leads to derivatives.&lt;/p></description></item></channel></rss>