      subroutine laplacian(n,h,l,r,wfn,del2wfn,dum1,dum2)
      implicit real*8 (a-h,o-z)
c on input: wfn(i) is radial wfn * r for angular momentum l
c on output: del2wfn is (d2/dr2-l*(l+1)/r^2)wfn
      dimension r(n),wfn(n),del2wfn(n),dum1(n),dum2(n)
c  factor out r**(l+1)
      lpwr=l+1
      do i=1,n
      dum2(i)=wfn(i)/(r(i)**lpwr)
      enddo
      call nderiv(h,dum2,dum1,n)
      call nderiv(h,dum1,dum2,n)
      ang=2*(l+1)
      do i=1,n
      del2wfn(i)=(r(i)**l)*(ang*dum1(i)+r(i)*dum2(i))
      enddo
      return
      end
     
