Limits • Derivatives • Integrals • Trigonometric Functions • Series • Proofs • GNU Octave Examples • Applications including Cryptography
Self-contained HTML5 Tutorial • Comprehensive & Complete
Calculus is the mathematical study of continuous change. It consists of two main branches:
The Fundamental Theorem of Calculus links them.
Developed independently by Isaac Newton and Gottfried Wilhelm Leibniz in the late 17th century.
The limit of \( f(x) \) as \( x \) approaches \( a \) is \( L \), written:
\( \lim_{x \to a} f(x) = L \) if for every \( \epsilon > 0 \), there exists \( \delta > 0 \) such that if \( 0 < |x - a| < \delta \), then \( |f(x) - L| < \epsilon \).
| Rule | Expression |
|---|---|
| Sum | \( \lim (f+g) = \lim f + \lim g \) |
| Product | \( \lim (f \cdot g) = (\lim f)(\lim g) \) |
| Quotient | \( \lim \frac{f}{g} = \frac{\lim f}{\lim g} \) (g ≠ 0) |
A function is continuous at \( a \) if \( \lim_{x\to a} f(x) = f(a) \).
The derivative of \( f \) at \( x \) is:
Velocity, acceleration, optimization, related rates.
Proof of \( (\sin x)' = \cos x \) uses limit \( \lim_{h\to0} \frac{\sin h}{h} = 1 \) and angle addition.
\( \sin^2 x = \frac{1 - \cos 2x}{2} \), \( \int \sec x \, dx = \ln|\sec x + \tan x| + C \)
The definite integral from a to b:
Part 1: If \( F(x) = \int_a^x f(t) dt \), then \( F'(x) = f(x) \).
Part 2: \( \int_a^b f(x) dx = F(b) - F(a) \) where \( F' = f \).
Taylor Series for \( f(x) \) around a:
Octave is a free MATLAB-compatible language. Install from octave.org.
% octave script: trig_deriv.m
x = linspace(-2*pi, 2*pi, 200);
y = sin(x);
dy = cos(x);
plot(x, y, 'b-', 'linewidth', 2);
hold on;
plot(x, dy, 'r--', 'linewidth', 2);
legend('sin(x)', 'cos(x) = d(sin)/dx');
xlabel('x'); ylabel('y');
title('Trigonometric Derivative');
grid on;
function I = trap_integral(f, a, b, n)
h = (b-a)/n;
x = a:h:b;
y = f(x);
I = h/2 * (y(1) + 2*sum(y(2:end-1)) + y(end));
end
f = @(x) sin(x).^2; % example
area = trap_integral(f, 0, pi, 1000);
disp(['Integral ≈ ', num2str(area)]); % Should be near π/2
function root = newton(f, df, x0, tol=1e-8, maxit=50)
for i = 1:maxit
x1 = x0 - f(x0)/df(x0);
if abs(x1 - x0) < tol
root = x1; return;
end
x0 = x1;
end
root = x0;
end
f = @(x) x.^3 - 2*x - 5;
df = @(x) 3*x.^2 - 2;
root = newton(f, df, 2)
Calculus appears in several cryptographic contexts:
% Slope of tangent to y^2 = x^3 + ax + b at point (x1,y1)
a = -3; % curve parameter example
x1 = 2; y1 = 3;
slope = (3*x1^2 + a) / (2*y1); % derivative implicit
disp(slope);
Using angle addition:
Since \( \lim \frac{\sin h}{h} = 1 \), \( \lim \frac{1-\cos h}{h} = 0 \), result is \( \cos x \).
If f continuous on [a,b], differentiable on (a,b), then ∃ c ∈ (a,b) s.t. f'(c) = [f(b)-f(a)]/(b-a).