Lesson goal: Function Grapher with Crosshairs

Previous: Make an (x,y) plot | Home | Next: Taylor series approximation

Often in algebra, trigonometry, and calculus, you want to instantly visualize a mathematical function without manually filling arrays.

CodeByMath provides a built-in graph() function that takes any formula as a string and plots it on interactive Google Charts! The function call is:
graph(formula, xlow, xhigh, dx, title, xtitle, ytitle)
where formula is a mathematical expression (e.g. "x^3 - 4*x"), evaluated across the interval $[x_{\text{low}}, x_{\text{high}}]$ in steps of dx.

It includes interactive coordinate crosshairs: when you move your mouse over the plotted curve, crosshairs lock onto the line and display the exact numerical $(x, y)$ coordinates.
graph(func,xlow,xhigh,dx)
Move the mouse over a dotted box for more information.

Now you try. Try plotting a damped wave like "sin(5*x) / (1 + x^2)" over the domain -4 to 4!

Type your code here:


See your results here: