# Isolating a variable gives me endless loop

• HKragh
In summary, the conversation discusses a problem faced by the speaker in isolating a variable of an equation in a game they are working on. They try to solve it using multiplication and division, but end up in an endless loop. One of their colleagues then suggests using the quadratic formula, which leads to a solution. The speaker reflects on how they used to know this method but had forgotten it over time.
HKragh
Coming in here with the following question, when I see what kind of stuff you normally tackle, is very embarrassing! But... I simply am too rusty for this stuff, it seems. This is NOT homework. This is something I need to do in a game I'm working on.

I end up in and endless loop when trying to isolate a variable of an equation. And I have no idea what approach to use to get out of it.

After lots of moving around in the original equation, I end up with this. Which is correct, if I plot in some values. But I need to have a completely isolated.

a=b-((c*d)/a)

Then I try to multiply by "a" on all

a^2 = b*a-c*d

So Now I need to divide by "a"

a = b-((c*d)/a)

Aaand. I'm back.

One of my colleagues helped me out. This is, as you probably already know, a second degree polynomial. So just to make sure the solution is in here, even though none of you probably care:

The variable names are based on the equation above, and so the placement of each might seem out of place with the standard look of it.

D=b^2-4cd

a = (-b+-sqrt(D))/-2

D>0 : 2 solutions
D=0 : 1 solution
D<0 : 0 solutions

Yes, by identifying the equation as a quadratic polynomial then you know to use the quadratic formula:

Its good you answered you own question and posted it as well.

----------------------------------------------------------------------------

So once you have the equation as a^2 = b*a-c*d and rewrite it as: a^2 - ba + cd = 0

then you can see it matches the Ax^2 + Bx + C = 0 format where in your case x=a, A = 1, B=b, C=cd

and the roots for x are (ie your a) are: x = -B/2A +- sqrt(B^2 - 4AC) / 2A

a = -b/2 +- sqrt(b^2 - 4cd)

Last edited:
thx for the extra info, jedishrfu! At some point in life (technical high school thingy) I knew more about this stuff, and solved many problems like this. Then time went by, and I forgot it all. I must say yesterdays experience has made it clear I need to rediscover this set of skills! It must be buried in there, somewhere... :)

The things we learn last are the things we forget first. I know the feeling.

Your "endless loop" came, of course, from your "multiplying by a" in the first step and them "dividing by a" in the second step! Multiplication and division are inverse operations so, in the second step, you just "undid" what you did in the first step.

I know :) The problem was that the only method I knew at the time to get rid of the "a" was by multiplying by it on all terms. And then I had the "a" still as a multiplication, and only knew division as a method to get rid of that. I very much aware how that got me into the loop. That is why I searched for a completely different method than simply multiplying and dividing my term.

## 1. Why does isolating a variable sometimes result in an endless loop?

Isolating a variable involves rearranging an equation to solve for a specific variable. This process can sometimes lead to an endless loop if the equation has multiple solutions or if there is a mistake in the algebraic manipulation. This can cause the equation to continue solving infinitely, resulting in an endless loop.

## 2. How can I avoid getting an endless loop when isolating a variable?

To avoid an endless loop when isolating a variable, it is important to carefully check your algebraic steps and make sure that each step is correct. It can also be helpful to double check your solution by plugging it back into the original equation to ensure that it satisfies the equation.

## 3. Can an endless loop occur when isolating any variable?

An endless loop can potentially occur when isolating any variable, but it is more common with certain types of equations, such as those with multiple solutions or those that involve fractions. It is important to be cautious and double check your work when isolating any variable.

## 4. What can I do if I get stuck in an endless loop while isolating a variable?

If you find yourself in an endless loop while isolating a variable, it can be helpful to go back to the original equation and try a different approach. You can also try using a calculator or online equation solver to check your work or to try a different method of solving the equation.

## 5. Is there a way to predict if isolating a variable will result in an endless loop?

It can be difficult to predict if isolating a variable will result in an endless loop, as it depends on the complexity of the equation and the steps taken to isolate the variable. However, if the equation has multiple solutions or if you are unsure about the accuracy of your algebraic steps, it is important to be cautious and double check your work to avoid an endless loop.

• General Math
Replies
5
Views
613
• General Math
Replies
2
Views
1K
• General Math
Replies
1
Views
632
• General Math
Replies
3
Views
2K
• General Math
Replies
5
Views
1K
• General Math
Replies
6
Views
2K
• General Math
Replies
5
Views
697
• General Math
Replies
1
Views
821
• General Math
Replies
4
Views
826
• Introductory Physics Homework Help
Replies
6
Views
689