Calculator Inputs
Enter piecewise expressions, interval limits, and the evaluation point.
Plotly Graph
The graph compares the piecewise function and its numerical derivative over the chosen range.
Example Data Table
This sample demonstrates a three-piece function and derivative behavior around breakpoints.
| Piece | Expression | Interval | Example x | Function Value | Derivative Value |
|---|---|---|---|---|---|
| 1 | x^2 + 1 | -∞ ≤ x < 0 | -2 | 5 | -4 |
| 2 | 2x + 1 | 0 ≤ x < 2 | 1 | 3 | 2 |
| 3 | x^3 - 1 | 2 ≤ x ≤ ∞ | 3 | 26 | 27 |
Formula Used
For a piecewise function, the calculator first locates the interval containing the chosen input x. Inside that interval, it estimates the derivative with a central difference:
f′(x) ≈ [f(x + h) − f(x − h)] / (2h)
At interval boundaries, it also checks one-sided derivatives:
f′left(a) ≈ [f(a) − f(a − h)] / h
f′right(a) ≈ [f(a + h) − f(a)] / h
If the left and right function values match, the point is continuous. If the left and right derivative estimates also match closely, the point is differentiable.
How to Use This Calculator
- Choose how many pieces your function has.
- Enter each expression using
x, such asx^2,sin(x), orabs(x). - Set each interval with lower and upper bounds. Use open or closed endpoints.
- Enter the point where you want the derivative.
- Adjust the finite difference step
hif you need tighter numerical estimates. - Press Calculate Derivative to show results above the form.
- Review the summary, table, graph, and boundary checks.
- Export the result as CSV or PDF when needed.
FAQs
1. What does this calculator compute?
It estimates the derivative of a piecewise-defined function at a chosen x-value. It also reports the active interval, function value, nearby slope behavior, and continuity or differentiability checks at interval boundaries.
2. Can it handle trigonometric or exponential expressions?
Yes. You can enter expressions supported by the parser, including sin, cos, tan, exp, log, sqrt, abs, and powers. Write all formulas using x as the variable.
3. Is the derivative exact or approximate?
This version uses numerical differentiation, so the derivative is an approximation. A smaller step size often improves precision, although extremely tiny steps can increase rounding noise.
4. Why are one-sided derivatives important?
Piecewise functions often change formulas at breakpoints. One-sided derivatives reveal whether the slope approaching from the left matches the slope approaching from the right, which is necessary for differentiability.
5. What happens at open endpoints?
If the evaluation point falls on an open endpoint, that piece does not contain the point. The calculator then searches other pieces or warns that the point is outside the defined domain.
6. Can I graph the original function and derivative?
Yes. The Plotly section plots sampled values of the piecewise function and its numerical derivative across your selected graph interval, helping you compare shape and slope visually.
7. What if the function is not continuous?
A jump or mismatch in function values at a boundary means the function is not continuous there. In that case, the derivative at that boundary generally does not exist.
8. When should I change the step h?
Adjust h when the derivative seems unstable or overly noisy. Moderate values often balance truncation error and rounding error better than extremely large or extremely small steps.