Deriving logarithm in exponent

57 Views Asked by At

Im attempting to take the derivative of $n^{log_2(n)}$, but the answer I'm getting is different from http://www.derivative-calculator.net/.. this isnt highschool math homework, I'm trying to use L'hospitals algorithm on a series of equations to determine their ordering(in terms of lowest to highest limit) for an algorithms analysis class. I haven't touched calculus in a few years now and I cant word this question properly to get a helpful google search.

The first step I do is convert $log_2(n)$ to $\frac{ln(n)}{ln(2)}$, and perform u-substitution.

$u = \frac{ln(n)}{ln(2)} $ and $du = \frac{1}{n*ln(2)}$

this leaves with me with

$\frac{d}{du}(n^u)$

= $ u*n^{u-1}*du $

substituting the original values back in

= $\frac{ln(n)}{ln(2)} * n^{\frac{ln(n)}{ln(2)} - 1} * \frac{1}{n*ln(2)}$

= $\frac{n^{\frac{ln(n)}{ln(2)}-1}*ln(n)}{n * ln(2)^2}$

The online calculator claims the solution is:

= $\frac{2n^{\frac{ln(n)}{ln(2)}-1}* ln(n)}{ln(2)} $

What is it that I'm doing wrong? my algorithms homework is loaded with questions like this. -Thanks in advance

1

There are 1 best solutions below

0
On BEST ANSWER

Consider $f(x)=x^{\log_2x}$ and compute $$ \log f(x)=\log(x^{\log_2x})=\log_2x\log x=\frac{(\log x)^2}{\log 2} $$ (non subscripted “log” means base $e$).

Then, differentiating both sides, we get $$ \frac{f'(x)}{f(x)}=\frac{2\log x}{x\log 2}=\frac{2}{x}\log_2x $$

The error you make is in doing $\frac{d}{du}n^u=un^{u-1}$, which is incorrect as $u$ depends on $n$.