1. ## Beginner to mathematica

Hello,
I need to graph this circle in parabola(below) with mathematica?How can i do? Thanks.(parabola is y=x^2)

Hello,
I need to graph this circle in parabola(below) with mathematica?How can i do? Thanks.(parabola is y=x^2)
This post is a subset of the later post found here: http://www.mathhelpforum.com/math-he...-parabola.html

3. Originally Posted by mr fantastic
This post is a subset of the later post found here: http://www.mathhelpforum.com/math-he...-parabola.html

You are right but i don't know how to graph on wolfram mathematica.Bevause of this i wrote on computer software?I need commands to graph this circle in parabola on mathematica.

4. There are several ways. Here's one using ContourPlot and the formula given in the citation abovel:

Code:
ContourPlot[{y == x^2, x^2 + (y - 1/2)^2 ==
1/4}, {x, -3, 3}, {y, -3, 3},
Axes -> True]
Here's another way using Plot:

Code:
f1[x_] := 1/2 + Sqrt[1/4 - x^2];
f2[x_] := 1/2 - Sqrt[1/4 - x^2];
f3[x_] := x^2;
p1 = Plot[{f1[x], f2[x]}, {x, -2^(-1), 1/2},
PlotRange -> {{-3, 3}, {-3, 3}},
AspectRatio -> 1]
p2 = Plot[f3[x], {x, -2, 2}];
Show[{p1, p2}]

5. Thank you very much shawsend.

6. Third and fourth way just for fun:

Code:
p1 = ParametricPlot[{t, t^2}, {t, -2, 2}]
p2 = ParametricPlot[{(1/2)*Cos[t],
1/2 + (1/2)*Sin[t]}, {t, 0, 2*Pi}]
Show[{p1, p2}]

Show[{Plot[x^2, {x, -2, 2}],
Graphics[Circle[{0, 1/2}, 1/2]]},
AspectRatio -> 1]

7. shawsend,
Thank you very much again but the third way gives an error during calculating.

8. Hi. I don't get an error. Maybe it's the version. I have ver 6. Also, sometimes an error occurs when variables have already been assigned numeric quantities. Either clear these variable names via Clear[x,y,z] or just restart Mathematica to see if the error is eliminated.

9. Yeah, I remember show was super-funky in Mathematica 5 and earlier. Its so much better now, although the order of arguments makes a big difference in the results.

The best way to do this kind of thing is always with contour plot.
By the way, only in the last method do you need to use show. Show is still best avoided if possible, as it doesnt work perfectly (though undeniably much, much better than it used to)

The circle may be undefined outside of [-1/2,1/2], but plot throws no error:
Plot[{1/2 + Sqrt[1/4 - x^2],1/2-Sqrt[1/4 - x^2],x^2},{x,-3,3}]

Replacing t with Pi t maps [-2,2] into [-2 Pi, 2 Pi], which is redundant but works:
ParametricPlot[{{t, t^2}, {1/2 Cos[Pi t],1/2+1/2Sin[Pi t]}}, {t, -2, 2}]

I always prefer not to leave so many variables behind in an operation, unless some of the steps take so much time that it is necessary.