Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

Numerical methods lab

Watch numerical methods work step by step: bisection, Newton and secant roots, Simpson and Gauss integrals, Euler and RK4 for ODEs, and splines.

Your browser cannot draw.

■ function / RK4 / spline ■ method steps / Heun / polynomial ■ Euler / answer ■ exact

How to use

  1. Type a formula in x, for example x^3 - x - 2, sin(x)/x or exp(-x^2). Use ^ for powers; functions include sin, cos, tan, sqrt, ln, log, exp and abs.
  2. Roots: choose a method. Bisection and false position need a and b where f has opposite signs; Newton needs one start; secant needs two. The table shows every step and the status line compares all four.
  3. Integrals: pick a rule and the number of strips. The table doubles the strips to show how fast the error shrinks.
  4. Differential equations: type y′ in terms of t and y, the start, the end and the number of steps. Add the exact answer if you know it to see each method's error.
  5. Interpolation: type points to fit a polynomial through all of them and a smooth spline.

Keyboard and touch

Enter in a boxRun the method
TabMove between boxes, lists and buttons

Tips

  • Bisection is slow but never fails once it has a sign change; Newton roughly doubles the correct digits each step but can fly off from a bad start.
  • Halving the strip width cuts the trapezoid error about 4 times (order 2) and Simpson's about 16 times (order 4): the "Order" column shows this.
  • Euler's method needs tiny steps; RK4 with the same steps is usually thousands of times more accurate.
  • A polynomial through many evenly spaced points can swing wildly near the ends (Runge's phenomenon); the spline stays calm.
  • To draw graphs and find where they cross, use our Graph plotter.

About this lab

Newton's method uses a central-difference slope, so you only type f. False position uses the Illinois change, which halves the stuck end's value so it cannot stall. Gauss-Legendre uses four nodes per strip and is exact for polynomials up to degree 7. When no exact value is given, the reference answer comes from adaptive Simpson integration to about 13 digits.

Heun's method is the improved Euler (a trapezoid predictor-corrector); RK4 is the classical fourth-order Runge-Kutta method. Interpolation uses Newton's divided differences for the polynomial and a natural cubic spline (curvature zero at both ends). The formula reader is shared with our Graph plotter. Everything runs in your browser.

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product