I tried multiplying both sided by 4a which leads to $(6x+4)^2=40 \pmod{372}$ now I'm stuck with how to find the square root of a modulo.
-
You multiplied both sides by "$4a$" and got something not having an $a$? Clarify. Also note (I am assuming that the equation is correct) that $9 = 3^2$ as a real number, so even the modular square root is just the same i.e. $\pm 3$. – Sarvesh Ravichandran Iyer Oct 26 '20 at 05:08
-
1@TeresaLisbon Sorry I checked again and edited the question. – heera thakur Oct 26 '20 at 05:17
-
1$3(3x^2+4x-2)=9x^2+12x-6=9x^2+12x+4-10=(3x+2)^2-10$ so we want to solve $(3x+2)^2\equiv10\bmod{31}$. Now add multiples of $31$ to $10$ until you get a square. – Gerry Myerson Oct 26 '20 at 05:21
-
2How on earth did you go from $\mod{31}$ to $\mod {372}$? And I'm not at all sure I understat that $0\times 4a = 40$ and $(3x^2 + 4x -2)4a = (6x+4)^2$. Not at all sure what you are trying to do. – fleablood Oct 26 '20 at 05:38
-
In addition to being a bit short of context this question is in my opinion also a duplicate of this old question and several others. I cannot understand why users with six digit rep figures think the site is improved by having another quadratic equation solved. – Jyrki Lahtonen Oct 26 '20 at 06:40
-
@flea OP is multiplying through by $12$ (by $4a$, where $a=3$) and completing the square. It may not be the best way to solve the problem, but it's not wrong, I think. – Gerry Myerson Oct 26 '20 at 12:09
-
@Jyrki this may not apply to OP, but there are users who post questions here for whom solve $x+3=4$ would not be a duplicate of solve $x+2=3$, but rather an entirely different question, as you have to subtract $3$ from both sides to solve the one, but $2$ from both sides for the other. – Gerry Myerson Oct 26 '20 at 12:12
-
@GerryMyerson But where does the $372$ come from? $40\equiv 9$ so $(6x+2)\equiv \pm 3$ – fleablood Oct 26 '20 at 15:15
-
Guess it should be pointed out if $p$ is prime and $x^2 \equiv a^2 \pmod p$ then $x^2 -a^2\equiv (x-a)(x+a)\equiv 0 \pmod p$ and as $p$ is prime there are no zero divisors so $x^2\equiv k\not \equiv 0$ will have $2$ or zero solutions. – fleablood Oct 26 '20 at 15:19
-
@flea I take it that when OP multiplied through by $12$, that included multiplying the modulus by $12$, obtaining $372$. And it is correct that if $a\equiv b\bmod c$, then $am\equiv bm\bmod{cm}$. Again, I'm not recommending this approach, but it's not wrong, is it? – Gerry Myerson Oct 27 '20 at 03:11
4 Answers
Might be easier to factor or use the quadratic formula.
$3x^2 + 4x - 2\equiv 0\pmod {31}$ so abusing notation where $\sqrt {k}$ will mean the congruence $a$ where $a^2 \equiv k \pmod {31}$ and $\frac 1{m}=m^{-1}$ is the congruence where $m(m^{-1})\equiv 1 \pmod {31}$ then
$x \equiv \frac {-4\pm \sqrt{16 +24}}{6}\equiv$
$(-4 \pm \sqrt{40})\cdot 6^{-1}\equiv$
$(27\pm \sqrt{9})\cdot 6^{-1}\equiv $
$(27\pm 3)\cdot 6^{-1}\equiv $
$\begin{cases}30\cdot 6^{-1}\equiv 5\cdot 6\cdot 6^{-1}\equiv 5\\ 24\cdot 6^{-1}\equiv4\cdot 6\cdot 6^{-1}\equiv 4\end{cases}\pmod{31}$
So $x \equiv 4\pmod {31}$ or $x\equiv 5\pmod{31}$

- 124,253
-
-
Yes, I did that $30\cdot 6^{-1} = 5\cdot 6 \cdot 6^{-1}=5$ and $24\cdot 6^{-1} = 4\cdot 6\cdot 6^{-1}=4$. – fleablood Oct 26 '20 at 06:01
-
-
Didnt want to imply division is in general acceptable in mod arithmetic. Although it is if $31$ is prime. – fleablood Oct 26 '20 at 06:03
First multiply by $3^{-1} \equiv 21 \mod 31$ to get $x^2 + 22 x + 20 \equiv 0 \mod 31$. Then complete the square to get $(x+11)^2 \equiv 101 \equiv 8 \mod 31$. Now the square roots of $8$ mod $31$ are $15$ and $16$, so $x+11 \equiv 15$ or $16$ and $x \equiv 4$ or $5$ mod $31$.
Why, you ask, are those the square roots of $8$ mod $31$? Well, $2^5 = 32 \equiv 1$, so $8 = 2^3 \equiv 2^{-2}$, and one of the square roots of that is $2^{-1} \equiv 16$. The other is $-16 \equiv 15$.
Of course it might have been simpler to just compute $3x^2 + 4 x - 2 \mod 31$ for each $x$ from $0$ to $31$ until you find the roots.

- 448,999
Completing the square, we have: $$5x^2\equiv 2(x-1)^2$$ Since $36\equiv 31+5\equiv 5$, we have: $$36x^2\equiv2(x-1)^2$$ $$18x^2\equiv(x-1)^2$$ Adding $31$ again: $$49x^2\equiv(x-1)^2$$ Then $7x\equiv x-1$ or $-7x\equiv x-1$. Which is the same as $6x\equiv-1\equiv30$ or $8x\equiv1\equiv 32$.
Giving us the final answer of $x\equiv4,5$.

- 1,651
$$3x^2+4x-2\equiv0\operatorname{mod}31$$it's$$ 21(3x^2+4x-2)\equiv0\operatorname{mod}31$$ or$$x^2-9x+20\equiv0\operatorname{mod}31$$ or$$(x-4)(x-5)\equiv0\operatorname{mod}31,$$ which gives $$x\equiv4\operatorname{mod}31$$ or $$x\equiv5\operatorname{mod}31.$$

- 194,933
-
1No method or explanation as to how to find the factorization. No value for future readers. – Jyrki Lahtonen Oct 26 '20 at 06:41