@crynoking,
1. "...the theory of infantile sexuality,
which gave..." : the 'which' clause is a Non-Defining clause, which is separated by a comma.
compare Defining clause:
"The company
that makes the widget has gone bankrupt."
2. "...to figure out the idea but slow to get"]..." : 'but' is one of the Co-ordinating conjunctions, and takes a comma if...IF... it begins an independent clause. The latter includes a subject and a verb.
There is no subject or main verb.
compare
"Freud was quick to figure out the idea, but
he was slow to get other scientists to accept it."
3. as per (1).
4. as per (2)