Lesson 50 of 55
10 mins readPython Numerical Calculus & Polynomial Evaluation
In Plain English
Learn classical scientific computing techniques in Julia: finite difference numerical derivatives, trapezoidal numerical integration, and Horner polynomial evaluation.
Deep Dive: How It Works
Finite Differences: Forward difference (f(x+h) - f(x))/h and central difference (f(x+h) - f(x-h))/(2h).
Trapezoidal Integration: Approximates definite integrals by summing trapezoid slices across the domain.
Horner Method: Evaluates polynomials with minimal multiplication operations: a_0 + x*(a_1 + x*a_2).
Core Rules to Remember

Central Difference Derivative: O(h^2) accurate numerical derivative calculation.

Trapezoidal Quadrature: Fast numerical integration of arbitrary mathematical functions.
Live Interactive Example
Hit Run Code to see it liveNumerical Derivative and Trapezoidal Integration
Python 3.12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Output Console
Click "Run Code" to view the rendered output.
How it works: Numerical methods accurately approximate both the derivative (1.0) and integral (2.0).
Your Turn: Micro Challenge
No pressure! Edit the starter code below and test your solution with instant feedback.
Micro Exercise
Differentiate x^2 at x = 3
Define `f(x) = x^2`.
Compute derivative at `x = 3.0` using `(f(3.0 + 1e-5) - f(3.0 - 1e-5)) / 2e-5`.
Print `"Derivative: $(round(d, digits=1))"`.
1
2
3
Sandbox Output
Click "Run & Check" to test your solution.
Finished reading and practicing?
Mark this lesson as completed to update your course progress.