See Evaluating an If condition to yield True/False and the linked questions for a discussion of the difference between === and ==. Don't use === for the OP's examples; use == instead. I'm discounting the apparent mistake writing ab without a space between the a and the b. Like in most programming languages, a string of letters without punctuation or white space signifies a single Symbol or "identifier".
Perhaps the only difference I see between Testing equivalence of analytical expressions like $x^2 -x == x(x-1)$ and this question is the role of autosimplification, which may explain why the question has not been closed. Since no one has voted to close yet, I will attempt to answer.
Sometimes autosimplification and simplification via Simplify[] and FullSimplify[] are confused and lead to a misunderstanding of when a particular simplifying step happens.
Here are the OP's examples with Equal replacing SameQ per the advice in the linked Q&A; Simplify works on all five three:
testEqual = {
Sqrt[(x + y^2)/y] == Sqrt[x/y + y],
(x^2)/x == x,
a b + b*b + b c == b (a + b + c)
(* , (x^2)/x == x, <-- becomes the same the first *)
(* Sqrt[(x + y^2)/y] == Sqrt[x/y + y] (* ditto *)};
Simplify /@ testEqual
(* {True, True, True} *)
The last question in the OP concerns autosimplification, in particular of the expressions x^2/x and (x + y^2)/y. As far as I know, neither the autosimplification rules nor the transformation rules used in either Simplify or FullSimplify are documented. So you have to get used to them. There's not much the user can do about autosimplify rules, except for a couple of options in SystemOptions["SimplificationOptions"], neither of which apply here.
The first expression x^2/x has the FullForm
Times[Power[x, 2], Power[x, -1]]
There is an autosimplify rule that combines the product of powers that have the same base. This happens notoriously for x/x, too. So x^2/x first evaluates to x. The OP's comparison of x^2/x with x becomes a comparison of x to x. It does not matter whether === or == is used in this special case; both return True.
The second expression (x + y^2)/y has the FullForm
Times[Power[y, -1], Plus[x, Power[y, 2]]]
Any algebraic simplification involves rewriting the expression and testing whether the result is simpler -- and if not, you just wasted the user's time. Unlike combining like bases, there isn't a general rule that always simplifies this expression. Something similar can be said about the expression it is compared to, x/y + y. Sometimes users need the terms separated (hence Expand[]) and sometimes combined as a rational function (hence Together[]). Neither expression should be autosimplified. For the OP's comparison, one needs to use Simplify (and Equal!).
Reduce[a b + b^2 + b c == b (a + b + c)]andReduce[Sqrt[(x + y^2)/y] == Sqrt[x/y + y]]. – Alexei Boulbitch May 21 '22 at 18:55a bnotab. In particular,Simplify[a b + b*b + b c == b (a + b + c)]works as desired. – Michael E2 May 21 '22 at 19:03===(SameQ) is for identical expressions, not mathematically nor computationally equivalent expressions. ThusSimplify[Sqrt[(x + y^2)/y] == Sqrt[x/y + y]]but notSimplify[Sqrt[(x + y^2)/y] === Sqrt[x/y + y]]. (2) I sometimes have more success withSimplify[X - Y]instead ofSimplify[X == Y](compare equal to0). (3) Simplification in Mma is an expression minimization problem, not a mathematical problem. It tries to make the expression tree as small as possible, using a finite set of transformations. It's not exactly the same as what is taught in algebra class. – Michael E2 May 21 '22 at 19:13{}button above the edit window. The edit window help button?is useful for learning how to format your questions and answers. You may also find the meta Q&A, How to copy code from Mathematica so it looks good on this site, helpful – Michael E2 May 22 '22 at 15:29