Which rationals can be written as the sum of two rational squares?












11












$begingroup$


Which rational numbers can be written as the sum of two rational squares?



That is, for which rational numbers $a$, are there rational numbers $x$ and $y$ such that $a = x^2 + y^2$.



It is a famous theorem that if an integer can be written as the sum of two rational squares then it can be written as the sum of two integral squares, and then the solution is the famous one by Fermat, but I didn't find anything about the general case.










share|cite|improve this question











$endgroup$












  • $begingroup$
    math.stackexchange.com/questions/1200794/… mentions a solution but gives no references.
    $endgroup$
    – lhf
    Sep 21 '15 at 13:53












  • $begingroup$
    the last part of that question states the result asked for here.
    $endgroup$
    – Ross Millikan
    Sep 21 '15 at 13:55










  • $begingroup$
    What about $x=frac35,y=frac45$?
    $endgroup$
    – abiessu
    Sep 21 '15 at 13:56






  • 2




    $begingroup$
    Basically an Pythagorean triple?
    $endgroup$
    – Gummy bears
    Sep 21 '15 at 14:02






  • 4




    $begingroup$
    can you not clear the denominators and apply the standard results?
    $endgroup$
    – Matt B
    Sep 21 '15 at 14:19


















11












$begingroup$


Which rational numbers can be written as the sum of two rational squares?



That is, for which rational numbers $a$, are there rational numbers $x$ and $y$ such that $a = x^2 + y^2$.



It is a famous theorem that if an integer can be written as the sum of two rational squares then it can be written as the sum of two integral squares, and then the solution is the famous one by Fermat, but I didn't find anything about the general case.










share|cite|improve this question











$endgroup$












  • $begingroup$
    math.stackexchange.com/questions/1200794/… mentions a solution but gives no references.
    $endgroup$
    – lhf
    Sep 21 '15 at 13:53












  • $begingroup$
    the last part of that question states the result asked for here.
    $endgroup$
    – Ross Millikan
    Sep 21 '15 at 13:55










  • $begingroup$
    What about $x=frac35,y=frac45$?
    $endgroup$
    – abiessu
    Sep 21 '15 at 13:56






  • 2




    $begingroup$
    Basically an Pythagorean triple?
    $endgroup$
    – Gummy bears
    Sep 21 '15 at 14:02






  • 4




    $begingroup$
    can you not clear the denominators and apply the standard results?
    $endgroup$
    – Matt B
    Sep 21 '15 at 14:19
















11












11








11


6



$begingroup$


Which rational numbers can be written as the sum of two rational squares?



That is, for which rational numbers $a$, are there rational numbers $x$ and $y$ such that $a = x^2 + y^2$.



It is a famous theorem that if an integer can be written as the sum of two rational squares then it can be written as the sum of two integral squares, and then the solution is the famous one by Fermat, but I didn't find anything about the general case.










share|cite|improve this question











$endgroup$




Which rational numbers can be written as the sum of two rational squares?



That is, for which rational numbers $a$, are there rational numbers $x$ and $y$ such that $a = x^2 + y^2$.



It is a famous theorem that if an integer can be written as the sum of two rational squares then it can be written as the sum of two integral squares, and then the solution is the famous one by Fermat, but I didn't find anything about the general case.







number-theory






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Sep 21 '15 at 14:00







lhf

















asked Sep 21 '15 at 13:50









lhflhf

168k11172404




168k11172404












  • $begingroup$
    math.stackexchange.com/questions/1200794/… mentions a solution but gives no references.
    $endgroup$
    – lhf
    Sep 21 '15 at 13:53












  • $begingroup$
    the last part of that question states the result asked for here.
    $endgroup$
    – Ross Millikan
    Sep 21 '15 at 13:55










  • $begingroup$
    What about $x=frac35,y=frac45$?
    $endgroup$
    – abiessu
    Sep 21 '15 at 13:56






  • 2




    $begingroup$
    Basically an Pythagorean triple?
    $endgroup$
    – Gummy bears
    Sep 21 '15 at 14:02






  • 4




    $begingroup$
    can you not clear the denominators and apply the standard results?
    $endgroup$
    – Matt B
    Sep 21 '15 at 14:19




















  • $begingroup$
    math.stackexchange.com/questions/1200794/… mentions a solution but gives no references.
    $endgroup$
    – lhf
    Sep 21 '15 at 13:53












  • $begingroup$
    the last part of that question states the result asked for here.
    $endgroup$
    – Ross Millikan
    Sep 21 '15 at 13:55










  • $begingroup$
    What about $x=frac35,y=frac45$?
    $endgroup$
    – abiessu
    Sep 21 '15 at 13:56






  • 2




    $begingroup$
    Basically an Pythagorean triple?
    $endgroup$
    – Gummy bears
    Sep 21 '15 at 14:02






  • 4




    $begingroup$
    can you not clear the denominators and apply the standard results?
    $endgroup$
    – Matt B
    Sep 21 '15 at 14:19


















$begingroup$
math.stackexchange.com/questions/1200794/… mentions a solution but gives no references.
$endgroup$
– lhf
Sep 21 '15 at 13:53






$begingroup$
math.stackexchange.com/questions/1200794/… mentions a solution but gives no references.
$endgroup$
– lhf
Sep 21 '15 at 13:53














$begingroup$
the last part of that question states the result asked for here.
$endgroup$
– Ross Millikan
Sep 21 '15 at 13:55




$begingroup$
the last part of that question states the result asked for here.
$endgroup$
– Ross Millikan
Sep 21 '15 at 13:55












$begingroup$
What about $x=frac35,y=frac45$?
$endgroup$
– abiessu
Sep 21 '15 at 13:56




$begingroup$
What about $x=frac35,y=frac45$?
$endgroup$
– abiessu
Sep 21 '15 at 13:56




2




2




$begingroup$
Basically an Pythagorean triple?
$endgroup$
– Gummy bears
Sep 21 '15 at 14:02




$begingroup$
Basically an Pythagorean triple?
$endgroup$
– Gummy bears
Sep 21 '15 at 14:02




4




4




$begingroup$
can you not clear the denominators and apply the standard results?
$endgroup$
– Matt B
Sep 21 '15 at 14:19






$begingroup$
can you not clear the denominators and apply the standard results?
$endgroup$
– Matt B
Sep 21 '15 at 14:19












2 Answers
2






active

oldest

votes


















15












$begingroup$

Let $r=frac{p}{q}$, where $p$ and $q$ are integers. We will show that $r$ can be written as the sum of two rational squares if and only if $pq$ can be written as the sum of the squares of two integers.



Equivalently, if $pne 0$, then $frac{p}{q}$ is a sum of the squares of two rationals if and only if every prime divisor of $pq$ of the form $4k+3$ occurs to an even power.



Proof: If $pq$ is the sum of the squares of two integers, it is clear that $r$ is the sum of the squares of two rationals.



For the other direction, suppose that $r$ can be written as the sum of the squares of two rationals. Without loss of generality we may assume that the rationals are $frac{a}{c}$ and $frac{b}{c}$ for some integers $a,b,c$. Then
$$frac{a^2+b^2}{c^2}=frac{pq}{q^2}.$$
So $c^2pq$ is a sum of two squares. It follows that every prime of the form $4k+3$ occurs to an even degree in the prime power factorization of $c^2pq$, and hence of $pq$. It follows that $pq$ is a sum of two squares.






share|cite|improve this answer











$endgroup$









  • 1




    $begingroup$
    The first observation is the clever trick!
    $endgroup$
    – lhf
    Sep 21 '15 at 14:34



















5












$begingroup$

This can be translated in a question about Hilbert symbols (or quaternion algebras). In fact you can check easily that a rational $a$ can be written as a sum of two squares if and only if the Hilbert symbol $(a,-1)_{mathbb Q}$ is trivial. Now write $a=p/q$ and notice that $(p/q,-1)=(pq,-1)$. You can forget about all squares in the factorization of $pq$, so you can assume that $p$ and $q$ are both squarefree. Now look at the prime factorization of $p$ and $q$ and use the fact that $(x,-1)(y,-1)=(xy,-1)$ for all $x,yinmathbb Q$, toghether with the fact that for a prime $l$ you have that $(l,-1)$ is trivial iff $lequiv 1,2bmod 4$ while if $lequiv 3bmod 4$ then $(l,-1)$ ramifies at $2$ and $l$ to get your answer: $a$ can be written as a sum of two squares iff it is non-negative and is of the form $b^2frac{p}{q}$ where $binmathbb Q$ and $p,q$ are coprime integers divided only by primes $equiv 1,2bmod 4$.






share|cite|improve this answer









$endgroup$














    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1445058%2fwhich-rationals-can-be-written-as-the-sum-of-two-rational-squares%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    15












    $begingroup$

    Let $r=frac{p}{q}$, where $p$ and $q$ are integers. We will show that $r$ can be written as the sum of two rational squares if and only if $pq$ can be written as the sum of the squares of two integers.



    Equivalently, if $pne 0$, then $frac{p}{q}$ is a sum of the squares of two rationals if and only if every prime divisor of $pq$ of the form $4k+3$ occurs to an even power.



    Proof: If $pq$ is the sum of the squares of two integers, it is clear that $r$ is the sum of the squares of two rationals.



    For the other direction, suppose that $r$ can be written as the sum of the squares of two rationals. Without loss of generality we may assume that the rationals are $frac{a}{c}$ and $frac{b}{c}$ for some integers $a,b,c$. Then
    $$frac{a^2+b^2}{c^2}=frac{pq}{q^2}.$$
    So $c^2pq$ is a sum of two squares. It follows that every prime of the form $4k+3$ occurs to an even degree in the prime power factorization of $c^2pq$, and hence of $pq$. It follows that $pq$ is a sum of two squares.






    share|cite|improve this answer











    $endgroup$









    • 1




      $begingroup$
      The first observation is the clever trick!
      $endgroup$
      – lhf
      Sep 21 '15 at 14:34
















    15












    $begingroup$

    Let $r=frac{p}{q}$, where $p$ and $q$ are integers. We will show that $r$ can be written as the sum of two rational squares if and only if $pq$ can be written as the sum of the squares of two integers.



    Equivalently, if $pne 0$, then $frac{p}{q}$ is a sum of the squares of two rationals if and only if every prime divisor of $pq$ of the form $4k+3$ occurs to an even power.



    Proof: If $pq$ is the sum of the squares of two integers, it is clear that $r$ is the sum of the squares of two rationals.



    For the other direction, suppose that $r$ can be written as the sum of the squares of two rationals. Without loss of generality we may assume that the rationals are $frac{a}{c}$ and $frac{b}{c}$ for some integers $a,b,c$. Then
    $$frac{a^2+b^2}{c^2}=frac{pq}{q^2}.$$
    So $c^2pq$ is a sum of two squares. It follows that every prime of the form $4k+3$ occurs to an even degree in the prime power factorization of $c^2pq$, and hence of $pq$. It follows that $pq$ is a sum of two squares.






    share|cite|improve this answer











    $endgroup$









    • 1




      $begingroup$
      The first observation is the clever trick!
      $endgroup$
      – lhf
      Sep 21 '15 at 14:34














    15












    15








    15





    $begingroup$

    Let $r=frac{p}{q}$, where $p$ and $q$ are integers. We will show that $r$ can be written as the sum of two rational squares if and only if $pq$ can be written as the sum of the squares of two integers.



    Equivalently, if $pne 0$, then $frac{p}{q}$ is a sum of the squares of two rationals if and only if every prime divisor of $pq$ of the form $4k+3$ occurs to an even power.



    Proof: If $pq$ is the sum of the squares of two integers, it is clear that $r$ is the sum of the squares of two rationals.



    For the other direction, suppose that $r$ can be written as the sum of the squares of two rationals. Without loss of generality we may assume that the rationals are $frac{a}{c}$ and $frac{b}{c}$ for some integers $a,b,c$. Then
    $$frac{a^2+b^2}{c^2}=frac{pq}{q^2}.$$
    So $c^2pq$ is a sum of two squares. It follows that every prime of the form $4k+3$ occurs to an even degree in the prime power factorization of $c^2pq$, and hence of $pq$. It follows that $pq$ is a sum of two squares.






    share|cite|improve this answer











    $endgroup$



    Let $r=frac{p}{q}$, where $p$ and $q$ are integers. We will show that $r$ can be written as the sum of two rational squares if and only if $pq$ can be written as the sum of the squares of two integers.



    Equivalently, if $pne 0$, then $frac{p}{q}$ is a sum of the squares of two rationals if and only if every prime divisor of $pq$ of the form $4k+3$ occurs to an even power.



    Proof: If $pq$ is the sum of the squares of two integers, it is clear that $r$ is the sum of the squares of two rationals.



    For the other direction, suppose that $r$ can be written as the sum of the squares of two rationals. Without loss of generality we may assume that the rationals are $frac{a}{c}$ and $frac{b}{c}$ for some integers $a,b,c$. Then
    $$frac{a^2+b^2}{c^2}=frac{pq}{q^2}.$$
    So $c^2pq$ is a sum of two squares. It follows that every prime of the form $4k+3$ occurs to an even degree in the prime power factorization of $c^2pq$, and hence of $pq$. It follows that $pq$ is a sum of two squares.







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Sep 21 '15 at 14:33

























    answered Sep 21 '15 at 14:23









    André NicolasAndré Nicolas

    455k36432821




    455k36432821








    • 1




      $begingroup$
      The first observation is the clever trick!
      $endgroup$
      – lhf
      Sep 21 '15 at 14:34














    • 1




      $begingroup$
      The first observation is the clever trick!
      $endgroup$
      – lhf
      Sep 21 '15 at 14:34








    1




    1




    $begingroup$
    The first observation is the clever trick!
    $endgroup$
    – lhf
    Sep 21 '15 at 14:34




    $begingroup$
    The first observation is the clever trick!
    $endgroup$
    – lhf
    Sep 21 '15 at 14:34











    5












    $begingroup$

    This can be translated in a question about Hilbert symbols (or quaternion algebras). In fact you can check easily that a rational $a$ can be written as a sum of two squares if and only if the Hilbert symbol $(a,-1)_{mathbb Q}$ is trivial. Now write $a=p/q$ and notice that $(p/q,-1)=(pq,-1)$. You can forget about all squares in the factorization of $pq$, so you can assume that $p$ and $q$ are both squarefree. Now look at the prime factorization of $p$ and $q$ and use the fact that $(x,-1)(y,-1)=(xy,-1)$ for all $x,yinmathbb Q$, toghether with the fact that for a prime $l$ you have that $(l,-1)$ is trivial iff $lequiv 1,2bmod 4$ while if $lequiv 3bmod 4$ then $(l,-1)$ ramifies at $2$ and $l$ to get your answer: $a$ can be written as a sum of two squares iff it is non-negative and is of the form $b^2frac{p}{q}$ where $binmathbb Q$ and $p,q$ are coprime integers divided only by primes $equiv 1,2bmod 4$.






    share|cite|improve this answer









    $endgroup$


















      5












      $begingroup$

      This can be translated in a question about Hilbert symbols (or quaternion algebras). In fact you can check easily that a rational $a$ can be written as a sum of two squares if and only if the Hilbert symbol $(a,-1)_{mathbb Q}$ is trivial. Now write $a=p/q$ and notice that $(p/q,-1)=(pq,-1)$. You can forget about all squares in the factorization of $pq$, so you can assume that $p$ and $q$ are both squarefree. Now look at the prime factorization of $p$ and $q$ and use the fact that $(x,-1)(y,-1)=(xy,-1)$ for all $x,yinmathbb Q$, toghether with the fact that for a prime $l$ you have that $(l,-1)$ is trivial iff $lequiv 1,2bmod 4$ while if $lequiv 3bmod 4$ then $(l,-1)$ ramifies at $2$ and $l$ to get your answer: $a$ can be written as a sum of two squares iff it is non-negative and is of the form $b^2frac{p}{q}$ where $binmathbb Q$ and $p,q$ are coprime integers divided only by primes $equiv 1,2bmod 4$.






      share|cite|improve this answer









      $endgroup$
















        5












        5








        5





        $begingroup$

        This can be translated in a question about Hilbert symbols (or quaternion algebras). In fact you can check easily that a rational $a$ can be written as a sum of two squares if and only if the Hilbert symbol $(a,-1)_{mathbb Q}$ is trivial. Now write $a=p/q$ and notice that $(p/q,-1)=(pq,-1)$. You can forget about all squares in the factorization of $pq$, so you can assume that $p$ and $q$ are both squarefree. Now look at the prime factorization of $p$ and $q$ and use the fact that $(x,-1)(y,-1)=(xy,-1)$ for all $x,yinmathbb Q$, toghether with the fact that for a prime $l$ you have that $(l,-1)$ is trivial iff $lequiv 1,2bmod 4$ while if $lequiv 3bmod 4$ then $(l,-1)$ ramifies at $2$ and $l$ to get your answer: $a$ can be written as a sum of two squares iff it is non-negative and is of the form $b^2frac{p}{q}$ where $binmathbb Q$ and $p,q$ are coprime integers divided only by primes $equiv 1,2bmod 4$.






        share|cite|improve this answer









        $endgroup$



        This can be translated in a question about Hilbert symbols (or quaternion algebras). In fact you can check easily that a rational $a$ can be written as a sum of two squares if and only if the Hilbert symbol $(a,-1)_{mathbb Q}$ is trivial. Now write $a=p/q$ and notice that $(p/q,-1)=(pq,-1)$. You can forget about all squares in the factorization of $pq$, so you can assume that $p$ and $q$ are both squarefree. Now look at the prime factorization of $p$ and $q$ and use the fact that $(x,-1)(y,-1)=(xy,-1)$ for all $x,yinmathbb Q$, toghether with the fact that for a prime $l$ you have that $(l,-1)$ is trivial iff $lequiv 1,2bmod 4$ while if $lequiv 3bmod 4$ then $(l,-1)$ ramifies at $2$ and $l$ to get your answer: $a$ can be written as a sum of two squares iff it is non-negative and is of the form $b^2frac{p}{q}$ where $binmathbb Q$ and $p,q$ are coprime integers divided only by primes $equiv 1,2bmod 4$.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Sep 21 '15 at 14:19









        FerraFerra

        3,82111024




        3,82111024






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1445058%2fwhich-rationals-can-be-written-as-the-sum-of-two-rational-squares%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Plaza Victoria

            Puebla de Zaragoza

            Musa