Step 1: List the given information. Total students = 40. Only Mathematics = 3, Only Chemistry = 15. One fifth of 40 is 8, and three less than that is 5, so 5 students study all three subjects. Physics total = 20.
Step 2: Assign variables to the unknown overlap regions. Let x = students studying Mathematics and Physics only (not Chemistry), y = students studying Mathematics and Chemistry only (not Physics), z = students studying Physics and Chemistry only (not Mathematics). Since the Mathematics-Physics total equals the Mathematics-Chemistry total, and both totals include the same group of 5 triple-overlap students, the only-two regions must also be equal, so x = y.
Step 3: Write the Mathematics and Chemistry totals. Mathematics total = Only Mathematics + x + y + All three = 3 + x + y + 5 = 8 + 2x, using y = x. Chemistry total = Only Chemistry + y + z + All three = 15 + x + z + 5 = 20 + x + z.
Step 4: Use the percentage condition. Mathematics = 2 + 40% of Chemistry, so \(8 + 2x = 2 + 0.4(20 + x + z)\). Expanding gives \(8 + 2x = 10 + 0.4x + 0.4z\), so \(1.6x - 0.4z = 2\), which simplifies to \(4x - z = 5\).
Step 5: Use the Only Physics condition. Only Physics = Mathematics total minus 2 = \(6 + 2x\). Physics total = Only Physics + x + z + All three = 20, so \((6 + 2x) + x + z + 5 = 20\), which simplifies to \(3x + z = 9\).
Step 6: Solve the two equations. Adding \(4x - z = 5\) and \(3x + z = 9\) gives \(7x = 14\), so \(x = 2\). Then \(z = 9 - 6 = 3\) and \(y = x = 2\).
Step 7: Verify against the total of 40. Only Mathematics(3) + Only Physics(10) + Only Chemistry(15) + Mathematics-Physics only(2) + Mathematics-Chemistry only(2) + Physics-Chemistry only(3) + All three(5) = 40, which checks out.
Step 8: State the answer. Students studying both Mathematics and Chemistry but not all three subjects is exactly y.\[\boxed{2}\]