Advanced maths

Dirichlet Sturm Liouville eigenvalue and eigenfunction calculator

A regular Sturm–Liouville problem asks which eigenvalues allow a nonzero function satisfying a weighted second-order equation and endpoint conditions.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A regular Sturm–Liouville problem asks which eigenvalues allow a nonzero function satisfying a weighted second-order equation and endpoint conditions. The equation here is minus the derivative of p times y prime, plus q times y, equal to lambda times w times y. The eigenvalue is an output, not an entered forcing parameter.

THE FORMULA−(p y′)′+q y=λ w y;y(left)=y(right)=0.

A worked example

For p=w=1,q=0,on[0,1],the exact eigenvalues are k²π². The fine80-subinterval first estimate is≈9.868336119,with a visible mesh difference from the40-subinterval result.

Good to know

Regular finite interval length≤20,p and w sampled positive,homogeneous Dirichlet ends;10–100 coarse subintervals,1–5 modes,finite-difference refinement and discrete residuals. No positivity proof between samples.

Find parameters that permit nonzero boundary solutions

A regular Sturm–Liouville problem asks which eigenvalues allow a nonzero function satisfying a weighted second-order equation and endpoint conditions. The equation here is minus the derivative of p times y prime, plus q times y, equal to lambda times w times y. The eigenvalue is an output, not an entered forcing parameter.

This calculator uses homogeneous Dirichlet conditions at both endpoints, meaning the function equals zero there. It returns the first few eigenvalues and sampled weighted-normalized eigenfunctions. Other separated boundary conditions, singular endpoints and inhomogeneous boundary values are outside this deliberately specified problem.

Dirichlet Sturm–Liouville modesFirst mode sin(πx)λ₁ = π²Zero endpoints
Scroll across to see the full diagram.
For p=w=1,q=0,on[0,1],the exact eigenvalues are k²π². The fine80-subinterval first estimate is≈9.868336119,with a visible mesh difference from the40-subinterval result.

Compare this with the Boundary value differential equation calculator with finite differences. Compute spectral parameters permitting nonzero boundary-value solutions,rather than solving a forced problem at a supplied parameter.

Enter coefficient functions on a finite interval

The p, q and w expressions use x as their variable. The interval endpoints must be increasing, with supported length at most twenty. Positive p and w are needed for the regular self-adjoint setting, while q may have either sign provided it remains finite and appropriately regular.

The implementation checks positivity at its sampled nodes and half nodes; it cannot prove positivity between every pair of numerical samples for an arbitrary expression. Inspect the coefficient functions yourself when using sharply varying inputs. A positive sampled grid does not turn a truly singular or sign-changing continuous problem into a valid regular one.

Discretize in a conservative form

The finite-difference construction evaluates p at half-grid points and forms flux differences, preserving the symmetric structure of the spatial operator. The weight function transforms the generalized eigenproblem into an ordinary symmetric tridiagonal problem. This structure supports ordered real eigenvalue calculations rather than a generic nonsymmetric root search.

The entered subinterval count defines a coarse mesh, and a second calculation doubles that count. Sturm sequence counts and bisection locate the smallest discrete eigenvalues, while inverse iteration recovers associated modes. These are eigenpairs of the discretized problem; convergence to the continuous problem requires an adequate mesh and suitable coefficient regularity.

Use the sine problem as an independent reference

With p and w equal to one, q equal to zero and interval zero to one, the continuous eigenvalues are k squared times pi squared. The corresponding weighted unit-norm eigenfunctions are square root of two times sine of k pi x, up to an arbitrary overall sign.

The default forty coarse subintervals produce an eighty-subinterval fine result. Its first eigenvalue is about 9.868336, close to pi squared, while the second and third are about 39.458128 and 88.723751. The discrepancy increases for higher modes at a fixed mesh because shorter oscillations require finer spatial resolution.

Separate algebraic residual from discretization error

A small discrete eigenpair residual shows that the computed vector approximately solves the finite-dimensional matrix equation. It does not measure how closely that vector solves the original differential equation. A very accurate tridiagonal solve can still have noticeable error from a mesh that is too coarse.

The output therefore also reports the difference between fine and coarse eigenvalues. That refinement difference is a diagnostic rather than a certified error bound or an automatically extrapolated exact value. Comparing both quantities avoids confusing numerical linear algebra precision with the accuracy of the underlying spatial approximation.

Interpret normalization and sign consistently

Each displayed mode is normalized using the discrete approximation to the weighted integral of w times y squared. The mode’s first interior value is oriented positively for reproducible display. Multiplying the entire eigenfunction by minus one gives an equally valid eigenfunction and does not alter its eigenvalue.

Distinct modes should be orthogonal under the same weighted inner product in the self-adjoint problem. Pointwise plot amplitudes therefore depend on the chosen normalization, not only on the shape of the differential equation. Preserve the weight and normalization convention when comparing sampled modes with another solver.

Keep the boundary and regularity assumptions visible

The supported calculation uses ten to one hundred coarse subintervals and returns one to five low modes. It does not search an unbounded spectrum or adaptively refine around coefficient layers. A fine mesh may still be insufficient for discontinuities, narrow potentials or highly oscillatory modes.

The zero function satisfies the homogeneous equation for every lambda, so eigenvalues are defined by the existence of a nonzero solution. That distinction explains why solving a forced boundary-value problem at a supplied lambda is a different tool. Report the coefficient functions, interval and Dirichlet endpoints with every eigenvalue comparison.

A few questions, answered

Which endpoint conditions are used?

Both endpoint values are zero. Robin and derivative endpoint conditions are not supported.

Does a small residual prove the continuum eigenvalue?

No. It verifies the discrete eigenpair;the mesh refinement difference diagnoses discretization sensitivity.

How are eigenfunctions normalized?

They use a discrete approximation to the weighted L2 norm with the stated weight w.

Are p and w proved positive everywhere?

No. The implementation checks their values at sampled nodes;the user must ensure the regular positive-coefficient assumptions on the whole interval.

Find your calculator

Start typing to explore the library.