# Plotting Inverse Functions using ParametricPlot gives error message [duplicate]

Possible Duplicate:
Plotting multivariable integration

I am trying to plot an inverse function. If I do something like this:

 g[x_] := Sin[x]

F[x_] := NIntegrate[g[y], {y, 0, x}]

ParametricPlot[{F[x], x}, {x, 0, 2 Pi}]


I get the following error message

"NIntegrate::nlim: y = x is not a valid limit of integration. >>"

However, I also get a plot which is correct. Am I doing something wrong or should I just ignore the error message?

-

## marked as duplicate by Jens, Sjoerd C. de Vries, rcollyer, R. M.♦Jan 28 '13 at 15:29

Change F[x_] to F[x_?NumericQ]. – b.gatessucks Jan 22 '13 at 19:36
I changed F[x_] to F[x_?NumericQ], but the result was the same. – Steve Jan 23 '13 at 22:39
@Steve The result was the same, because you probably still have the older definition in memory. Use ClearAll[f] before making the new definition. – Sjoerd C. de Vries Jan 28 '13 at 14:51

Just showing you what @b.gatessucks told you in his comment earlier:

g[x_] := Sin[x]
f[x_?NumericQ] := NIntegrate[g[y], {y, 0, x}]
ParametricPlot[{f[x], x}, {x, 0, 2 Pi}, AspectRatio -> 1]


1) Two warnings: Many times this "trick" doesn't work because you've already defined your function. Do a ClearAll or start a fresh Mma session.

2) Remember to start your symbols with lowercase.

-

Do you really mean you want the inverse function of Sin[x]? Then why not just ArcSin[y]? Or if you want to Solve for it:

Solve[Sin[x] == y, x]
Simplify[%, C[1] == 0]

{{x -> ConditionalExpression[\[Pi] - ArcSin[y] + 2 \[Pi] C[1],
C[1] \[Element] Integers]}, {x ->
ConditionalExpression[ArcSin[y] + 2 \[Pi] C[1],
C[1] \[Element] Integers]}}
{{x -> \[Pi] - ArcSin[y]}, {x -> ArcSin[y]}}

Plot[{ArcSin[y], \[Pi] - ArcSin[y]}, {y, -1, 1},
Frame -> True]


Of course, the inverse function is multivalued and those are just two branches.

-