Verifing symbolic equality in MATLAB

1 view (last 30 days)
Hello everyone. How can I verify a symbolic equality? For example:
(a+b)*(a-b)=a^2-b^2
Thank you for your help.

Accepted Answer

Steven Lord
Steven Lord on 18 Aug 2017
>> syms a b
>> X = (a+b)*(a-b);
>> Y = a^2-b^2;
>> isAlways(X == Y)
ans =
logical
1

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!