From what I see you decided to label the amount of liquids C and D. Lets call them A and B instead to avoid confusion with Vitamin C and D..2C+.3D=40
So from now on A = Volume of liquid A and B = Volume of Liquid B.
We need 40mg of Vitamin C. Liquid A has 20% Vitamin C and Liquid B has 40% Vitamin C. So
0.2A + 0.4B = 40
We need 30mg of Vitamin D. Liquid A has 30% Vitamin C and Liquid B has 20% Vitamin C. So
0.3A + 0.2B = 30
With these two equations, you should be getting the answer given in your book.