Joe invested $600 in two companies, company A and B. In company B, he invested $40 more than his investment in company A. Fill in the following blanks: (1) If Joe invested x dollars in company A, how much did he invest in company B?