Consider tha the density is calculated by using the following formula:

D is the density, M is the mass and V the volume. In this case, you have;
M = 6 g
V = 2 in x 6 in x 3 in = 36 in^3
Replace the previous values of the parameters into the formula for D:

Hence, the density of the given substance is approximately 0.17 g/in^3