1
$\begingroup$

How can I plot $y^x$? To keep things simple and to not have another $z$ variable on the other end of the equation, let's assume $y^x=10$. As long as that value is not $0$, the curve we get should look about the same.

The problem arises when $x$ is negative. The thing is, when $x$ is an odd, then y can only be a positive number. However, when $x$ is even, y can be either positive or negative. Therefore, if you look at the $x$ negative side of the graph, you would be able to mark a point whenever $x$ is even, but there would be no point when it is odd. So how could you graph such a thing? I simply have no idea what happens between two negative odd numbers (e.g. how does the curve behave between $-1$ and $-3$?)

As always, I tried WolframAlpha, and even it has trouble graphing the thing! Here is what it ends up with.

$\endgroup$
  • 1
    $\begingroup$ Do you want to plot the real and imaginary parts then? $\endgroup$ – dustin Nov 16 '14 at 3:30
  • $\begingroup$ Well, I was thinking only about the real parts... Is there an imaginary part? When x is a negative even number, you would get a negative positive root. So, for example, when x = -2, then y = -√10. $\endgroup$ – Rodrigo Nov 16 '14 at 3:38
  • $\begingroup$ Does it matter if I plot it in Matlab or must it be in Mathematica? $\endgroup$ – dustin Nov 16 '14 at 3:39
  • $\begingroup$ I don't know... I used Wolfram, and it goes crazy trying to solve it. $\endgroup$ – Rodrigo Nov 16 '14 at 3:42
  • $\begingroup$ Do you want 2d plot? $\endgroup$ – dustin Nov 16 '14 at 3:49
2
$\begingroup$

In Matlab:

>> x=linspace(-10,10,5000);
>> y=linspace(-10,10,5000);
>> t=y.^x-10;
>> plot(x,real(t))
>> plot(x,imag(t))

Real:

enter image description here

Imaginary:

enter image description here


Mathematica 3D plots:

Plot3D[Re[y^x - 10], {x, -10, 10}, {y, -10, 10}]
Plot3D[Im[y^x - 10], {x, -10, 10}, {y, -10, 10}]

Real:

enter image description here

Imaginary:

enter image description here

2D Contour plots:

ContourPlot[Re[y^x - 10], {x, -10, 10}, {y, -10, 10}]
ContourPlot[Im[y^x - 10], {x, -10, 10}, {y, -10, 10}]

Real:

enter image description here

Imaginary:

enter image description here

$\endgroup$
  • $\begingroup$ Wow! I can barely make any sense out of all this, I have to study many more years to get there... I can't understand, however, how, in the real 2D graph, y is increasing as x get's bigger. Shouldn't y equals the x-eth roots of 10? $\endgroup$ – Rodrigo Nov 16 '14 at 4:08
  • $\begingroup$ @Rodrigo What you see as the y axis is really the z axis. You are looking at x vs z. $\endgroup$ – dustin Nov 16 '14 at 4:12
1
$\begingroup$

$y^x = 10$ is equivalent to $e^{x\ln y}=10$, i.e. $\ln y=\frac{\ln 10}{x}$, or (again) $y=e^{\frac{\ln 10}{x}}$ (in particular, from the very beginning observe that we must have $y > 0$ for the expression to be defined without ambiguity). The latter form can be easily plotted, e.g. via Mathematica.

$\endgroup$
  • $\begingroup$ Doesn't that just equal $\sqrt[x]{10}$? That can be obtained directly from the first equation, actually, by taking $x$-eth roots. $\endgroup$ – Akiva Weinberger Nov 16 '14 at 3:54
  • $\begingroup$ Indeed -- the main point of going to the definition of $y^x$ (which for $x$ real goes through the logarithm) is to highlight what the condition on $y$ is. $\endgroup$ – Clement C. Nov 16 '14 at 3:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.