Firstly, here is the precise statement of the case 2 in OP's question.
A sequence of m MAKE-SET, UNION, and FIND operations, n of which are MAKE-SET operations, can be performed on a disjoint-set forest with union by rank in worst-case time $O(m\log_2 n)$.
In fact, it is trivial to see that the MAKE-SET and UNION operations run in $O(1)$ time. So the question is really about the time-complexity of the FIND operation.
Here are the properties of the disjoint-set forest you can prove.
- Given any node $u$ that has been added to the set of union-find data structure, the ranks of the nodes in a path from $u$ to its root is strictly increasing.
- A node $u$ which is root of a sub-tree with rank $r$ has at least $2^r$ nodes. (This fact can be proved by induction on $r$).
- Every node has rank at most $\log_2 n$.
With properties 1 and 3, it should be easy to prove the desired time complexity.
The above explanation follows roughly the section 21.4 in Introduction To Algorithms, third edition by CLRS. Readers are encouraged to read the chapter 21 of that book.