What is the difference in usage between これはXです and Xはこれです?


In the example sentences I can find, they are both translated as "This is X"
so I don't know how to choose between them.

> 私が料理に使ったのはこれです。 This is what I used in the cooking.
>
> 彼が私を感動させた言葉はこれです。This is the word that moved me.




Let's use 'えんぴつ' as an example:

> これはえんぴつです = This is a PENCIL.  
>  えんぴつはこれです = THIS is a pencil.

We can imagine changing the emphasis in the words. The first would be someone
grabbing a pencil and asking 'What is this?'. The answer is the first example:
'This is a PENCIL'.

In the second let's picture someone holding a pen and asking: 'Is this a
pencil?'. You would grab a pencil and answer: 'No, THIS is a pencil' (as in
the second case)

