Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Isolating a variable gives me endless loop

  1. Mar 17, 2014 #1
    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.

    Please help me out with what seems to be VERY easy, if you know your stuff.
     
  2. jcsd
  3. Mar 17, 2014 #2
    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
     
  4. Mar 17, 2014 #3

    jedishrfu

    Staff: Mentor

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

    http://en.wikipedia.org/wiki/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: Mar 17, 2014
  5. Mar 18, 2014 #4
    thx for the extra info, jedishrfu! At some point in life (technical highschool 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... :)
     
  6. Mar 18, 2014 #5

    jedishrfu

    Staff: Mentor

    The things we learn last are the things we forget first. I know the feeling.
     
  7. Mar 18, 2014 #6

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    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.
     
  8. Mar 18, 2014 #7
    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Isolating a variable gives me endless loop
  1. Give me please hint (Replies: 1)

  2. Isolating the variable (Replies: 3)

  3. Isolating a variable (Replies: 8)

Loading...