2
(1 + r^2 + x)^2 - (-1 + r)^2 ((1 + x)^2 + y^2)=0

2 (2 r^3 + (1 + x)^2 + y^2 - r (-1 + x^2 + y^2))=0

I am trying to plot $x$ and $y$ which are giving by the equations above so what I did is that I solve the second equation for $c$ then substituted the value of $c$ in the first equation and then used the ContourPlot function to plot $x$ and $y$. The problem is that when solving for $c$ in the second equation we get three solutions and each one results in a different plot when substituted in the first equation. Also, there seems to be some disconnect at some areas. Why is this happening and is there a way to fix it?

Thanks.

MrDi
  • 474
  • 4
  • 10
  • 2
    Have you tried using Eliminate[] to get rid of c from the system of equations? – Michael E2 Nov 18 '16 at 02:53
  • By the way, people here generally like users to post code as Mathematica code instead of images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find this this meta Q&A helpful – Michael E2 Nov 18 '16 at 02:53
  • @MichaelE2, I have just tried Eliminate and it seems that it does work but what in the case of a more complicated equations when you need to solve for $c$? – MrDi Nov 18 '16 at 02:59
  • Do you have such an example? There are going to be uncomputable problems due to the finite limitations of the hardware and software. But have some doubt that there is a pair of polynomials for which you could solve for c but not eliminate it. That's just intuition and I could be wrong. It's also possible that computing Eliminate[] takes much more time, so that it cannot effectively be done. – Michael E2 Nov 18 '16 at 03:28
  • 1
    There's no c in your equations. I guess you meant r. – corey979 Nov 18 '16 at 10:27

2 Answers2

4
soln = {x, y} /. Solve[{
      (1 + r^2 + x)^2 - (-1 + r)^2 ((1 + x)^2 + y^2) == 0,
      2 (2 r^3 + (1 + x)^2 + y^2 - r (-1 + x^2 + y^2)) == 0},
     {x, y}, Reals] // Normal // Simplify

(*  {{-1 - 2*r + r^2, 
     -Sqrt[(-(-4 + r))*r^3]}, 
   {-1 - 2*r + r^2, 
     Sqrt[(-(-4 + r))*r^3]}}  *)

ParametricPlot[Evaluate@soln, {r, 0, 4}]

enter image description here

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198
2
eq = {(1 + r^2 + x)^2 - (-1 + r)^2 ((1 + x)^2 + y^2) == 0, 
    2 (2 r^3 + (1 + x)^2 + y^2 - r (-1 + x^2 + y^2)) == 0};

el = Eliminate[eq, r]

enter image description here

ContourPlot[Evaluate @ el, {x, -3, 7}, {y, -6, 6}]

enter image description here

corey979
  • 23,947
  • 7
  • 58
  • 101