The problem is as follows:
Mike buys an unknown quantity of hardcover books for a total of $\textrm{328 USD}$. Later on, he realizes that had he bought their respective paperback versions they had cost $\textrm{4.5 USD}$ less each and by doing this he would have ended with $4$ more books and spend only $\textrm{320 USD}$. How much was the cost of each hardcover books which Mike bought?
This problem has made me to walk in circles for several hours and finally I thought that it has something to do with a quadratic equation or so.
What I thought was this:
If I want to relate the cost of something and the number of things I would use this formula:
$$x\,\left(\frac{\textrm{cost in whatever currency}}{\textrm{per item whatever is it}}\right ) \times\,\textrm{a elements}=\textrm{total cost}$$
Therefore I used this equation in my attempt to solve this problem:
I defined the number of hardcover books as $\textrm{H}$ and the number of paperback books as $\textrm{P}$, the cost for each of the hardcover books $\textrm{x}$ and the cost for each of the paperback books as $x-4.5$ as in the problem states they would had cost $\textrm{4.5 USD}$ less each.
The first part of the problem does not specify how many and how much for the hardcover books just the total cost so the equation becomes into:
$$\left (x \right) \left ( \textrm{H}\right ) = 328$$
The second part of the problem does mention that the cost of the paperback books is $\textrm{320 USD}$ so it becomes into:
$$\left (x-4.5 \right) \left ( \textrm{P}\right ) = 320$$
There is a third relationship which has been mentioned in the problem and that is the number of paperback books is the number of hardcover books plus four therefore:
$$P=H+4$$
So the second equation becomes into:
$$\left (x-4.5 \right) \left ( \textrm{H+4}\right ) = 320$$
Then all that is left to do is solve the system:
$$\left (x \right) \times \left ( \textrm{H}\right ) = 328$$
$$\left (x-4.5 \right) \times \left ( \textrm{H+4}\right ) = 320$$
Therefore:
$$xH+4x-4.5H-4.5\times4=320$$
inserting into the previous equation the first one and $$H=\frac{328}{x}$$
$$328+4x-4.5\times\left( \frac{328}{x}\right )-18=320$$
$$4x-\frac{1476}{x}-10=0$$
Multiplying by $x$ in both sides:
$$4x^{2}-10x-1476=0$$
Simplifying:
$$2x^{2}-5x-738=0$$
To solve the quadratic equation I used the formula:
$$X_{1,2}=\frac{5 \pm \sqrt{5^{2}-4\times\left( 2 \times \left(-738 \right)\right ) }}{2\times 2}$$
$$x_{1,2}=\frac{5 \pm \sqrt{5929}}{4}$$
Then the answers become
$$x_{1}=\frac{5+77}{4}=\frac{82}{4}=20.5$$
$$x_{2}=\frac{5-77}{4}=\frac{-72}{4}=-18$$
Now it is obvious that I cannot choose the negative value and since I defined as $x$ to be cost of each hardcover book the answer must be $\textrm{20.5 USD}$.
And the cost of the paperback book each must be: $$20.5-4.5=16.0\,\textrm{USD}$$
althought the latter was not asked.
Is what I did correct?. The answer seems reasonable, but I'm not very sure if my substitutions are correct.
Is this the only way to approach this problem or could be another way to solve it faster?.