Foundations of CalculusIntroductionCalculus is the mathematics of change and accumulation. In information technology, systems rarely remain static: network traffic varies over time, query latency responds to workload, storage grows, and machine-learning models are adjusted to reduce error. Calculus provides a precise language for describing these changes. The central ideas are: - Limits, which describe behaviour near a point;
- Continuity, which formalises smooth dependence;
- Derivatives, which measure instantaneous change;
- Integrals, which measure accumulated quantity.
These ideas support performance modelling, optimisation, simulation, data analysis and machine learning. Calculus does not replace measurement or engineering judgement. Rather, it supplies models whose assumptions must be checked against real data. Learning ObjectivesBy the end of this chapter, you should be able to: - Explain limits and continuity using graphs, tables and algebra.
- Calculate derivatives using definitions and standard rules.
- Interpret derivatives as rates of change and slopes.
- Use derivatives to locate and classify extrema.
- Evaluate definite and indefinite integrals.
- Apply the Fundamental Theorem of Calculus to accumulation problems.
- Model IT performance and machine-learning optimisation using calculus.
- Recognise assumptions, numerical limitations and ethical risks in quantitative models.
1. Functions as Models of IT SystemsA function assigns each permitted input exactly one output. We write y = f(x), where x is the independent variable and y is the dependent variable. For example, L(r) might represent average response latency as a function of request rate r. The domain is the set of valid inputs; the range is the set of resulting outputs. Units matter. If r is measured in requests per second and L(r) in milliseconds, then the derivative L'(r) has units of milliseconds per request per second, more precisely ms/(request·s⁻¹). A formula should not be interpreted outside the conditions under which it was estimated. Common functions include: | Function | Form | Typical IT interpretation |
|---|
| Linear | f(x)=a+bx | fixed overhead plus cost proportional to workload | | Polynomial | f(x)=a0+a1x+...+anxn | approximation over a limited range | | Exponential | f(t)=Aekt | growth, decay or repeated percentage change | | Logarithmic | f(x)=a+b\ln x | diminishing gains from additional resources | | Rational | f(x)=p(x)/q(x) | ratios such as throughput per resource |
A model is useful only when its domain, units and assumptions are explicit. 2. Limits and Continuity2.1 The idea of a limitThe limit of f(x) as x approaches a is the value approached by f(x); it need not equal f(a). We write \limx\to af(x)=L. The function may be undefined at a while still having a limit there. For example, for f(x)=(x2-1)/(x-1), direct substitution at x=1 gives an undefined expression. Factoring for x\ne1 gives f(x)=x+1, so: limx→1 (x² − 1)/(x − 1) = limx→1(x + 1) = 2 The cancellation is valid only for x\ne1, but it correctly describes the limiting behaviour. A two-sided limit exists when the left-hand and right-hand limits agree: limx→a f(x) exists ⇔ limx→a⁻ f(x) = limx→a⁺ f(x) If the two one-sided limits differ, the two-sided limit does not exist. Infinite limits describe unbounded behaviour, such as a denominator approaching zero while the numerator remains nonzero. 2.2 Formal definitionFor a finite limit, \limx\to af(x)=L means that for every \varepsilon>0, there exists \delta>0 such that whenever 0<|x-a|<\delta, then |f(x)-L|<\varepsilon. This definition formalises the idea that sufficiently close inputs produce outputs as close to L as required. In practical computing, limits are often estimated using sampled data. Sampling resolution, noise and rounding mean that an apparent limit may be an empirical approximation rather than a proven mathematical fact. 2.3 ContinuityA function is continuous at a if: - f(a) is defined;
- \limx\to af(x) exists;
- \limx\to af(x)=f(a).
Polynomials, exponentials and logarithms are continuous on their natural domains. A rational function is continuous wherever its denominator is nonzero. Discontinuities can be removable, jump discontinuities or infinite discontinuities. Continuity is important in modelling because small input changes then produce small output changes. However, software systems can have thresholds: a cache may fit until memory is exceeded, or a queue may become unstable beyond a capacity. Such transitions may create discontinuities or sharp changes that a smooth model hides. 3. The Derivative3.1 Definition and interpretationThe derivative of f(x) at x is defined, when the limit exists, by: f′(x) = limh→0 [f(x + h) − f(x)]/h Here h is a nonzero change in the input. The quotient is the average rate of change over an interval; its limit is the instantaneous rate of change. Geometrically, f'(x) is the slope of the tangent line. The tangent line at x=a is: y = f(a) + f′(a)(x − a) This is a local linear approximation. It is reliable near a when the function is sufficiently smooth, but may be poor over a large interval. 3.2 Derivative rulesFor differentiable functions and constants c and n: | Rule | Formula | Condition |
|---|
| Constant | d(c)/dx=0 | c does not depend on x | | Power | d(xn)/dx=nxn−1 | applicable on the function’s domain | | Sum | (f+g)'=f'+g' | both derivatives exist | | Product | (fg)'=f'g+fg' | both functions differentiable | | Quotient | (f/g)'=(f'g−fg')/g2 | g\ne0 | | Chain | d f(g(x))/dx=f'(g(x))g'(x) | inner and outer derivatives exist |
Important special derivatives include: (d/dx)ex = ex, (d/dx) ln x = 1/x (x > 0), (d/dx) sin x = cos x, (d/dx) cos x = −sin x For ekx, where k is constant, the derivative is kekx. Worked Example 1: Derivative of a performance modelSuppose an estimated processing time is T(n) = 0.002n² + 4n + 50 where n is the number of records and T(n) is measured in milliseconds. The model is meaningful only over the workload range for which it was fitted. By the sum and power rules: T′(n) = 0.004n + 4 At n=500, T'(500)=6 ms per additional record, according to the model. The derivative is a marginal estimate, not the total processing time. The predicted time is T(500)=0.002(250000)+2000+50=2550 ms. 4. Applications of Derivatives4.1 Increasing and decreasing behaviourIf f'(x)>0 throughout an interval, f is increasing there; if f'(x)<0, it is decreasing. A critical point occurs where f'(x)=0 or where f'(x) is undefined, provided the point lies in the domain. For a closed interval [a,b], global extrema can occur at critical points or endpoints. Therefore, optimisation requires checking all candidates, not just solving f'(x)=0. The second-derivative test states that if f'(c)=0 and: - f''(c)>0, f has a local minimum at c;
- f''(c)<0, f has a local maximum at c;
- f''(c)=0, the test is inconclusive.
4.2 Optimisation exampleAssume the cost of operating a service at workload level x is C(x) = x² − 12x + 50, 0 ≤ x ≤ 10 where cost units are abstract service-cost units. Then: C′(x) = 2x − 12 Setting the derivative to zero gives x=6. Since C''(x)=2>0, this is a local minimum. Check the endpoints: C(0)=50, C(6)=14, C(10)=30 Thus the global minimum on the stated interval is 14 at x=6. The conclusion depends on the quadratic model and the feasible interval; it does not imply that a real system should always operate at level 6. 4.3 Related ratesIf quantities vary with time, derivatives describe their rates. Suppose data volume is D(t)=1000+200t2 megabytes, with t in hours. Then: D′(t)=400t MB/hour At two hours, the instantaneous growth rate is 800 MB/hour. This is distinct from the average growth over the first two hours, which is (D(2)-D(0))/2=800 MB/hour in this particular example; equality here results from the quadratic form and interval, not a general rule. 4.4 Numerical differentiationFor measured data, derivatives are often approximated. A forward difference is: f′(x) ≈ [f(x+h) − f(x)]/h A central difference is usually more accurate for smooth functions: f′(x) ≈ [f(x+h) − f(x−h)]/(2h) The choice of h involves a trade-off: large h introduces approximation error, while very small h can magnify measurement and floating-point noise. 5. Integrals and Accumulation5.1 AntiderivativesAn antiderivative of f(x) is a function F(x) satisfying F'(x)=f(x). The indefinite integral is: ∫ f(x) dx = F(x) + C where C is an arbitrary constant. For example: ∫ xn dx = xn+1/(n+1) + C, n ≠ −1 The exceptional case is ∫(1/x)dx=ln|x|+C, on intervals not crossing zero. 5.2 Definite integralsA definite integral represents signed accumulation: ∫ab f(x) dx If f is nonnegative, it can represent area or total accumulation. If it is a rate with units of quantity per time, integrating over time produces quantity because the time units cancel. The Fundamental Theorem of Calculus connects differentiation and integration: ∫ab f(x) dx = F(b) − F(a), where F′(x)=f(x) A variable-limit form is: d/dx [∫ax f(t) dt] = f(x) These results require appropriate integrability and continuity conditions; in introductory applications, continuity on the interval is a sufficient condition. Worked Example 2: Data accumulationA monitoring system receives data at rate r(t)=100+20t kilobytes per minute, for 0≤t≤5. The total data received is: ∫05 (100+20t)dt = [100t+10t²]05 = 500+250 = 750 KB The units are consistent: (KB/minute) × minute = KB. The average rate over the interval is total data divided by elapsed time, 750/5=150 KB/minute. 5.3 Numerical integrationWhen only samples are available, the trapezoidal rule approximates an integral. With equally spaced points x0,...,xn and spacing h: ∫x0xn f(x)dx ≈ h[½f(x0)+f(x1)+...+f(xn−1)+½f(xn)] It treats each interval as a trapezoid. Accuracy improves as sampling becomes finer for sufficiently smooth functions, but discontinuities and noisy measurements require caution. 6. Calculus in Machine LearningMany learning algorithms minimise a loss function. For parameters collected in vector θ, the gradient is: ∇_θ J(θ) = [∂J/∂θ1, ∂J/∂θ2, ..., ∂J/∂θp]T A basic gradient-descent update is: θk+1=θk−η∇J(θk) where η>0 is the learning rate and k is the iteration number. The negative gradient points toward local decrease for a sufficiently small step. This does not guarantee a global minimum for non-convex models, and an excessive learning rate can cause oscillation or divergence. For a single linear prediction \hat y=wx+b, squared-error loss for one observation can be defined as: J(w,b)=½( wx+b−y )² The factor ½ simplifies derivatives. Let e=wx+b−y. Then: ∂J/∂w = e x, ∂J/∂b = e These gradients show how the prediction error and feature value influence parameter updates. In practice, losses are often averaged over a dataset, regularised, and optimised using mini-batches or adaptive methods. Calculus also supports backpropagation through the chain rule. It permits efficient computation of derivatives in layered computational graphs, but derivative-based optimisation does not solve problems of biased data, inappropriate objectives, privacy or unfair deployment. 7. Detailed Application: Capacity Planning for an API ServiceBackgroundThis illustrative case concerns an API team measuring average latency as request rate increases. The team fits the approximate model L(r)=80+0.02r+0.0005r² where r is requests per second and L(r) is milliseconds. The model is intended only for 0≤r≤200. ProblemThe team wants to estimate marginal latency near 120 requests per second and identify whether increasing capacity could improve performance. A model alone cannot determine the correct architecture, but it can reveal trends. AnalysisDifferentiate: L′(r)=0.02+0.001r At r=120, the marginal modelled increase is 0.14 ms per additional request per second. The predicted latency is: L(120)=80+2.4+7.2=89.6 ms The second derivative is L''(r)=0.001>0, so the model is convex: marginal latency increases as load increases. At r=200, predicted latency is 104 ms, but extrapolating beyond 200 is not justified. Approach and solutionThe team should combine the model with load tests, confidence intervals, percentile latency, error rates and queue measurements. If latency requirements specify a 95th-percentile limit rather than a mean limit, the model must be redesigned for that target. A capacity decision might include a safety margin below the region where the curve steepens. OutcomeThe calculus analysis identifies increasing marginal cost and supports a threshold-based monitoring policy. It does not prove causation: the quadratic term could reflect queueing, resource contention or an artefact of the fitted data. Learning points- Derivatives provide marginal information useful for capacity decisions.
- A fitted function is valid only over its data-supported domain.
- Averages can conceal tail behaviour important to users.
- Operational decisions require measurement, validation and governance in addition to mathematics.
8. Limitations, Governance and Best PracticeCalculus models may fail because of discontinuities, changing system architecture, omitted variables, measurement bias or non-stationary workloads. Derivatives can be unstable for noisy data, while numerical integrals inherit errors from sampling and calibration. Responsible practice includes: - documenting variables, units, domain and data provenance;
- distinguishing correlation, prediction and causal explanation;
- validating models on independent data and monitoring drift;
- reporting uncertainty rather than presenting estimates as facts;
- testing sensitivity to parameters and step sizes;
- protecting personal or operationally sensitive data;
- checking whether optimisation rewards harmful shortcuts;
- retaining human review for consequential decisions.
In machine learning, an objective function is a governance choice as well as a mathematical one. Minimising average error may disadvantage minority groups, and maximising throughput may reduce reliability or accessibility. Calculus can optimise a stated objective; it cannot decide whether that objective is socially appropriate. Chapter SummaryCalculus formalises change and accumulation. Limits describe the value approached by a function, and continuity requires agreement among function value and limiting value. The derivative, defined as a limiting difference quotient, gives instantaneous rate of change and tangent slope. Derivative rules make calculation efficient, while critical-point and endpoint analysis supports optimisation. Integrals accumulate rates or areas, and the Fundamental Theorem of Calculus connects integration with antiderivatives. Numerical differences and trapezoidal integration extend these ideas to sampled data, although noise and discretisation create error. In IT, calculus supports performance modelling, capacity planning and gradient-based machine learning. Reliable use requires explicit units, domains, assumptions, validation, uncertainty analysis and ethical governance. Key TermsLimit: The value a function approaches as its input approaches a specified point. Continuity: A condition in which a function’s value agrees with its limiting value at a point. Derivative: The instantaneous rate of change of a function. Difference quotient: A ratio measuring average change over an interval. Tangent line: The local straight-line approximation to a differentiable curve. Critical point: A domain point where the derivative is zero or undefined. Local maximum: A value at least as large as nearby function values. Local minimum: A value at most as large as nearby function values. Global extremum: The greatest or least value over a specified domain. Marginal rate: The derivative interpreted as change in output per unit input. Antiderivative: A function whose derivative equals a given function. Indefinite integral: A family of antiderivatives differing by a constant. Definite integral: Signed accumulated value over an interval. Fundamental Theorem of Calculus: The result connecting derivatives and definite integrals. Gradient: A vector of partial derivatives with respect to several variables. Gradient descent: An iterative method that moves parameters opposite the gradient. Learning rate: The step-size parameter in an optimisation update. Numerical differentiation: Approximation of derivatives from discrete values. Trapezoidal rule: Numerical integration using trapezoid approximations. Model domain: The input range over which a model is intended to apply. Review QuestionsShort Answer Questions- What is the difference between an average rate of change and an instantaneous rate of change?
- State the three conditions for continuity at a point.
- What does the sign of a derivative indicate about a function?
- Why is an arbitrary constant included in an indefinite integral?
- What are the roles of the gradient and learning rate in gradient descent?
Long Answer Questions- Explain the limit concept and show how a removable discontinuity can be analysed algebraically.
- Derive and interpret the product and chain rules, giving one IT-related example of each.
- Explain how critical points and endpoints are used to find a global minimum on a closed interval.
- Describe the Fundamental Theorem of Calculus and apply it to a rate-of-data-arrival problem.
- Discuss the assumptions and limitations involved in using a smooth performance model for a real computer system.
Analytical / Application Questions- A service has cost model C(x)=3x²−18x+40 for 0≤x≤8. Find its critical point, classify it, compare it with endpoint values, and interpret the result.
- A sensor reports data at rate r(t)=60+5t² kilobytes per minute for five minutes. Calculate the total data and average rate, stating units.
- For loss J(w)=½(2w−6)², calculate J'(w), identify the minimising value of w, and explain how a gradient-descent step behaves when w<3.
Multiple Choice Questions with AnswersQuestion 1Which statement correctly defines continuity of f at x = a? A. f(a) is undefined but the limit exists B. The left and right limits are always zero C. f(a) is defined, the limit exists, and the limit equals f(a) D. The derivative must be equal to one Correct Answer: C. f(a) is defined, the limit exists, and the limit equals f(a) Question 2What is the derivative of f(x)=x3−4x? A. 3x2−4 B. x2−4 C. 3x−4 D. x3−4 Correct Answer: A. 3x2−4 Question 3If f'(x)>0 throughout an interval, what conclusion follows? A. f is decreasing throughout the interval B. f is increasing throughout the interval C. f is constant throughout the interval D. f is necessarily discontinuous Correct Answer: B. f is increasing throughout the interval Question 4What is ∫02 3x2 dx? A. 3 B. 4 C. 6 D. 12 Correct Answer: C. 6 Question 5A data stream arrives at r(t)=100+20t KB/min for five minutes. What total quantity arrives? A. 500 KB B. 600 KB C. 750 KB D. 1,000 KB Correct Answer: C. 750 KB Question 6For C(x)=x2−12x+50, which value minimises C on 0≤x≤10? A. x=0 B. x=5 C. x=6 D. x=10 Correct Answer: C. x=6 Question 7What does f'(a) represent geometrically? A. The area under the curve B. The slope of the tangent at x = a C. The global maximum of f D. The function’s average value on all real numbers Correct Answer: B. The slope of the tangent at x = a Question 8Which update is the basic gradient-descent rule? A. θk+1=θk+η∇J(θk) B. θk+1=θk−η∇J(θk) C. θk+1=η−θk∇J(θk) D. θk+1=θk/∇J(θk) Correct Answer: B. θk+1=θk−η∇J(θk) Question 9Why can a very small finite-difference step be problematic with measured data? A. It always removes all approximation error B. It can amplify measurement and floating-point noise C. It changes a derivative into an integral D. It guarantees a wrong sign Correct Answer: B. It can amplify measurement and floating-point noise Question 10What does the definite integral of a rate measured in KB/min over minutes produce? A. KB/min² B. minutes/KB C. KB D. A dimensionless number in every case Correct Answer: C. KB
|