Sign up ×

I'm trying to draw the graph of this function:

$$f(x) = \begin{cases} |x|^{|x|}, & \text{if $x\neq 0$} \\ 1, & \text{if $x=0$} \\ \end{cases}$$

I divided the question in two parts, if $x\lt 0$ and $x\gt0$.

If $x\gt 0$

We have the first and second derivatives:

$f'(x)=e^{x\ln x}(\ln x+1)$

$f''(x)=e^{x\ln x}(\ln x+1)^2+\frac{e^{x\ln x}}{x}$

the only information I have is these derivatives are positive everywhere and never zero, so it's increasing, what else can I say about $f$?

I need help to draw this graph.

Thanks in advance.

share|cite|improve this question
$\ln x+1=0\quad\Rightarrow x=e^{-1}$ – Dario Jul 3 '14 at 22:34
You can make this a little easier by noting that $f$ is even, so $f'(-x)=-f'(x)$ and $f''(-x)=f''(x)$. – Ian Jul 3 '14 at 22:39
Click me – TonyK Jul 3 '14 at 22:39
How about f(x)=f(-x) and plain f(1),f(2),... – user161516 Jul 3 '14 at 22:40
preview: – chharvey Jul 3 '14 at 23:27

2 Answers 2

First, this is an even function, since if $x>0$, we have $f(-x) = |-x|^{|-x|} = x^x = f(x)$. Thus we only need to concern ourselves with the graph for $x\ge 0$. As @Dario noted, $f'(x) = 0$ when $x = \frac{1}{e}$, at which point $f(x) = e^{-1/e}\approx 0.692$. For $0<x<\frac{1}{e}$, we have $f'(x) < 0$, while for $x>\frac{1}{e}$, $f'(x) > 0$. Thus $f$ decreases from $x=0$ to a minimum at $x=\frac{1}{e}$ and increases thereafter. For $x>0$, the second derivative is always positive (the first term is always nonnegative, and the second term is always positive), so the graph is concave up everywhere. A graph of $f(x)$ is enter image description here

share|cite|improve this answer

Using LaTeX and my package xpicture it is very easy to do it. This is the LaTeX code:


We define the function as $F(x)=\exp(x\log x)$, and plot it a positive interval. Then we change of reference system to (0,0)(-1,0)(0,1) and replot the same function, because $F$ is a even function. This is the result:

x^x graph

share|cite|improve this answer

Your Answer


