What is the subject in the following sentence? This is the book I wanted
This is the book I wanted.
In this sentence, is 'this' the formal subject and 'book' the real Subject?
"this" is the subject, "the book I wanted" is the subject complement. "book" is merely a noun within the phrase that constitutes the complement.
If you invert the sentence to
The book I wanted is this one.
then "The book I wanted" becomes the subject.
They both have very similar meanings, but the emphasis is different.