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!

Given quadratic equation how are the integer solutions found?

  1. Apr 25, 2015 #1
    Not homework but given the question it probably fits here best

    Given the following equation
    $$x^2+138x+317=y^2$$
    How do you find the integer solutions?

    For example wolframalpha has the solutions. but I cannot see how they are derived
    http://www.wolframalpha.com/input/?i=x^2+138x+317=y^2

    By completing the squares and setting [itex]y[/itex] to [itex]0[/itex] I get the x intercepts

    $$x^2+138x+317=y^2$$ ... $$x+69=+/-sqrt(4444)$$ $$x=-69+/-sqrt(4444)= -2.34\ or\ -135.66$$
    But I don't understand how to take it further!

    How do I calculate the integer solutions that WolframAlpha shows?
     
  2. jcsd
  3. Apr 25, 2015 #2

    SammyS

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Gold Member

    It looks like you completed the square correctly.

    After completing the square, you can write the equation as:
    ##\displaystyle\ (x+69)^2-y^2=4444 \ ##​

    Do you recognize that equation?
     
  4. Apr 25, 2015 #3

    Hi Sammy

    No I don't recognise it. As explained this is not homework just personal research. From my research it looks like Fermat's theorem.
    So...
    $$(x+69)^2-y^2 = (x+69+y)(x+69-y)=4444$$
    Is that correct?
    My problem is I can't make sense of the 4444! The actual n value should be 1111 and I am looking to only solve it at the simple factor of [itex]1111 * 1[/itex]

    I seem to have missed a step but I don't know what that step is :(

    Do I divide both sides by 4? and where did the 4 come from...
     
  5. Apr 25, 2015 #4

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Yes, that's what you needed to do. You have two integer factors on the left. How can they lead to the number on the right? There are only so many possibilities.
     
  6. Apr 25, 2015 #5

    SammyS

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Gold Member

    harupex is better prepared to work with you on this than I am.

    I just wanted to get you started.
     
  7. Apr 26, 2015 #6
    So

    $$(x+69)2−y2=(x+69+y)(x+69−y)= 4444 = 4 * 1111 = 1 * 4444$$

    is valid and for 1 solution I just need to find combinations of [itex]x[/itex] and [itex]y[/itex] where [itex]x+y=-65[/itex] and [itex]x-y=1042[/itex]?

    Hmmm ok it makes my next problem a little harder I need to code that as an excel macro
     
  8. Apr 26, 2015 #7

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Yes, but what about other factorisations?
    I don't follow. Where are you getting those numbers from?
    Not sure how to factorise using Excel. Google for it.
     
  9. Apr 26, 2015 #8
    The numbers are from the factors [itex]4[/itex] and [itex]1111[/itex] which have the product [itex]4444[/itex]

    [tex](x+y+69)=4=(x+y)=4-69=-65\ and\ (x-y+69)=4=(x-y)=1111-69=1042[/tex]
    Isn't this correct? If not then I have missed something.

    In this instance I am only interested in the largest number which in this case is [itex]1111[/itex].
     
  10. Apr 26, 2015 #9

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Ok, I see where you get those numbers, but they won't give you integer solutions.
    Think about the parities of the two terms on the left. Can x+y be odd but x-y even?
     
  11. Apr 26, 2015 #10

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    There are more possible factorizations of 4444. Some of them will lead to integer solutions.
     
  12. Apr 26, 2015 #11
    Oops an erroneous [itex]=4[/itex] in that lot.
    Never thought about odds and evens. Like signs its something I always forget :( so the sum of an odd and an even can never be an even
    [tex](x-y+69)=2=(x-y)=2-69=-67\ and\ (x+y+69)=2222=(x+y)=2222-69=2153[/tex]
    Is that better?

    So working that through
    [tex]( 2153 - 67 )/2 = 1043[/tex]
    [tex]( 2153 - 1043 ) = 1110[/tex]
    so 1 possible solution is
    [tex]x=1043: y=1110[/tex]

    Have I done this correctly?
     
  13. Apr 26, 2015 #12

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Yes, that looks right. Earlier you said you were only interested in the largest number, but I'm not sure what you meant by that. Do you mean the largest possible value of x or y?
     
  14. Apr 26, 2015 #13
    Thanks haruspex for all your help, Sammys and mfb too.

    The largest integer number I am interested in is a semiprime. In this case the semiprime is 1111. That's why 4444 threw me. Why did the equation complete to 4444 when I was actually thinking it should have completed to 1111?

    Its starting to make sense to me why by completing the squares I got a number different from what I was expecting. I know I am a long way from complete understanding.

    Being a semiprime I know that factoring (when its large enough) its only two prime factors is computationally expensive. so I am trying to avoid that. The answers I managed to derive above with your help are exactly what I am looking for.
     
  15. Apr 27, 2015 #14

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    $$(x-y+69)=2=(x-y)=2-69=-67\ and\ (x+y+69)=2222=(x+y)=2222-69=2153$$
    Be careful with equal signs. This would imply 2=-67 and 2222=2153 which is clearly wrong.

    Yes, if your factors have more than 20-25 digits it starts to take some time. Factorizing 1111 is trivial.
     
  16. Apr 28, 2015 #15
    Haha I see what you mean. I'll be more careful next time thru
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted