Guest User

Untitled

a guest
Jan 17th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. p1 = Plot[2/(1 + 20 x^2), {x, 0, 3}, AxesLabel -> {"x", "y"},
  2. LabelStyle -> (FontSize -> 16), GridLines -> Automatic,
  3. PlotRange -> {0, 3}]
  4.  
  5. p2 = Plot[1/(1 + 20 x^2)^(1/2), {x, 0, 3}, AxesLabel -> {"x", "y"},
  6. LabelStyle -> (FontSize -> 16), GridLines -> Automatic,
  7. PlotRange -> {0, 3}]
  8.  
  9. Show[p1, p2]
  10.  
  11. GraphIntersection[p1, p2]
  12.  
  13. f1 = 2/(1 + 20 x^2);
  14. f2 = 1/(1 + 20 x^2)^(1/2);
  15.  
  16. xp = FindInstance[f1 == f2 && 0 < x < 3, x, Reals, 15] // Values // Flatten
  17.  
  18. yp = f1 /. x -> xp
  19.  
  20. Plot[{f1, f2}, {x, 0, 3},
  21. AxesLabel -> {"x", "y"},
  22. Epilog -> {Red, PointSize[0.02], Point[{First@xp, First@yp}]},
  23. LabelStyle -> (FontSize -> 16),
  24. GridLines -> Automatic,
  25. PlotRange -> {0, 3},
  26. PlotTheme -> "Detailed"]
  27.  
  28. ClearAll[f, g];
  29. f = 2/(1 + 20 x^2);
  30. g = 1/(1 + 20 x^2)^(1/2);
  31. Plot[{f, g}, {x, 0, 3},
  32. MeshFunctions -> {(f - g) /. x -> # &}, Mesh -> {{0}},
  33. MeshStyle -> Directive[Red, PointSize[Large]],
  34. AxesLabel -> {"x", "y"}, LabelStyle -> (FontSize -> 16),
  35. GridLines -> Automatic, PlotRange -> {0, 3}]
  36.  
  37. ClearAll[f2, g2, x];
  38. f2 = 3/(3 + 20 (Sin@x - 1/2)^2);
  39. g2 = 1/(1 + 5 (Sin[x] - 3/10)^2)^(1/2);
  40. Plot[{f2, g2}, {x, 0, 3}, MeshFunctions -> {(f2 - g2) /. x -> # &},
  41. Mesh -> {{0}}, MeshStyle -> Directive[Red, PointSize[Large]],
  42. AxesLabel -> {"x", "y"}, LabelStyle -> (FontSize -> 16),
  43. GridLines -> Automatic, PlotRange -> {0, 3/2}]
  44.  
  45. mesh = Last @@@ N[Solve[{f2 == g2, 0 <= x <= 3}, x, Reals] ]
  46. (* {2.7032,0.438392,2.29184,0.849753} *)
  47.  
  48. Plot[{f2, g2}, {x, 0, 3}, Mesh -> {mesh},
  49. MeshStyle -> Directive[Red, PointSize[Large]],
  50. AxesLabel -> {"x", "y"}, LabelStyle -> (FontSize -> 16),
  51. GridLines -> Automatic, PlotRange -> {0, 3/2}]
  52. (* same picture *)
Add Comment
Please, Sign In to add comment