How to use it
- Type f(x). Multiplication can be written
2x,2*xor2 × x; functions need brackets, as insin(x). - Optionally type g(x) to compare two curves.
- Set the left and right ends of the x range. The plot shows the x range at the bottom and the y range at the right.
How it works
The text is parsed into an expression tree (no code is executed) and evaluated at many x values. The plot is drawn from those values, with the axes through 0 when they fall inside the window. Crossings are the zeros of f − g.
Worked example
f(x) = x² − 2 on −4 to 4, with g(x) = x. The zeros of f are x = ±√2 ≈ ±1.414214 and f(0) = −2. The curves meet where x² − 2 = x, that is x = −1 and x = 2, so the crossings are (−1, −1) and (2, 2).
Tips
- Zoom by changing the x range: a tighter window shows more detail and gives better extremes.
- Use
abs(x)for the absolute value andsqrt(x)for square roots;x^(1/3)is not defined for negative x here. - Angles are in radians: sin(pi/2) = 1.