The number of bottles of perfume and skin care products in company B is 70 ~ x, 30 ~ (40 ~ x) = x ~ 10 respectively.
w= 180x+200(40﹣x)+ 160(70﹣x)+ 150(x﹣ 10)=﹣30x+ 17700.
Therefore, the functional relationship between the total profits W and X of Company A and Company B is W =-30x+ 17700.
(2) The profit of Company A is: 180x+200 (40-x) = 8000-20x,
The profit of company B is:160 (70 ~ x)+150 (x ~10) = 9700 ~10x.
8000﹣20x﹣(9700﹣ 10x)=﹣ 1700﹣ 10x