I've never understood why this is the case

When I do it this way ---

I get the same answer either way I write it. However if i do this:

or if I write:

Either way I get answer of 1 because

and is just one.

However complex numbers say that is equal to

How can be equal to if

equals or just ?

By my logic should be just 1. So there is obviously a rule I am missing here that would lead me to believe this. If someone could explain to me why but doesnt not equal or just . It would be much appreciated!

Sorry in advance if my code got messed up, I havent used it before.