The problem is as follows:
Louis took three and a half type $A$ pills every twelve hours and a half type $B$ pills every $6$ hours. He did this until the difference in the number of pills taken was $25$. If he starts taking both types of pills together, how long does the treatment last and how many pills had he taken in total?.
The alternatives given in my book are as follows:
$\begin{array}{ll} 1.&\textrm{4.75 days and 44 pills}\\ 2.&\textrm{4.75 days and 45 pills}\\ 3.&\textrm{3.75 days and 43 pills}\\ 4.&\textrm{4.5 days and 45 pills}\\ \end{array}$
How exactly should I solve this problem?.
What I've attempted so far was to use this formula which is based on the fact that the number of pills taken can be found by computing the division of the total time with that of the interval between each dose plus $1$ which guarantees to account all together and without falling in the off by one error.
Thus the labels are as follows:
$t_{1}$: total elapsed time
$t_{2}$: interval time between dose
$\textrm{total of A pills: a}$
$\textrm{total of B pills: b}$
$\left(3+\frac{1}{2}\right)\left(\frac{t_1}{t_2}+1\right)=a$
$\left(\frac{1}{2}\right)\left(\frac{t_1}{t_2}+1\right)=b$
$a-b=25$
Replacing with the given information:
$\left(3+\frac{1}{2}\right)\left(\frac{t_1}{12}+1\right)=a$
$\left(\frac{1}{2}\right)\left(\frac{t_1}{6}+1\right)=b$
$\left(3+\frac{1}{2}\right)\left(\frac{t_1}{12}+1\right)-\left(\frac{1}{2}\right)\left(\frac{t_1}{6}+1\right)=25$
Then solving this yields:
$t=\frac{528}{5}$
But this number is not an integer and it doesn't seem to help me to get the requested time. Thus I need help in the right approach for this question. Can someone help me here? It would help me a lot a wordy answer so I can understand what is going on.
Hmm. So every $12$ hours, he takes $3.5A + B$ pills. In $24$ hours, he takes $7A + 2B$ pills, for a difference of $5$ pills. That suggests $5$ days, but now we can look at that last $24$ hours.
After $4$ days, he's taken $28A + 8B$ pills. Oh, but this is one of those tricky ones, isn't it? His first set of pills was at $t = 0$, which means he's taken these $28A + 8B$ pills at $t = 3.5$ (measuring $t$ in days). Then at $t=3.75, P = 28A + 8.5B$. At $t = 4, P = 31.5A + 9B$. At $t=4.5, P = 35A + 10B$.
$4.5$ days and $45$ pills seems to be choice number 4. I think algebra just... isn't actually the best way to solve this, partly because these are stepwise functions. But for an algebraic solution, I'd probably use rates so I don't have an "elapsed time" as well as two "interval times." So measuring $t$ in hours,
$$A = 3.5 + \frac{3.5}{12} t$$ $$B = 0.5 + \frac{0.5}{6} t$$ $$A-B = 25 = 3.5 + \frac{3.5}{12} t - 0.5 - \frac{0.5}{6} t$$
And that also yields an answer of $4.4$ days, which is what you had. So then you have to look at where the stepwise function is at $4.25$ and $4.5$ days, and $4.5$ wins as above.