Theory.
gsl_integration_qags rutine?
epsabs,
epsrel and abserr (correspondingly the 4th, 5th and last argument) of
gsl_integration_qags rutine?
gsl_integration_qags return?
gsl_integration_qags return the calculated result?
gsl_integration_qags estimates the error of the calculated result?
.params member of
the corresponding gsl_function structure?
limit argument (the 4th argument)
of the gsl_integration_qagi rutine?
gsl_integration_workspace_alloc function?
gsl_integration_qag* integrations?
gsl_integration_qags function, which you would normally call as
int flag = gsl_integration_qags(arguments);
gsl_integration_qags(arguments);
gsl_integration_qags routine?
Practice: numerical integration with Gauss-Kronrod algorithms.
In the variational method in quantum mechanics one calculates the expectation value E[ψ] of a Hamiltonian H,
E[ψ] ≡ ⟨ψ|H|ψ⟩/⟨ψ|ψ⟩ ,
Consider the Hamiltonian operator for one-dimensional oscillator,
Ho = - (1/2) (d²/dx²) + (1/2) x² ,
ψα(x) = exp(-αx²/2) ,
E(α) ≡
⟨ψα|Ho|ψα⟩/⟨ψα|ψα⟩ .
Hints:
The norm-integral, ⟨ψα|ψα⟩, has the form (check it)
⟨ψα|ψα⟩ =
∫-∞∞ exp(-αx²) dx .
The Hamiltonian-integral, ⟨ψα|Ho|ψα⟩, has the form (check it also)
⟨ψα|Ho|ψα⟩ =
∫-∞∞ (-α²x²/2 + α/2 + x²/2)*exp(-αx²) dx .
Since the integration limits are infinite, you migh want to use gsl_integration_qagi function.