Plot a function f(x) and its derivative f′(x) on the same graph.
The derivative is computed numerically using the central difference formula:
f′(x) ≈ ( f(x + h) − f(x − h) ) / (2h)
The value h = 10⁻⁵ is a very small step size that provides a good balance between accuracy and numerical stability.
x^2 + 3*x - 5sin(x), cos(x), tan(x)exp(x)ln(x)