Calculus in Technical Documentation — Derivatives and Integrals
Master calculus notation in technical docs with KaTeX. Learn derivatives, integrals, limits, and differential equations for software, physics, and engineering documentation.
Introduction
Calculus is the mathematical foundation for describing change and accumulation. Whether you're documenting machine learning algorithms, physics simulations, financial models, or engineering systems, calculus notation appears everywhere in technical documentation.
This guide covers how to express derivatives, integrals, limits, and differential equations using KaTeX in your technical documentation. You'll learn the standard notation conventions and see practical examples from software engineering, physics, and data science.
Derivatives
Derivatives measure the rate of change of a function. There are several notation styles, each suited to different contexts in technical documentation.
Leibniz Notation
Leibniz notation explicitly shows the variable of differentiation, making it ideal for physics and engineering documentation where multiple variables are involved.
Leibniz Notation
Standard derivative notation showing the variable of differentiation
First derivative:
dxdySecond derivative:
dx2d2ynth derivative:
dxndnyDerivative of a specific function:
dxd(x3+2x)=3x2+2Prime Notation (Lagrange)
Prime notation is compact and commonly used in pure mathematics and algorithm analysis where the independent variable is clear from context.
Prime Notation
Compact notation for derivatives
First derivative: f′(x)
Second derivative: f′′(x)
Third derivative: f′′′(x)
Higher derivatives: f(n)(x)
Example - velocity and acceleration:
Position: s(t),Velocity: s′(t),Acceleration: s′′(t)Dot Notation (Newton)
Dot notation is standard in physics for time derivatives, particularly in mechanics and dynamics.
Dot Notation
Time derivatives in physics notation
First time derivative: x˙
Second time derivative: x¨
Newton's second law:
F=mx¨Velocity and acceleration:
v=x˙,a=x¨Operator Notation
The differential operator D is useful when discussing derivatives abstractly or in differential equations.
Operator Notation
Differential operator D
Differential operator:
D=dxdApplied to a function:
Df=dxdf,D2f=dx2d2fLinear differential equation:
(D2+3D+2)y=0Partial Derivatives
Partial derivatives are essential for documenting multivariable functions, which appear frequently in machine learning (gradient descent), physics (field equations), and optimization problems.
Partial Derivative Notation
Derivatives with respect to one variable while holding others constant
First partial derivatives:
∂x∂f,∂y∂fSecond partial derivatives:
∂x2∂2f,∂y2∂2fMixed partial derivatives:
∂x∂y∂2fExample - gradient of a function:
f(x,y)=x2+xy+y2 ∇f=(∂x∂f,∂y∂f)=(2x+y,x+2y)Subscript Notation
Subscript notation is a compact alternative commonly used in physics and engineering documentation.
Subscript Notation for Partials
Compact notation using subscripts
Partial derivatives:
fx=∂x∂f,fy=∂y∂fSecond partials:
fxx=∂x2∂2f,fxy=∂x∂y∂2fHeat equation example:
ut=αuxxGradient, Divergence, and Curl
Vector calculus operators are fundamental in physics documentation, particularly for electromagnetic fields, fluid dynamics, and machine learning optimization.
Vector Calculus Operators
Gradient, divergence, curl, and Laplacian
Gradient (scalar to vector):
∇f=(∂x∂f,∂y∂f,∂z∂f)Divergence (vector to scalar):
∇⋅F=∂x∂Fx+∂y∂Fy+∂z∂FzCurl (vector to vector):
∇×F=i^∂x∂Fxj^∂y∂Fyk^∂z∂FzLaplacian:
∇2f=∂x2∂2f+∂y2∂2f+∂z2∂2fIntegrals
Integrals represent accumulation and are used extensively in probability theory, physics, and signal processing documentation.
Indefinite Integrals
Indefinite Integrals
Antiderivatives without bounds
Basic indefinite integral:
∫f(x)dxPower rule:
∫xndx=n+1xn+1+C(n=−1)Exponential:
∫exdx=ex+CTrigonometric:
∫sin(x)dx=−cos(x)+C\, before dx to add proper spacing: $\int f(x) \, dx$ looks better than $\int f(x) dx$.Definite Integrals
Definite Integrals
Integrals with bounds
Definite integral:
∫abf(x)dxFundamental theorem of calculus:
∫abf′(x)dx=f(b)−f(a)Area under a curve:
A=∫02x2dx=[3x3]02=38Probability density:
P(a≤X≤b)=∫abf(x)dxMultiple Integrals
Multiple Integrals
Double and triple integrals
Double integral:
∬Df(x,y)dATriple integral:
∭Vf(x,y,z)dVIterated integral:
∫01∫0xxydydxVolume calculation:
V=∬Rf(x,y)dA=∫ab∫cdf(x,y)dydxLine and Surface Integrals
Line and Surface Integrals
Integrals over curves and surfaces
Line integral (scalar):
∫CfdsLine integral (vector):
∫CF⋅drClosed line integral:
∮CF⋅drSurface integral:
∬SF⋅dSClosed surface integral:
∬SF⋅dSLimits
Limits are foundational to calculus and appear in algorithm complexity analysis, convergence proofs, and asymptotic behavior documentation.
Limit Notation
Various limit expressions
Basic limit:
x→alimf(x)One-sided limits:
x→a+limf(x),x→a−limf(x)Limit at infinity:
x→∞limx1=0Limit definition of derivative:
f′(x)=h→0limhf(x+h)−f(x)Limit definition of e:
e=n→∞lim(1+n1)nLimits in Series
Series and Sequences
Limits in infinite series
Sequence limit:
n→∞liman=LInfinite series:
n=1∑∞an=N→∞limn=1∑NanGeometric series:
n=0∑∞rn=1−r1(∣r∣<1)Taylor series:
f(x)=n=0∑∞n!f(n)(a)(x−a)nDifferential Equations
Differential equations model dynamic systems and appear throughout physics, engineering, and computational science documentation.
Ordinary Differential Equations
ODEs
Ordinary differential equations
First-order ODE:
dxdy=f(x,y)Second-order ODE:
dx2d2y+p(x)dxdy+q(x)y=g(x)Simple harmonic oscillator:
dt2d2x+ω2x=0Solution:
x(t)=Acos(ωt)+Bsin(ωt)Partial Differential Equations
PDEs
Partial differential equations
Heat equation:
∂t∂u=α∇2uWave equation:
∂t2∂2u=c2∇2uLaplace equation:
∇2ϕ=0Schrödinger equation:
iℏ∂t∂Ψ=−2mℏ2∇2Ψ+VΨApplications in Technical Documentation
Here are practical examples of calculus notation in common technical documentation scenarios.
Machine Learning: Gradient Descent
Gradient Descent Algorithm
Optimization in machine learning
Gradient Descent Update Rule
The parameters θ are updated iteratively:
θn+1=θn−α∇J(θn)where:
- α is the learning rate
- ∇J(θ) is the gradient of the cost function
For a single parameter:
θn+1=θn−α∂θ∂JCost Function Gradient
For mean squared error:
J(θ)=2m1i=1∑m(hθ(x(i))−y(i))2 ∂θj∂J=m1i=1∑m(hθ(x(i))−y(i))xj(i)Physics: Kinematics
Kinematics Equations
Motion equations in physics
Position, Velocity, and Acceleration
Position as a function of time:
x(t)Velocity (first derivative of position):
v(t)=dtdx=x˙Acceleration (second derivative of position):
a(t)=dtdv=dt2d2x=x¨Constant Acceleration
v(t)x(t)v2=v0+at=x0+v0t+21at2=v02+2a(x−x0)Statistics: Probability Distributions
Probability Distributions
Continuous probability with integrals
Probability Density Function
For a continuous random variable X:
P(a≤X≤b)=∫abf(x)dxNormal Distribution
f(x)=σ2π1e−2σ2(x−μ)2Expected Value
E[X]=∫−∞∞x⋅f(x)dxVariance
Var(X)=E[X2]−(E[X])2=∫−∞∞(x−μ)2f(x)dxAlgorithm Analysis: Big O
Algorithm Complexity
Calculus in complexity analysis
Asymptotic Analysis
Big O notation using limits:
f(n)=O(g(n))⟺n→∞limg(n)f(n)<∞Summation to Integral Approximation
For large n:
i=1∑nf(i)≈∫1nf(x)dxExample - sum of squares:
i=1∑ni2≈∫1nx2dx=3n3=O(n3)Stirling's Approximation
n!≈2πn(en)n ln(n!)≈nln(n)−nBest Practices
aligned environment to align equals signs, making the logic flow clear.\text{}: $v = 10 \text{ m/s}$Common Mistakes
\, before differentials. Write $\int f(x) \, dx$ not $\int f(x)dx$.\partial for partial derivatives, not d. Write $\frac{\partial f}{\partial x}$ not $\frac{df}{dx}$ for multivariable functions.$\lim_x \to 0$ not just $\lim$, and $\sum_i=1^n$ not just $\sum$.$\vec{v}$, $\mathbf{v}$, or bold. Don't mix them in the same document.$\sin(x)$ not $\sin x$ when the argument is complex. This prevents ambiguity in expressions like $\sin(x+y)$.Quick Reference
| Operation | KaTeX Syntax | Result |
|---|---|---|
| Derivative (Leibniz) | \frac{dy}{dx} | $\frac{dy}{dx}$ |
| Derivative (Prime) | f'(x) | $f'(x)$ |
| Partial Derivative | \frac\partial f{\partial x} | $\frac\partial f{\partial x}$ |
| Gradient | \nabla f | $\nabla f$ |
| Indefinite Integral | \int f(x) \, dx | $\int f(x) \, dx$ |
| Definite Integral | \int_{a}^{b} f(x) \, dx | $\int_{a}^{b} f(x) \, dx$ |
| Double Integral | \iint_D f \, dA | $\iint_D f \, dA$ |
| Limit | \lim_{x \to a} f(x) | $\lim_{x \to a} f(x)$ |
| Time Derivative | \dot{x}, \ddot{x} | $\dot{x}$, $\ddot{x}$ |
| Laplacian | \nabla^2 f | $\nabla^2 f$ |
Related Content
KaTeX Syntax Quick Reference — Math Equations in Markdown
Complete reference for KaTeX mathematical notation including common formulas, symbols, and usage patterns for technical documentation.
Using KaTeX in AutEng
Practical guide to integrating mathematical equations in your documentation
Physics Equations and Diagrams — Documenting Scientific Concepts
Complete guide to documenting physics concepts with KaTeX equations, Mermaid diagrams, and scientific notation
Set Theory and Logic Notation — Mathematical Foundations
Complete guide to set theory and logic notation in technical documentation. Learn sets, operations, logic symbols, quantifiers, and proof notation with KaTeX.
Ready to Start?
Start creating beautiful technical documentation with AutEng.
Get Started with AutEng