That’s how I dealt with a lot of trig identities - sin(x+y) equals some sum of products of sins and cosines - let’s try x=15 degrees and y=30 degrees (with my calculator) and see what makes sense.
In one dimension, two nonequivalent polynomials can only coincide at a finite number of points, so picking a random point has a 100% chance of revealing whether the expressions are equivalent or not (let’s say over the complex numbers, not a finite field or anything like that). In higher dimensions, meaning more than 1 variable, you should still be OK since an algebraic hypersurface will have strictly smaller dimension than the entire space, so all you have to do is pick a random value for each variable.
Trigonometric identities basically amount to checking polynomials, since \sin x = (e^{ix}-e^{-ix})/2i and so on.