Suppose we have many of squares of the following sizes: $1\times 1, 2\times 9, 3\times 5$ and we want to fill a board of size $16\times 32$ with squares such that we use a minimal amount of squares and there's no unused space on the board or on any of the squares (squares with parts that go out of the bounds of the board).
Is it possible to make a function and derive it to get the minimum in order to solve this?
For example:
$x = 1\times 1 \\ y = 2\times 9 \\ z = 3\times 5$
So the function is the total space on the board minus the space the squares take: $f(x,y,z) = 512 - (16x + 18y + 15z)$
And now to look for the minimal intersection point with the x axis?
Note: I made up those numbers numbers so they might not work but let's suppose it is possible to fill the board according to the rules.
I assume your question also requires that there is no overlapping between different blocks.
As you pointed out, counting area of blocks, we should have
$$ 512 = x + 18y + 15z, $$
where $x, y, z$ is the number of blocks of size $1 \times 1, 2 \times 9, 3 \times 5$ respectively. We are trying to minimize the total number of blocks
$$ S = x + y + z = 512 - 17y - 14z. (x, y, z \geq 0) $$
Ideally you want more blocks of the larger size, so we want $y, z$ to be larger. Now the question becomes to maximize
$$ d = 17y + 14z, $$
subject to the conditions that
$$ 512 \geq 18y + 15z, \quad y, z \in \mathbb{Z}^{\geq 0}. $$
A simple computational calculation (use matlab or excel table) give you the following candidates
$$ (x, y, z, S) = (2, 25, 4, 31), (2, 20, 10, 32), (2, 15, 16, 33). $$
We need to check if any of these actually give a tiling as desired. In fact, $\min S = 31$ blocks will work, see the following picture:
In my opinion, there is not a perfect strategy for such tiling problems (i.e. if you change the numbers again), but inequalities with integral solutions (by reducing the number of variables) help you narrow down possible maximizers/minimizers.