# Can someone write me a math equation for this situation

**URL:** <https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075>\
**Category:** In My Humble Opinion\
**Created:** [July 17, 2022, 5:40am UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075 "2022-07-17T05:40:02Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wesley\_Clark](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wesley_clark/32/20581_2.png) [@Wesley\_Clark](https://boards.straightdope.com/u/Wesley_Clark)\
**Post date:** [July 17, 2022, 5:40am UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/1 "2022-07-17T05:40:02Z")

</div>

Youre on a long half life Drug and you redose at intervals shorter than the half life

Half life either 36 hours, 56 hours or 72 hours. You redose every 24 hours.

Dosages:  
Days 1-5 = 12mg day  
Days 6-8 = 8mg day  
Days 9+ = no more dosages

How do you calculate the dosage in your system for all 3 half lives on day 11 or day 16 as examples.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [July 17, 2022, 6:02am UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/2 "2022-07-17T06:02:25Z")

</div>

I’m no pharmacist, but it sounds like you are talking about exponential decay, e.g

12(1+2^{-1/H}+2^{-2/H}+2^{-3/H}+2^{-4/H})\cdot 2^{-6/H} + 8(1+2^{-1/H}+2^{-2/H})2^{-3/H}

---

<div class="post-metadata">

**Author:** ![Wesley\_Clark](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wesley_clark/32/20581_2.png) [@Wesley\_Clark](https://boards.straightdope.com/u/Wesley_Clark)\
**Post date:** [July 17, 2022, 8:37am UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/3 "2022-07-17T08:37:04Z")

</div>

What does H represent in that equation?

Sgouldnt there be 2 variables, the total hours and half life?

---

<div class="post-metadata">

**Author:** ![Saint\_Cad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saint_cad/32/18907_2.png) [@Saint\_Cad](https://boards.straightdope.com/u/Saint_Cad)\
**Post date:** [July 17, 2022, 2:49pm UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/4 "2022-07-17T14:49:23Z")

</div>

Let’s start with the basics. Given half-life H and the dosage taken D then the amount of the medicine in your body after time T is D x 0.5^(T/H)

Looking at a basic example from your OP, we will assume you took the dosage for the first 5 days and the drug has a half-life of 36 hours or 1.5 days. At the end of 15 days the amount of drug in your system is  
12 x 0.5^(15÷1.5) + 12 x 0.5^(14÷1.5) + 12 x 0.5^(13÷1.5) + 12 x 0.5^(12÷1.5) + 12 x 0.5^(11÷1.5)  
But we really want to find a pattern here and each term could be written as an exponential function (no surprise since half-life problems are exponential) to get  
12 x [((0.5 ^ (1/1.5))^15 + ((0.5 ^ (1/1.5))^14 + ((0.5 ^ (1/1.5))^13 + ((0.5 ^ (1/1.5))^12 + ((0.5 ^ (1/1.5))^11]  
Now that we see where this is going let’s simplify it: set A = (0.5)^(1/H). We now get a general form  
D x [A^15 + A^14 + A^13 + A^12 + A^11]  
It is well known that the pattern seen in the second part can be rewritten. If the exponents start at 15 and go all the way to 0 then it would be (A^16 - 1) ÷ (A - 1) but we want to get rid of all of the powers from 10 to 0 so what we end up with is  
D x [((A^16 - 1) - (A - 1))) - ((A^11 - 1) - (A - 1))]  
In your example you would have to do this separately for each separate dosage then add the results together.

Going back to fill in all of the known variables (and I wish I knew how to superscript here)  
D = dosage  
H = half-life in days  
T = days on the medicine (e.g. 11 days or 16 days in your example)  
N = number of days at that dosage  
Then the amount of the drug in your system on day T is  
D x {[((0.5 ^ (1/H))^(T+1) - 1) ÷ ((0.5 ^ (1/H) - 1)] - [((0.5 ^ (1/H))^(T - N +1) - 1) ÷ ((0.5 ^ (1/H) - 1)]}

Given the example (and hopefully make it easier to parse the above)  
D = 12mg  
H = 1.5 =\> 0.5 ^ (1/1.5) = 0.63  
T = 15  
N = 5  
We get 12 x [((0.63^16 - 1) ÷ (0.63 - 1)) - ((0.63^11 - 1) ÷ (0.63 - 1))]  
12 x [2.70104 - 2.68593]  
0.18132mg

As a check I did a simulation in a spreadsheet using the same values and got 0.181135mg and considering the liberal use of rounding I did in the above example I’m calling that a success.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [July 17, 2022, 5:00pm UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/5 "2022-07-17T17:00:07Z")

</div>

Let’s go over it in more detail:

Let us make _H_ the half-life expressed in days, so set _H_ = 1.5 or whatever you need.

Putting in all your doses, after t days the amount of drug is

12\frac{1-2^{-5/H}}{1-2^{-1/H}}2^{-(t-5)/H}+8\frac{1-2^{-3/H}}{1-2^{-1/H}}2^{-(t-8)/H}

(Maybe _t_ should be off by 1 depending on how you count the days, or you can try to account for the dosage hour by hour)

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [July 17, 2022, 6:56pm UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/6 "2022-07-17T18:56:07Z")

</div>

In the formulas folks have posted so far, I’m not seeing any piecewises or Heavisides or however you’re accounting for the changes in dosage regimes.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [July 17, 2022, 7:52pm UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/7 "2022-07-17T19:52:18Z")

</div>

That’s a good point—even a pill does not kick in as an instantaneous impulse (an IV bolus could be modelled like that, though). So, for instance, if the patient received 12 mg/day continuously for T days he or she would end up with

\frac{12 H}{\log 2}(1-2^{-T/H})

or something like that. If they took a pill, you would need to know the absorption rate for it.

---

<div class="post-metadata">

**Author:** ![Saint\_Cad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saint_cad/32/18907_2.png) [@Saint\_Cad](https://boards.straightdope.com/u/Saint_Cad)\
**Post date:** [July 17, 2022, 7:56pm UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/8 "2022-07-17T19:56:58Z")

</div>

> [@Chronos](#):
>
> In the formulas folks have posted so far, I’m not seeing any piecewises

Except for

> In your example you would have to do this separately for each separate dosage then add the results together.

---

<div class="post-metadata">

**Author:** ![Wesley\_Clark](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wesley_clark/32/20581_2.png) [@Wesley\_Clark](https://boards.straightdope.com/u/Wesley_Clark)\
**Post date:** [July 19, 2022, 10:23am UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/9 "2022-07-19T10:23:50Z")

</div>

So for all the people good at math, let me phraae the question another way.

I want to know on what days my concentrations will drop to only 1mg of active drug in my system.

Based on only dosing from days 1-8, and based on 3 potential half lives of 36, 56 and 72 hours respectively, on what 3 days will the concentrations drop to 1mg based on the dosing regimen and half lives provided?

Im assuming itll be around days 20-30 but if anyone has better math please let me know.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [July 19, 2022, 10:51pm UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/10 "2022-07-19T22:51:06Z")

</div>

Going by the formula I posted in Post #5, for the 36-hour half-life the concentration will drop to 1 mg on Day 15. At 56 hours this increases to Day 20, while for 72 hours it goes to Day 24.

---

<div class="post-metadata">

**Author:** ![Wesley\_Clark](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wesley_clark/32/20581_2.png) [@Wesley\_Clark](https://boards.straightdope.com/u/Wesley_Clark)\
**Post date:** [July 20, 2022, 12:35am UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/11 "2022-07-20T00:35:35Z")

</div>

Thank you. Math was never something I was good at so I didn’t know which calculation to use or if it had been posted.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [July 20, 2022, 5:53am UTC](https://boards.straightdope.com/t/can-someone-write-me-a-math-equation-for-this-situation/968075/12 "2022-07-20T05:53:29Z")

</div>

There are some useful formulas here  
[http://file.cop.ufl.edu/pc/PHA5128/5128\_exams/revised06-first-exam-supplement-material.pdf](http://file.cop.ufl.edu/pc/PHA5128/5128_exams/revised06-first-exam-supplement-material.pdf)
