MATLAB: Strange behaviour of simplify

simplifysymbolic math

Hello, when solving a math Problem today i noticed a strange behaviour of simplify and I cannot explain myself what I did wrong. Basically I do have two terms and want to compare if they are equal, but Matlab returns false, altough they actually are. Is there a syntax thing I did false?
syms a b c t
f1 = sqrt((a^2+b^2+c^2)/3) / t;
f2 = sqrt(((a/t)^2+(b/t)^2+(c/t)^2)/3);
pretty(simplify(f1==f2))
Here you can see, that both expressions are equal, but Matlab returns false:
logical(simplify(f1==f2))

Best Answer

use the isAlways function to compare symbolic expressions:
syms a b c t
f1 = sqrt((a^2+b^2+c^2)/3) / t;
f2 = sqrt(((a/t)^2+(b/t)^2+(c/t)^2)/3);
pretty(simplify(f1==f2, 'Steps',500))
equalityTest = isAlways(f1 == f2)
here:
equalityTest =
logical
0
and:
Warning: Unable to prove '(a^2/3 + b^2/3 + c^2/3)^(1/2)/t == (a^2/(3*t^2) + b^2/(3*t^2) +
c^2/(3*t^2))^(1/2)'.
.