Plotting equation in mathematica? Any Ideas?

In summary, the conversation is about graphing the function (x+(1/√(1+cos(x)²))) in Mathematica. The speaker encountered some errors but made progress by using the Plot function with a defined plot range. However, there is still an error related to the argument of Cos.
  • #1
abe_cooldude
15
0
Hi, I am trying to graph

(x+(1/√(1+cos(x)²)))

in mathematica, and i used

Plot[x + (1/(sqrt (1 + cos (x)^2))), {x, 0, 9}]

but I am not getting an output graph.

Any ideas?!

Plot[x + 1/Sqrt[1 + Cos x^2], {x, 0, 9}, PlotRange -> {-10, 10}]

I found few errors, and above is what I got, it's a progress, but now I get this error:

Plot::exclul: {Im[Cos x^2]-0} must be a list of equalities or \
real-valued functions.
 
Last edited:
Mathematics news on Phys.org
  • #2
Try pressing F1. There are a ton of examples in the help file.
 
  • #3
abe_cooldude said:
Hi, I am trying to graph

(x+(1/√(1+cos(x)²)))

in mathematica, and i used

Plot[x + (1/(sqrt (1 + cos (x)^2))), {x, 0, 9}]

but I am not getting an output graph.

Any ideas?!

Plot[x + 1/Sqrt[1 + Cos x^2], {x, 0, 9}, PlotRange -> {-10, 10}]

I found few errors, and above is what I got, it's a progress, but now I get this error:

Plot::exclul: {Im[Cos x^2]-0} must be a list of equalities or \
real-valued functions.

Functions and their arguments must be clearly delineated in Mathematica. It is not clear what the argument of Cos is in the above script. The following generates the graph:
Code:
Plot[x + 1/Sqrt[1 + Cos[x^2]], {x, 0, 9}, PlotRange -> {-10, 10}]
 

FAQ: Plotting equation in mathematica? Any Ideas?

1. How do I plot an equation in Mathematica?

To plot an equation in Mathematica, use the "Plot" function and input the equation as the first argument. You can also specify the range of values for the x-axis and any additional options, such as color or style, in the second argument.

2. Can I plot multiple equations on the same graph in Mathematica?

Yes, you can use the "Plot" function with a list of equations as the first argument. Each equation will be plotted with a different color or style, making it easy to differentiate between them.

3. How do I add labels and a title to my plot in Mathematica?

To add labels and a title to your plot, use the "PlotLabel" and "AxesLabel" options within the "Plot" function. You can also use the "PlotLegends" option to add a legend to your plot if you have multiple equations.

4. Is it possible to customize the appearance of my plot in Mathematica?

Yes, you can use various options within the "Plot" function to customize the appearance of your plot. Some options include changing the color, style, or thickness of the lines, adding gridlines, or adjusting the plot range.

5. Can I save my plot as an image file in Mathematica?

Yes, you can use the "Export" function to save your plot as an image file in various formats, such as JPEG, PNG, or PDF. Simply input the name and file type as the first argument and the plot as the second argument.

Similar threads

Replies
11
Views
1K
Replies
1
Views
1K
Replies
5
Views
1K
Replies
2
Views
544
Replies
5
Views
1K
Replies
5
Views
1K
Replies
3
Views
1K
Replies
1
Views
927
Back
Top