You are so sloppy with your typing, that it's probably your main problem. cosx1 is NOT THE SAME as cos(x1). And x(;1) would cause a syntax error while x(:, 1) is perfectly valid.
You should get a new keyboard - they would be a very cheap fix. cos(x1) is the cosine of the variable x1. x1 is not necessarily the same as x(:,1) unless you said x1 = x(:,1); x1 could be anything at all. It could be pi, it could be 42, or 69 or anything else. Why would you think that x1 should automatically be the same as x(:,1) unless you made it so?