[Heavily edited for clarity.] So, I'm playing around with a function that describes the change of an individuals weight as a function of days passed given a number of constant variables: current weight, target weight, number of days until target weight will be reached, and daily calorie target. My function is derived from an equation that describes weight after a number of days given a constant caloric deficit, d: f(0) = a; f(x+1) = f(x) - (d/3500) f(n) = b; With this set of equations, we can solve for d (daily caloric deficit) given a (starting weight), b (ending weight), and n (number of days until ending weight is reached). That's fine, but I wanted to alter this set of equations to allow for variable values of d. So, I removed d as a constant variable and allowed it to equal g(x)-t where g(x) is a calculated caloric baseline. Now I want to solve for a constant value t (a constant daily caloric target) that would result in a decrease to weight b after n days given a starting weight a. f(0) = a; // where a is current weight g(x) = q + p*f(x); // this describes a linear relationship between caloric baseline and weight f(x+1) = (g(x)-t)/3500; // t is the constant caloric target, so g(x)-t is caloric deficit. f(n) = b; // n = number of days until target weight will be reached. b = target weight. Of course, f(x+1) and g(x) could be combined; I kept the separate to illustrate the model. Now, my question is... how would I solve for t if a, n, b, q, and p are all known? I intuitively known there is a way to solve this, but I can't figure it out, and it's bugging me. If anyone could help me figure this out, I'd appreciate it. Edit: by the way, if this isn't calculus... my bad.