1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Need to Solve this Equation

  1. Oct 3, 2007 #1
    I need to use a program to numerically solve the following equation:


    I tried using Matlab to solve it but I kept on getting an error message. I'm not a programmer or familiar with these numerical solvers at all. Is there some place online I can solve this equation, or can someone post the Matlab code to solve it? The code is not part of the homework, but I arrived at the above equation and need to solve it in order to finalize my answer, so if anyone could help me solve it that would be great. Thanks.
  2. jcsd
  3. Oct 3, 2007 #2


    User Avatar
    Science Advisor

    Well, you can simplify the right-hand side quite a bit. Ultimately you can turn it into a cubic equation for x.
  4. Oct 3, 2007 #3

    D H

    Staff: Mentor

    First, simplify the expression. Then reformulate it in the form [itex]f(x)=0[/itex].

    You now have something amenable to the zero finding functions.

    [itex]x=2[/itex] and [itex]x=-1[/itex] are obviously problematic. You want to find a pair of [itex]x[/itex] values [itex]x_1[/itex] and [itex]x_2[/itex] such that neither of the poles is between [itex]x_1[/itex] and [itex]x_2[/itex] and such that [itex]f(x_1)[/itex] and [itex]f(x_2)[/itex] have opposite signs. There is a zero between these points.
    Last edited: Oct 3, 2007
  5. Oct 3, 2007 #4

    D H

    Staff: Mentor

    Not quite that much. You get a rational polynomial, a simple cubic divided by a quadratic.

    EDIT: I worked to much today.

    Ultimately, you're right. Simplifying the RHS leads to [itex]p(x)/q(x)-c=0[/itex] where [itex]p(x)[/itex]is cubic and [itex]q(x)[/itex] is quadratic. Multiplying by [itex]q(x)[/itex] yields [itex]p(x)-cq(x)=0[/itex], a cubic.
    Last edited: Oct 3, 2007
  6. Oct 3, 2007 #5
    For the RHS I expanded everything out and got this:


    Is this correct?
  7. Oct 3, 2007 #6

    D H

    Staff: Mentor

    Don't expand! Get rid of the common factor instead. Look at the numerator and denominator.
  8. Oct 3, 2007 #7
    Oh, ok so one gets:

  9. Oct 3, 2007 #8

    D H

    Staff: Mentor

    Yes. You can also get rid of a factor of two. And oops, I said cubic/quadratic. What you have is a ratio of two cubics, which is correct. Now multiply through by the denominator to get a cubic equation (valid so long as x is not 2 or -1).
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Need to Solve this Equation