Problems "integ"

  1. Calculate numerically the intergral
    01 dx (ln(x)/√x) .
    
  2. In the variational method in quantum mechanics one calculates the expectation value E[ψ] of a Hamiltonian H,

    E[ψ] ≡ ⟨ψ|H|ψ⟩/⟨ψ|ψ⟩ ,
    
    (in Dirac notation) with some trial function ψ. The trial function is then optimized to provide the minimum of the expectation value.

    Consider the Hamiltonian operator for one-dimensional oscillator,

    Hos = - (1/2) (d²/dx²) + (1/2) x² ,
    
    and the trial function in the form of a Gaussian,
    ψα(x) = exp(-αx²/2) ,
    
    where α is the variational parameter. Calculate numerically
    E(α) ≡ ⟨ψα|Hosα⟩/⟨ψαα⟩ .
    
    and plot the result – you should see a minimum of E=0.5 at α=1 (why?).

    Hints:

    1. The norm-integral, ⟨ψαα⟩, has the form (check it)

      ⟨ψαα⟩ = -∞ exp(-αx²) dx .
      
      It is actually analytic, but you have to calculate it numerically.
    2. The Hamiltonian-integral, ⟨ψα|Hosα⟩, has the form (check it)

      ⟨ψα|Hosα⟩ = -∞ (-α²x²/2 + α/2 + x²/2)*exp(-αx²) dx .
      
      It is actually also analytic, but you again have to calculate it numerically.
    3. Since the integration limits are infinite, you migh want to use gsl_integration_qagi function.