An example

equation:

x = a*3+b*0.02+c*0.5

I need to change the value of x by some number "s".

This means I need to change the value of a, b, and c so that when added up, new x is now x + s.

The obvious solution to this would be:

new a = a + s * a / x

new b = b + s * b / x

new c = c + s * c / x

new x results in the correct amount, equal to x + s.

However, I need to be able to take into account the product of each variable and the constant it's being multiplied by.

__I need to increase each variable depending on that product's percentage of the total value of x.__
If we simply do:

new a = a + s * a * 3 / x

new b = b + s * b * 0.02 / x

new c = c + s * c * 0.5 / x

Unlike in the previous example solution, this results in the sum of the change applied to a, b and c being equal to s. So that (new a + new b + new c = x + s), however, that is not desired either, because the equation that needs to equal x + s has constants which will be multiplied by these variables, producing a different total.

I've been struggling with this for days. I'm sure I'm missing something obvious.

My only hope is the math geniuses here.

If it helps, every example equation will follow the pattern of x = a*b+c*d+e*f+g*h.. etc.

If there's any information necessary to solve this missing from what I've provided, I may have it available. Please do ask.

## Bookmarks