Plotting and Finding Values in Mathematica: A Simple Question

  • Mathematica
  • Thread starter member 428835
  • Start date
  • Tags
    Mathematica
In summary, Mathematica offers powerful tools for plotting and finding values in mathematical expressions. By utilizing built-in functions and commands, users can easily visualize and analyze data, equations, and functions. With options for customization and advanced features such as interpolation and curve fitting, Mathematica is a versatile tool for both beginners and experts in mathematics. Additionally, the program allows for easy manipulation and extraction of specific values from plots, making it a valuable resource for data analysis and problem-solving.
  • #1
member 428835
Hi PF!

If I'm trying to plot something in mathematica, say ##y=x^2## and then I want to find out what ##y## is when ##x=3##, how would I do this?

Thanks so much!

I should add, the function I'm inputting in is a numerical solution to a non-linear ODE, so it's not as easy as simply inputting ##3^2## in the above example.
 
Physics news on Phys.org
  • #2
nevermind, I'm good!
 
  • #3
Share your solutions for future reference!
 
  • #4
Sorry, I actually needed to do something different, but I solved that.
 

1) How do I plot a function in Mathematica?

To plot a function in Mathematica, use the Plot function and specify the function you want to plot as the first argument. For example, to plot the function y = x^2, you would use the command Plot[x^2, {x, -5, 5}]. This will plot the function over the range of x values from -5 to 5. You can also add options to customize the appearance of the plot, such as changing the color or adding a title.

2) How do I find the maximum or minimum value of a function in Mathematica?

To find the maximum or minimum value of a function in Mathematica, use the Maximize or Minimize functions, respectively. These functions take the function you want to optimize and the range of values for the variables as arguments. For example, to find the maximum value of the function y = x^2 over the range of x values from -5 to 5, you would use the command Maximize[{x^2, -5 <= x <= 5}, x]. This will return the maximum value of 25 and the corresponding value of x, which is 5.

3) Can I plot multiple functions on the same graph in Mathematica?

Yes, you can plot multiple functions on the same graph in Mathematica by using the Plot function with a list of functions as the first argument. For example, to plot the functions y = x^2 and y = x^3 on the same graph, you would use the command Plot[{x^2, x^3}, {x, -5, 5}]. This will plot both functions over the range of x values from -5 to 5 on the same graph with different colors or line styles to differentiate them.

4) How do I find the intersection points of two functions in Mathematica?

To find the intersection points of two functions in Mathematica, you can use the Solve or NSolve functions. These functions take two equations as arguments and solve for the values of the variables that satisfy both equations. For example, to find the intersection points of the functions y = x^2 and y = 2x, you would use the command Solve[x^2 == 2x, x]. This will return the two intersection points of (0, 0) and (2, 4).

5) Is it possible to add labels and legends to a plot in Mathematica?

Yes, you can add labels and legends to a plot in Mathematica by using the PlotLegends and PlotLabels options in the Plot function. The PlotLegends option allows you to add a legend to your plot that labels each function, and the PlotLabels option allows you to add labels for the axes and a title for your plot. For example, you can use the command Plot[x^2, {x, -5, 5}, PlotLegends -> "Function 1", PlotLabels -> {x, "y = x^2"}] to create a plot with a legend and labeled axes.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
271
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
771
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
903
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
18
Views
4K
Back
Top