1. Differentiating a Quadratic Function
Engineering StudentBackground
A student needs to compute the derivative and second derivative of f(x) = x² at x₀ = 1 with a step size of 0.1 for a numerical methods assignment.
Problem
Calculate finite differences and verify that the central difference matches the exact derivative.
How to use
Set f(x) to x^2, x₀ to 1, h to 0.1, and exact derivative f′(x) to 2x.
{
"fx": "x^2",
"x0": 1,
"h": 0.1,
"exactDy": "2x",
"decimalPlaces": 6
}Outcome
Forward difference yields 2.100000 (error 0.100000), backward yields 1.900000 (error 0.100000), and central difference yields exactly 2.000000 (error 0.000000).