# Derivative of $f(x)= (\sin x)^{\ln x}$

I am just wondering if i went ahead to solve this correctly?

I am trying to find the derivative of $f(x)= (\sin x)^{\ln x}$

Here is what i got below.

$$f(x)= (\sin x)^{\ln x}$$ $$f'(x)=\ln x(\sin x) \Rightarrow f'(x)=\frac{1}{x}\cdot\sin x + \ln x \cdot \cos x$$

Would that be the correct solution?

-
I think i messed up my chain rule? Did i? –  soniccool Jun 30 '12 at 0:52
Which is it? $\sin(x^{\ln x})$ or $(\sin x)^{\ln x}$? –  Mercy Jun 30 '12 at 0:54
Whoops i went ahead to fix it thanks for spotting that. –  soniccool Jun 30 '12 at 0:56
How you got from $f(x)=(\sin x)^{\ln x}$ to $f'(x)=\ln x(\sin x)$ is a mystery. Also, if you're saying that $f'(x)=\ln x(\sin x)$ and at the same time $f'(x)=\frac 1 x \cdot \sin x + \ln x\cdot\cos x$, then that would imply that $\ln x(\sin x) = \frac 1 x \cdot \sin x + \ln x\cdot\cos x$, and that doesn't make sense. –  Michael Hardy Jun 30 '12 at 3:12

It's instructive to look at this particular logarithmic-differentiation situation generally:

\begin{align} y&=u^{v}\\[0.5em] \implies \qquad \ln y &= v \ln u & \text{take logarithm of both sides}\\[0.5em] \implies \qquad \frac{y^{\prime}}{y} &= v \cdot \frac{u^{\prime}}{u}+v^{\prime}\ln u & \text{differentiate}\\ \implies \qquad y^{\prime} &= u^{v} \left( v \frac{u^{\prime}}{u} + v' \ln u \right) & \text{multiply through by y, which is u^{v}} \\ &= v \; u^{v-1} u^{\prime} + u^{v} \ln u \; v^{\prime} & \text{expand} \end{align}

Some (most?) people don't bother with the "expand" step, because right before that point the exercise is over anyway and they just want to move on. (Plus, generally, we like to see things factored.) Even so, look closely at the parts you get when you do bother:

\begin{align} v \; u^{v-1} \; u^{\prime} &\qquad \text{is the result you'd expect from the Power Rule if v were constant.} \\[0.5em] u^{v} \ln u \; v^{\prime} &\qquad \text{is the result you'd expect from the Exponential Rule if u were constant.} \end{align}

So, there's actually a new Rule here: the Function-to-a-Function Rule is the "sum" of the Power Rule and Exponential Rule!

Knowing FtaF means you can skip the logarithmic differentiation steps. For example, your example:

\begin{align} \left( \left(\sin x\right)^{\ln x} \right)^{\prime} &= \underbrace{\ln x \; \left( \sin x \right)^{\ln x - 1} \cos x}_{\text{Power Rule}} + \underbrace{\left(\sin x\right)^{\ln x} \; \ln \sin x \; \frac{1}{x}}_{\text{Exponential Rule}} \end{align} As I say, we generally like things factored, so you might want to manipulate the answer thusly, $$\left( \left(\sin x\right)^{\ln x} \right)^{\prime} = \left( \sin x \right)^{\ln x} \left( \frac{\ln x \cos x}{\sin x} + \frac{\ln \sin x}{x} \right) = \left( \sin x \right)^{\ln x} \left( \ln x \cot x + \frac{\ln \sin x}{x} \right)$$

Another example: \begin{align} \left( \left(\tan x\right)^{\exp x} \right)^{\prime} &= \underbrace{ \exp x \; \left( \tan x \right)^{\exp x-1} \; \sec^2 x}_{\text{Power Rule}} + \underbrace{ \left(\tan x\right)^{\exp x} \ln \tan x \; \exp x}_{\text{Exponential Rule}} \\ &= \exp x \; \left( \tan x \right)^{\exp x} \left( \frac{\sec^2 x}{\tan x} + \ln \tan x \right) \\ &= \exp x \; \left( \tan x \right)^{\exp x} \left( \sec x \; \csc x + \ln \tan x \right) \end{align}

Note. Be careful invoking FtaF in a class --especially on a test-- where the instructor expects (demands) that you go through the log-diff steps every time. (Of course, learning and practicing those steps is worthwhile, because they apply to situations beyond FtaF.) On the other hand, if you explain FtaF to the class, you could be a hero for saving everyone a lot of effort with function-to-a-function derivatives.

-

Five different answers, and all of them using exponentials and logarithms? While logs are indeed convenient, it's certainly possible to solve this problem without what one might consider a detour into logarithm-land.

We know that $(x^n)'=nx^{n-1}$ and $(a^x)'=a^x\log a$, which means that $$(y^z)'=zy^{z-1}y'$$ when $z$ is constant, and $$(y^z)'=y^{z}\log y\cdot z'$$ when $y$ is constant. Therefore, when both $y$ and $z$ vary, we have $$(y^z)'=zy^{z-1}y'+y^{z}\log y\cdot z'.$$ Substitute $y = \sin x$ and $z = \log x$, and you're done.

-
+1. Your answer appeared while I was composing mine. :) –  Blue Jun 30 '12 at 5:27
Of course, the rule "When both [values] vary, [just add]." requires justification that most students don't encounter until multi-variate calculus. It's worth pointing out, though, that students have actually seen this phenomenon in the Product Rule: in $(fg)^{\prime} = f^{\prime} g + f g^{\prime}$, the first term is what you'd expect from $(fg)^{\prime}$ if $g$ were constant, and the second is what you'd expect if $f$ were constant; likewise, the Quotient Rule: $(f/g)^{\prime} = f^{\prime}/g + (-1) f g^{-2}$. –  Blue Jun 30 '12 at 5:39
@DayLateDon: That's a great point. I've been using $f(g(x),h(x),\ldots)' = \frac{df}{dg}\cdot g'(x)+\frac{df}{dh}\cdot h'(x)+\cdots$ for so long that it seems obvious, but at this level it does need justification, so +1 to your answer that spells it out. To be honest, this identity is actually how I remember the product rule and quotient rules myself. –  Rahul Jun 30 '12 at 6:13
Whoops, I left a $g^{\prime}$ off of the Quotient Rule in my earlier comment. –  Blue Jun 30 '12 at 6:18
And then there's the "Extended Product Rule" ---$(f g h \cdots z)^{\prime} = (f^{\prime}gh\cdots z) + (f g^{\prime} h\cdots z) + (f g h^{\prime}\cdots z) + \cdots + (fgh\cdots z^{\prime})$--- where each term comes from treating every factor except one as a constant. This Rule could use some more exposure, as well. –  Blue Jun 30 '12 at 6:26

Since $$f(x)=\exp[\ln(x)\ln(\sin x)],$$it follows that $$f'(x)=[\ln(x)\ln(\sin x)]'f(x)=\left(\frac{\ln(\sin x)}{x}+\cot(x)\ln x\right)(\sin x)^{\ln x}.$$

-

When evaluating these type of derivatives, the best strategy, in my opinion, is to consider it as an exponential function:

$$f(x)= \sin x^{\log x}$$

$$f(x)=\exp \left[\log (\sin x^{\log x})\right ]$$ $$f(x)=\exp \left[\log x \cdot \log(\sin x)\right]$$

Then we use the chain rule

$$f'(x)=\exp \left[\log x \log(\sin x)\right] \cdot\left(\log x \cdot\log(\sin x)\right)'$$

And that derivative is found by a simple use of the product rule and another chain rule.

-
Which integral are you solving? ;) –  Joe Jun 30 '12 at 1:24
@JoeL. LOL, fixed- –  Pedro Tamaroff Jun 30 '12 at 1:27

\begin{align} f(x) & = (\sin x)^{\ln x} \\[10pt] \ln f(x) & = \ln \Big((\sin x)^{\ln x} \Big) \\[10pt] \ln f(x) & = (\ln x) \Big(\ln\sin x\Big) \\[10pt] \frac{1}{f(x)}\cdot f'(x) & = \text{an expression the comes from the product rule and the chain rule.} \\[10pt] f'(x) & = f(x)\cdot\Big(\text{an expression the comes from the product rule and the chain rule}\Big). \end{align}

-

We will need restrictions on $x$, since we cannot allow $\sin x$ to be negative.

From $y=(\sin x)^{\ln x}$, my inclination is to take the logarithm, getting $$\ln y=\ln(x) \ln(\sin x).$$ and then differentiate implicitly.

In effect, this is the same as the other suggestions. But with a more complicated product of functions, the technique, called logarithmic differentiation, can be quite useful.

-

Our original is:

$$y = (\sin x)^{\ln x} \tag{1}$$

Using logarithmic differentiation, which is helpful for complicated, messy functions such as this, we get:

$$\ln y = \ln (\sin x)^{\ln x}$$

Recall that $\ln a^b = b\ln a$, so we have:

$$\ln y = \ln x \cdot \ln (\sin x)$$

Taking the derivative of both sides gets us:

$$\frac{1}{y} \cdot y' = \ln x \cdot \frac{1}{\sin x} \cdot \cos (x) + \ln(\sin x) \cdot \frac{1}{x} \ \ \ \ \ \text{Product Rule}$$

Cleaning up a bit, we have:

$$\frac{y'}{y} = \ln x \cdot \cot (x) + \frac{\ln{(\sin x)}}{x}$$

Now multiply through by $y$ which is our original, equation $(1)$, and you get:

$$y' = (\sin x)^{\ln x} \left( \ln x \cdot \cot (x) + \frac{\ln{(\sin x)}}{x} \right)$$

-
Just fixed it I believe, thanks for the catch. Was only multiplying the first two terms rather than the whole RHS by the $(\sin x)^{\ln x}$ term. Feel free to edit if that was not what you were talking about. –  Joe Jun 30 '12 at 4:44