# Find derivative of $f(x)=(x+2)^{(x-1)}$

Find derivative of $f(x)=(x+2)^{(x-1)}$

What I did: $$f(x)=(x+2)^{(x-1)}= e^{{\ln(x+2)}^{(x-1)}}= e^{{(x-1)\ln(x+2)}}$$ $$f'(x)= e^{{(x-1)\ln(x+2)}}((x-1)\ln(x+2))'$$ $$f'(x)= e^{{\ln(x+2)}^{(x-1)}}(1\cdot \ln(x+2)+(x-1)\cdot (\frac {1}{x+2}))$$ ~so the solution is: $$f'(x)= (x+2)^{(x-1)}( \ln(x+2)+\frac {x-1}{x+2})$$

Is this correct? (I got the right solution, but I've seen people solve this with $f′(x)=f(x)\frac {d}{dx}(\ln(f(x))$ (?!), and I've never used or seen this formula)

-
I just want to know if this is correct, so my next 25 calculations won't be solved wrong. –  L_McClain Dec 16 '13 at 20:06
Never seen people do what exactly? Everything looks good though. –  Mike Dec 16 '13 at 20:07
Well, except for some "'"s that shouldn't be there anyway... –  Mike Dec 16 '13 at 20:09
Others might be taking the natural logarithm of both sides and then using implicit differentiation (chain rule, really). As in: $f'(x) / f(x) = D_x ((x-1)\ln(x+2))$. –  Eric Thoma Dec 16 '13 at 20:12
In that line, the second should be there, but not the first. You've already taken the derivative of that part. –  Mike Dec 16 '13 at 20:16

Correct except for the second line,you must write $f'(x)=e^{(x-1)ln(x+2)}\cdot ((x-1)ln(x+2))'$ and not $f'(x)= (e^{{(x-1)ln(x+2)}})'((x-1)ln(x+2))'$

-

Ok, but it is a bit simpler by taking logs first

$\quad \begin{eqnarray} \log(f) \,&=&\ (x-1)\ \log(x+2)\\ \\ \Rightarrow\ \ \ \ \dfrac{f'}f\, &=&\, \dfrac{x-1}{x+2} + \log(x+2)\end{eqnarray}$

Now multiply through by $\,f\,$ to obtain $\,f'.$

Remark $\$ This handy method is known as logarithmic differentiation. Similarly

$$\rm (abc\: \cdots\: f)'\: =\ \: abc\:\cdots f\:\ \bigg(\frac{a'}{a} + \frac{b'}{b} + \frac{c'}{c} +\:\cdots\:+ \frac{f\:'}{f}\bigg)$$

-
What are $a$, $b$ and $c$ here? –  ziyuang Dec 16 '13 at 20:38
@ziyuang Anything (differentiable) and $\ne 0$ –  Bill Dubuque Dec 16 '13 at 20:53
Sounds like the same as $f$ except for the positiveness. –  ziyuang Dec 16 '13 at 20:55
OK, I get it. It has nothing to do with the logarithm. –  ziyuang Dec 16 '13 at 20:57
@ziyuang Positivity is not needed. The formula has a simple inductive proof using only the product rule for derivatives, e.g. see my answer here. Using logs is simply a nice way to motivate the discovery of the formula, but not essential. –  Bill Dubuque Dec 16 '13 at 21:00

Assuming $x > -2$.
Take the log on both sides: $$ln(f(x)) = (x-1)\,ln(x-2)$$ Differentiate, by the chain rule we get

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

Thus we get, $$f'(x) = (x+2)^{(x-1)}(\frac{x-1}{x-2} + ln(x + 2))$$

-