% energy integrals for  a two electron atom
function etwo=two_electron(zeta)
% Z is nuclear charge
global Z
zet=zeta(1);
zetp=zeta(2);
zetprod=zet.*zetp;

s=8*zetprod.^(3/2)./(zet+zetp')^3;
ke=4*zetprod^(5/2)./(zet+zetp).^3;
pe=-Z*4*zetprod.^(3/2)./((zet+zetp).^2);
coulomb=zetprod.*(zet*zet+3*zetprod+zetp*zetp)./((zet+zetp).^3);
exchng=20*zetprod.^3/(zet+zetp).^5;

% here's the exchange integral with 3 1s functions with zetap and 1
% function with screening constant of zeta

exchng1=8*sqrt(zet^3).*sqrt(zetp^5)*(zet^2+8*zet*zetp+11*zetp^2) ...
   /((zet+zetp).^2*(zet+3*zetp).^3);
% here's the exchange integral with 3 1s functions with zeta and 1
% function with zetap

exchng2=8*sqrt(zetp^3).*sqrt(zet^5)*(zetp^2+8*zet*zetp+11*zet^2) ...
   /((zet+zetp).^2*(zetp+3*zet).^3);
etwo=[s ke pe coulomb exchng exchng1 exchng2];