Connect via MCP →

Enter Calculation

Syntax: + - * / ^ and sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, exp, log (ln), log10, sqrt, abs; constants pi and e. Trig is in radians. Use abs(x) not |x|, sqrt(x) for square root.

Formula

Advertisement

Results

Step size h = (b − a) / n
0.1
51 sample points (including both endpoints)
First sample f(a) = -1.58385, g(a) = 2
k x f(x) g(x)
-2 -1.58385 2
-1.9 -1.57671 1.61
-1.8 -1.5728 1.24
-1.7 -1.57116 0.89
-1.6 -1.5708 0.56
-1.5 -1.57074 0.25
-1.4 -1.56997 -0.04
-1.3 -1.5675 -0.31
-1.2 -1.56236 -0.56
-1.1 -1.5536 -0.79
-1 -1.5403 -1
-0.9 -1.52161 -1.19
-0.8 -1.49671 -1.36
-0.7 -1.46484 -1.51
-0.6 -1.42534 -1.64
-0.5 -1.37758 -1.75
-0.4 -1.32106 -1.84
-0.3 -1.25534 -1.91
-0.2 -1.18007 -1.96
-0.1 -1.095 -1.99
0 -1 -2
0.1 -0.895 -1.99
0.2 -0.78007 -1.96
0.3 -0.65534 -1.91
0.4 -0.52106 -1.84
0.5 -0.37758 -1.75
0.6 -0.22534 -1.64
0.7 -0.06484 -1.51
0.8 0.10329 -1.36
0.9 0.27839 -1.19
1 0.4597 -1
1.1 0.6464 -0.79
1.2 0.83764 -0.56
1.3 1.0325 -0.31
1.4 1.23003 -0.04
1.5 1.42926 0.25
1.6 1.6292 0.56
1.7 1.82884 0.89
1.8 2.0272 1.24
1.9 2.22329 1.61
2 2.41615 2
2.1 2.60485 2.41
2.2 2.7885 2.84
2.3 2.96628 3.29
2.4 3.13739 3.76
2.5 3.30114 4.25
2.6 3.45689 4.76
2.7 3.60407 5.29
2.8 3.74222 5.84
2.9 3.87096 6.41
3 3.98999 7

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.

Two function curves f and g plotted over interval from a to b
Two functions f(x) and g(x) plotted together over the interval [a, b].

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.$$
Number line showing evenly spaced sample points separated by step h
Sample points are evenly spaced by step h = (b - a)/n from a to b.

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.

Last updated: