1
$\begingroup$

Here is the code. A part of the diagram is not a function.

sols3[x_, a_] = y /. Solve[x^2 + (y - a)^2 == 1, y];
sols2[x_, a_] = y /. Solve[y == a x^2, y];

Manipulate[{Plot[{sols3[x, a], sols2[x, a],
  PlotRange -> 20 {{-1, 1}, {-1, 1}}, PlotStyle -> Green, AspectRatio -> Automatic], 
  Solve[{x^2 + (y - a)^2 == 9 && y == a x^2}, {x, y}]}, {{a, 3}, -3,3, 0.1}]

how can I get that done?

$\endgroup$
  • 1
    $\begingroup$ What is sols1? $\endgroup$ – Rohit Namjoshi Jun 17 '19 at 1:59
  • $\begingroup$ Sorry for that. I delete it now. $\endgroup$ – kile Jun 17 '19 at 11:25
3
$\begingroup$
ClearAll[sols2, sols3, intersections]
sols3[x_, a_] := y /. Solve[x^2 + (y - a)^2 == 9, y];
sols2[x_, a_] := y /. Solve[y == a x^2, y];
intersections[a_] := {x, y} /.Solve[{x^2 + (y - a)^2 == 9 && y == a x^2}, {x, y}, Reals]

Manipulate[Column@
  {Plot[Evaluate@Flatten[{sols3[x, a], sols2[x, a]}], {x, -20, 20}, 
     PlotRange -> 20 {{-1, 1}, {-1, 1}}, BaseStyle -> Thick, 
     Epilog -> {Red, PointSize[Large], Point[intersections[a]]}, 
     AspectRatio -> Automatic, ImageSize -> 300], 
   Column @ intersections[a]},
  {{a, 3}, -3, 3, 1/10}]

enter image description here

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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