Gauss–Legendre GL4 ODE Solver
Integrate y′ = f(x,y) with the two-stage Gauss–Legendre method of order four, often shortened to GL4. Each step solves two coupled implicit stage equations with Newton iteration before advancing the solution.
Expression syntax: use explicit multiplication such as 2*y. Supported functions include sin, cos, tan, exp, ln, sqrt and abs.
How this tool works
GL4 is the two-stage Gauss collocation method with c₁=1/2−√3/6 and c₂=1/2+√3/6. The final update uses equal weights b₁=b₂=1/2 after solving the implicit stages.
Example
Use the stiff-decay example y′ = −25y and compare GL4 with explicit RK4 at the same h. The implicit Gauss method has a very different stability character while retaining fourth-order accuracy.
Common questions
Why is GL4 implicit?
Its stage slopes depend on stage values that themselves depend on both unknown slopes. The calculator solves that coupled nonlinear system at every step.
Is GL4 symplectic?
Gauss–Legendre Runge–Kutta methods are symplectic, which makes them attractive for long-time integration of Hamiltonian systems, although this page currently solves scalar first-order ODEs.
Is GL4 the same as classical RK4?
No. Both are fourth order, but classical RK4 is an explicit four-stage method while GL4 is an implicit two-stage collocation method.