What this calculator does
The Function f(x), g(x) Table and Graph Plotter evaluates one or two mathematical expressions in the variable x across an interval [a, b]. It splits the interval into n equal subintervals and reports the value of each function at every sample point, producing a clean numeric table you can use for plotting, checking roots, comparing curves, or building a worksheet. The second function g(x) is optional, so the tool also works for a single curve.
How to use it
Enter f(x) using ordinary math syntax: + - * / ^ with parentheses, plus functions such as sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, exp, log (natural log / ln), log10, sqrt and abs. Constants are pi and e. Trigonometric functions work in radians. Write absolute value as abs(x) (vertical bars are not supported) and square root as sqrt(x). Optionally enter g(x). Set the range start a and end b (b must be greater than a), choose the number of divisions n (10, 20, 50, 100 or 200), and submit.
The formula explained
The step size is \(h = (b - a) / n\). Sample points are \(x_k = a + k\cdot h\) for \(k = 0, 1, 2, \dots, n\), which yields n+1 points including both endpoints a and b. Each function is evaluated at every \(x_k\). When a value is undefined — for example log or sqrt of a negative number, or division by zero — the cell is marked "undefined" rather than producing an error.
$$y_i = f(x_i), \quad x_i = \text{a} + i\,h$$ $$\text{where}\quad \left\{ \begin{aligned} f &= \text{f(x)} \\ g &= \text{g(x)} \\ h &= \dfrac{\text{b} - \text{a}}{\text{n}} \\ i &= 0,\,1,\,\dots,\,\text{n} \end{aligned} \right.$$
Worked example
For \(f(x) = x - \cos(x)\), \(g(x) = x^2 - 2\), \(a = -2\), \(b = 3\), \(n = 10\), the step is $$h = \frac{3 - (-2)}{10} = 0.5.$$ At \(k = 0\), \(x = -2\): \(f = -2 - \cos(-2) \approx -1.58385\) and \(g = (-2)^2 - 2 = 2\). At \(k = 10\), \(x = 3\): \(f = 3 - \cos(3) \approx 3.98999\) and \(g = 9 - 2 = 7\). The table fills in all eleven rows in between.
FAQ
Are angles in degrees or radians? Radians. To use degrees, convert with x*pi/180 inside the trig function.
How do I write powers? Use the caret, e.g. x^2 for x squared and x^0.5 or sqrt(x) for a square root.
What if b is smaller than a? The tool swaps them so the interval is always valid, keeping h positive.