f(x):=(2-cos(2*x)^4)/(x*sin(2*x)^2);

kill(all); g(x):=substitute((1-cos(2*x))^2,sin(2*x)^2,f(x))$ g(x);

integrate(f(x),x);

kill(all)$ g[i,j]:=integrate((2-cos(2*x)^4)/(x*sin(2*x)^2),x);

M:genmatrix(g,1,1)$ M;

f[i,j]:=

M:genmatrix(f[i,j],3,3)$ M;

eval(M);