MATLAB: Can I check if factored and expanded polynomial forms are equal

equalityMATLABMATLAB and Simulink Student Suitepolynomials

>> syms w k
>> isequal((w^2-k^2),(w+k)*(w-k))
ans =
logical
0
Is there a way to tell that w^2-k^2 and (w+k)*(w-k) are equal?
Also tried isequal(expand(),expand()) method but expand() may order two polynomials that are the same differently and in these instances isequal() returns logical = 0.

Best Answer

simplify((w^2-k^2) - (w+k)*(w-k))
ans =
0
expand((w+k)*(w-k))
ans =
w^2 - k^2
factor(w^2-k^2)
ans =
[ -1, k - w, k + w]