# Math Help - How to plot (-1)^x in Matchematica?

1. ## How to plot (-1)^x in Matchematica?

I'm having a hard time trying to plot $(-1)^x$ in Mathematica. The output appears to be empty.

Plot[(-1)^x, {x, -10, 10}, PlotRange -> 2]

Shouldn't this graph be continuous on intervals of the form [n, n+1) where n is an integer?

2. Originally Posted by Ontolog
I'm having a hard time trying to plot $(-1)^x$ in Mathematica. The output appears to be empty.

Plot[(-1)^x, {x, -10, 10}, PlotRange -> 2]

Shouldn't this graph be continuous on intervals of the form [n, n+1) where n is an integer?
No consider the interval $[0,1]$

and consider the points $x=2^{-n}=\sqrt[2n]{-1}, n \in \mathbb{N}$

This will be imaginary but

$x=3^{-n}=\sqrt[3n]{-1}, n \in \mathbb{N}$

will be real.

3. Is there any way to graph (-1)^x in a meaningful way? I originally came across it because of its usefulness when applied over the natural numbers since it alternates between 1 and -1. However I'm curious how to visualize the general graph of this function, so I suppose it would require a graph on the complex plane which I have no idea how to do.

4. Originally Posted by Ontolog
Is there any way to graph (-1)^x in a meaningful way? I originally came across it because of its usefulness when applied over the natural numbers since it alternates between 1 and -1. However I'm curious how to visualize the general graph of this function, so I suppose it would require a graph on the complex plane which I have no idea how to do.
Here is Wolfram Alpha's plot

plot &#40;-1&#41;&#94;x - Wolfram|Alpha

5. Originally Posted by Ontolog
I'm having a hard time trying to plot $(-1)^x$ in Mathematica. The output appears to be empty.

Plot[(-1)^x, {x, -10, 10}, PlotRange -> 2]

Shouldn't this graph be continuous on intervals of the form [n, n+1) where n is an integer?
Try $(-1)^{x} = e^{i\ \pi\ x}$ ... or , which of course is the same, $(-1)^{x} = \cos \pi x + i\ \sin \pi x$...

Kind regards

$\chi$ $\sigma$
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 10, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7239609956741333, "perplexity": 434.04718127156957}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-23/segments/1406510267075.55/warc/CC-MAIN-20140728011747-00222-ip-10-146-231-18.ec2.internal.warc.gz"}