3
$\begingroup$

Let

$f(x,y)=(10 x^2 + 4 x y - 2 x + 4 y^2 - 4 y + 1)^2 (32 x^2 - 64 x y + 24 x + 40 y^2 - 28 y + 5)^2$

(10 x^2 + 4 x y - 2 x + 4 y^2 - 4 y + 1)^2 *
 (32 x^2 - 64 x y + 24 x + 40 y^2 - 28 y + 5)^2

be a multivariable function with two different real solutions $\displaystyle \left(x_{1},x_{2}\right)=(\frac{-1}{8},\frac{1}{4})$ and $\displaystyle(x_{1},x_{2})=(0,\frac{1}{2})$.

How may I obtain the same solutions by employing Mathematica?

$\endgroup$
1
  • 2
    $\begingroup$ Doesn't your polynomial have infinitely many solutions? (Assuming "solution" = root) $\endgroup$
    – Michael E2
    Feb 8 at 18:03

2 Answers 2

5
$\begingroup$

Perhaps you mean real roots?:

Reduce[(10 x^2 + 4 x y - 2 x + 4 y^2 - 4 y + 1)^2 (32 x^2 - 64 x y + 
      24 x + 40 y^2 - 28 y + 5)^2 == 0, {x, y}, Reals]

(*  (x == -(1/8) && y == 1/4) || (x == 0 && y == 1/2)  *)

or

Solve[(10 x^2 + 4 x y - 2 x + 4 y^2 - 4 y + 1)^2 (32 x^2 - 64 x y + 
      24 x + 40 y^2 - 28 y + 5)^2 == 0, {x, y}, Reals]

(*  {{x -> -(1/8), y -> 1/4}, {x -> 0, y -> 1/2}}  *)
$\endgroup$
4
  • 1
    $\begingroup$ Thanks, @Michael E2 for commenting. That is exactly what I was searching for. In order to find integer solutions, should I replace "Reals" for "Integers"? $\endgroup$ Feb 8 at 18:22
  • $\begingroup$ @ViniciusHolmes Yes, replace Reals with Integers, but sometimes, if there are finitely many real solutions, it is quicker to find all of them and filter for the integer ones. One might also specify Solve[eq && Element[{x, y}, Integers], {x, y}, Reals]. The algorithms that may be applied when you change the domain (e.g. Reals) are different, and thus it is not always straightforward what to recommend. $\endgroup$
    – Michael E2
    Feb 8 at 18:31
  • $\begingroup$ Thanks a lot @Michael E2! $\endgroup$ Feb 8 at 18:32
  • $\begingroup$ @ViniciusHolmes This works, too, on your problem: Solve[eq, {x, y}, Rationals] -- forgot to try it earlier :) $\endgroup$
    – Michael E2
    Feb 8 at 18:35
2
$\begingroup$

The roots of a polynomial of 2 variables are a 1D region. That is, you will get equations as a result. E.g.:

f[X_, Y_] = (10 x^2 + 4 x y \[Minus] 2 x + 4 y^2 \[Minus] 4 y + 
      1)^2 (32 x^2 \[Minus] 64 x y + 24 x + 40 y^2 \[Minus] 28 y + 
      5)^2;
sol=Reduce[f[x, y] == 0, {x, y}]

()

We get 4 different solutions.

If we restrict x to the region: -1..1 we may plot y[x] as complex functions with real and imaginary parts:

ReImPlot[Evaluate[{y /. #}], {x, -1, 1}] & /@ {ToRules[sol]}

enter image description here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.