# How to take this derivative?

1. Jul 1, 2012

### Hertz

I promise guys, no homework here, just curiosity.

I am trying to find dy/dx for the equation y = x^x - C, where C is any arbitrary constant. I've found two ways that SHOULD be ok to take this derivative, but they produce different answers, I was wondering which method is correct and which method is incorrect. Also, why? It seems to me that both of these methods should be ok. Anyways, here they are:

Method 1:
$y = x^x - C$
$ln(y) = ln(x^x - C)$
$ln(y) = \frac{x ln(x)}{ln(C)}$
Now take the derivative:
$\frac{\frac{dy}{dx}}{y}=\frac{1}{ln(C)}(x ln(x))'$
Using the Product Rule, it can be seen that $(x ln(x))' = ln(x) + 1$. Therefore:
$\frac{dy}{dx}=\frac{y}{ln(C)}(ln(x) + 1)$
$\frac{dy}{dx}=\frac{x^x}{ln(C)}(ln(x) + 1)$

Method 2:
$y = x^x - C$
$y' = (x^x)' - C'$
$y' = (x^x)'$
$(x^x)'$ can be evaluated using method 1 for the equation $y = x^x$
$\frac{dy}{dx} = x^x(ln(x) + 1)$

Method one seems a bit less hand wavy, so I'm more confident in it; however, the derivative shouldn't depend on C, so that makes me lean more toward Method 2.

Anybody have any input they'd be willing to share?

2. Jul 1, 2012

### Staff: Mentor

rewrite x as e^ln(x) to e^(xln(x)) and then use the rule d/dx (e^u) = e^u * u'

3. Jul 1, 2012

### Ibix

$\ln(a-b)\neq\ln a/\ln b$. If I were you I'd just try to rewrite the $x^x$ as $e^{f(x)}$.

Last edited: Jul 1, 2012
4. Jul 1, 2012

### Hertz

Rewrite which x? Both? In the original or in the derivative?

Are you saying to do this?:

$y = x^x - C$
$e^y = e^{x^x - C} = e^{x^x}/e^C$

And then differentiate?

Oh right!! I was getting the rule backwards it seems.

So would method 2 be the one that is correct then?

y = x^x can be differentiated pretty easily with implicit differentiation.

5. Jul 1, 2012

### eumyang

jedishrfu is saying that
$x = e^{\ln x}$
so
$x^x = \left(e^{\ln x}\right)^x = e^{x\ln x}$

So what you need to take the derivative of is this:
$y = e^{x\ln x} - C$
and you won't need to worry about implicit differentiation.

6. Jul 1, 2012

### Hertz

Oh I see, well let's try:

$y = e^{x\ln x} - C$
$\frac{dy}{dx} = (e^{x\ln x})'$
$\frac{dy}{dx} = e^{x\ln x}(ln(x) + 1)$
$\frac{dy}{dx} = x^x(ln(x) + 1)$

Thanks for the help guys. I think the only problem I was having was mixing up my logarithm properties :)

7. Jul 1, 2012

### HallsofIvy

The derivative of an added or subtracted constant is 0 so the derivative of
$y= x^x- C$ is exactly the same as the derivative of $y= x^x$. Now, y= x ln(x) so dy/dx= ln(x)- (x/x)= ln(x)- 1.

8. Jul 1, 2012

### haruspex

I think you meant: ln(y)= x ln(x) so (dy/dx)/y = ln(x) + (x/x)= ln(x)+ 1 (Note: +, not -).
This leads to the same answer as in the OP by Method 2.
Method 1 went wrong after the second line. ln(A-B) is not ln(A)/ln(B). Must be thinking of ln(A/B) = ln(A) - ln(B) (or, equivalently, exp(A-B) = exp(A)/exp(B)).
{"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": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "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.9191833138465881, "perplexity": 2201.735747933393}, "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-2018-51/segments/1544376826530.72/warc/CC-MAIN-20181214232243-20181215014243-00315.warc.gz"}