Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying, to no avail, to use Mathematica to produce a plot in (x, y)-space of the solutions to the equation

Cos[Sqrt[y]] + Sin[Sqrt[y]]/Sqrt[y] == Cos[x]

Neither NSolve nor InverseFunction seem to work for inverting the equation (probably because there are multiple solutions for y for each x). Does anyone know a way to make such a plot?

share|improve this question
Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – chris Apr 1 '13 at 6:41
up vote 7 down vote accepted

You can plot curves defined by implicit equations using ContourPlot:

 Cos[Sqrt[y]] + Sin[Sqrt[y]]/Sqrt[y] == Cos[x], {x, 0, 10}, {y, 0, 

enter image description here

share|improve this answer
Yes! this is exactly what I wanted, thank you – mikefallopian Apr 1 '13 at 6:14
@mikefallopian, if this is exactly what you wanted, you should accept it as the answer to your question. – RunnyKine Apr 12 '13 at 8:20

Following Jens's answer, if you want the actual values from his implicit plot,

tt=ContourPlot[Cos[Sqrt[y]] + Sin[Sqrt[y]]/Sqrt[y] == Cos[x],{x, 0, 10}, {y, 0, 10}];  
data=Cases[tt//Normal, Line[a_] :>  a, Infinity] // First;

Mathematica graphics

Note that it need not be a one to one function.

tt = ContourPlot[x^2 + y^2 == {1, 2, 3}, {x, -2, 2}, {y, -2, 2}] // Normal;
Cases[tt, Line[a_] :>  a, Infinity]//ListLinePlot[#, AspectRatio -> 1]&

Mathematica graphics

share|improve this answer

Although perhaps less generalizable than the ContourPlot solutions, the approach below will work for many similar problems. You will have to guess a reasonable initial value for y, but that should usually not be a problem.

Plot[y /. FindRoot[Cos[Sqrt[y]] + Sin[Sqrt[y]]/Sqrt[y] == Cos[x], {y, 1}], {x, 0, 10}]

Mathematica graphics

share|improve this answer

Not an answer, just showing a nice plot:

   ContourPlot[ Cos[Sqrt[y]] + Sin[Sqrt[y]]/Sqrt[y] == n Cos[x], {x, 0, 10}, {y, 0, 400}],
  {n, 1/4, 5, 1/4}]

Mathematica graphics

share|improve this answer
just because you felt like it? or is it an April fool in disguise? – chris Apr 1 '13 at 16:36
@chris Just because I liked the plot, and wanted to share it – Dr. belisarius Apr 1 '13 at 16:41
ParametricPlot[{ArcCos[Cos[Sqrt[y]] + Sin[Sqrt[y]]/Sqrt[y]], y}, {y, 1, 2}, 
  AxesLabel -> {"x", "y"}, 
  AxesOrigin -> {0, 1.6}]

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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