Cubic inch means we are dealing with volume.
So,
Calculate the volume of both boxes.
1. 3x9x12 = 324 cubic inches
2. 2x8x9 = 144 cubic inches
First box costs $6 for 324 cubic inches, so if you divide 6 by 324 you will get the price for 1 cubic inch of the box.
6/324 = $0.018518518518519
2.
Second box costs $4.50 for 144 cubic inches.
4.5/144 = $0.03125
Subtract the cheaper one from the more expensive one to find the difference.
0.03125 - 0.018518518518519 = 0.012731481481481
The difference in price per cubic inch is
$0.012731481481481
Or about 1.3 cents.