Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
1  
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
add comment

5 Answers

You can plot curves defined by implicit equations using ContourPlot:

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

enter image description here

share|improve this answer
    
Yes! this is exactly what I wanted, thank you –  mikefallopian Apr 1 '13 at 6:14
1  
@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
add comment

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;
ListLinePlot[data]

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
add comment

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
add comment

Not an answer, just showing a nice plot:

Show@Table[
   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 –  belisarius Apr 1 '13 at 16:41
add comment
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
add comment

Your Answer

 
discard

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.