function [k]=Bar2Noded_1Dk(X,b,h, E)
%clear all;                                   


syms Xi real;



XiC=[-1 1];

Ni=[ (XiC(2)-Xi)/(XiC(2)-XiC(1)), ...
     (XiC(1)-Xi)/(XiC(1)-XiC(2)) ];

dNibydXi=diff(Ni,Xi);


x=Ni*X';

J=[ diff(x,Xi)];
Jinv=inv(J);

dNibydx=simplify(Jinv(1,1)*dNibydXi);

B=[dNibydx(1)     dNibydx(2)];    

BTDBJ1=subs(B'*E*B*det(J)*b*h,{Xi},{ -1/sqrt(3)});
BTDBJ2=subs(B'*E*B*det(J)*b*h,{Xi},{  1/sqrt(3)});
k=BTDBJ1+BTDBJ2





   