why does car ideal rough when foot on brake and car in gear on 2009 Toyota Matrix

it doesn't do it all the time, it has only done it maybe 5 or 6 times

Asked by for the 2009 Toyota Matrix
Is the A/C on or off when it feels rough? Or does it make any difference?
Yes the a/c was on
when it's not on does it feel smoother? Maybe mount(s) are weak.