How to verify and plot expression for sampled signal is correct?
The best way is to let the program to sample the function for you.
You can define a function. And you don't even need a separate program, you can use an anonymous function, @(t) expr for MATLAB/Octave (That seems to be the program you are using).
  x_a = @(t) A1*cos(2*pi*f1.*t + th1) + A2*cos(2*pi*f2.*t + th2);

Then you could plot with
  plot(t, x_a(t), '-', n/fs, x_a(n/fs), 'o');

since you are ploting x, x_a(x) there is nothing that could go wrong in the sampling, the time values you pass will be replaced automatically in your expression.
If you want the expression you can use symbolic computation, however when I need to do so I use wxmaxima or sympy