# Derivative of compositum function with log

I have the following two functions that I'm not compleately sure I'm solving correctly mainly what bugs me is $\log(x)$.

1st Function:
$$f(x) = \sin(2x^2 - 3\log(x))$$

I simply treated this as composed function and used the rule for said function to solve for it this way:
$$f'(x) = \cos(2x^3 - 3\log(x)) \cdot 4x - \frac{1}{3\ln(x)}$$ Would this be correctly calculated derivative of said function ?

2nd Function:
$$f(x) = x\log(x^5) \cdot \cos(2x - e^x)^2$$

I am not fully sure how to solve this as a compositum first and then as two seperate functions so i did it this way:
$$f'(x) = \left(\frac{1}{x\ln(x^5)} \right) \cdot \cos(2x - e^x)^2 + x\log(x^5) \cdot (-2\sin(2x -e^x))$$

-
The derivative of $\log_e(x)$ is $\dfrac{1}{x}$. The derivative of $-3\log_e(x)$ is $-\dfrac{3}{x}$. You have several other basic errors –  Henry Dec 23 '12 at 16:12
Please don't completely rewrite your question –  Hurkyl Dec 26 '12 at 1:32

You have a typo, and you’re missing some required parentheses, but I think that you probably did the first differentiation correctly: if $f(x)=\sin(2x^2-3\ln x)$, then $$f\,'(x)=\cos(2x^2-3\ln x)\left(4x-\frac3x\right)=\left(4x-\frac3x\right)\cos(2x^2-3\ln x)\;.$$

(I prefer to put the $\cos$ factor second in order to avoid any possible ambiguity.)

You took the right approach to the second problem, using the product rule first, but some of the details are wrong. You have $f(x) = x\ln x^5\cos(2x - e^x)^2$, where you’ve interpreted the last factor as $\cos^2(2x-e^x)$. I would interpret it as $\cos\left((2x-e^x)^2\right)$, which changes the derivative considerably. On your interpretation the derivative is

\begin{align*} f\,'(x)&=\left(x\ln x^5\right)'\cos^2(2x-e^x)+x\ln x^5\left(\cos^2(2x-e^x)\right)'\\ &=\left(5x\ln x\right)'\cos^2(2x-e^x)+5x\ln x\left(\cos^2(2x-e^x)\right)'\\ &=5(1+\ln x)\cos^2(2x-e^x)-10x\ln x\sin(2x-e^x)\cdot(2-e^x)\\ &=5(1+\ln x)\cos^2(2x-e^x)-10x(2-e^x)\ln x\sin(2x-e^x)\;. \end{align*}

On my interpretation the derivative is

\begin{align*} f\,'(x)&=\left(5x\ln x\right)'\cos(2x-e^x)^2+5x\ln x\left(\cos(2x-e^x)^2\right)'\\ &=5(1+\ln x)\cos(2x-e^x)^2-\left(5x\ln x\sin(2x-e^x)^2\right)\big(2(2x-e^x)(2-e^x)\big)\\ &=5(1+\ln x)\cos(2x-e^x)^2-10x(2x-e^x)(2-e^x)\ln x\sin(2x-e^x)^2\;. \end{align*}

-
In first function its $-3log(x)$ not $-3lnx$ i used the rule $xloga(x) -> \frac{1}{xlna}$ –  Sterling Duchess Dec 23 '12 at 16:23
For many authors $\log x$ is $\ln x$; what is your definition? –  Brian M. Scott Dec 23 '12 at 16:25
Hm i added the picture from my PDF thats how the example is written. –  Sterling Duchess Dec 23 '12 at 16:27
@kellax: With nothing else to go on I’d assume that $\log(x)=\ln x$. I’d also interpret $\cos(2x-e^x)^2$ as having the square inside the cosine, not as $\cos^2(2x-e^x)$. –  Brian M. Scott Dec 23 '12 at 16:30
Irritatingly, at least in the US in most high school math classes $\log$ is most commonly taken to be base 10. –  user7530 Dec 26 '12 at 15:35

For the first question:

We want the derivative of $\sin(g(x))$. By the Chain Rule this is $g'(x)\cos(g(x))$.

Apart from a typo, you have the $\cos(g(x))$ part right. The $g'(x)$ should be $\left(4x-\dfrac{3}{x}\right)$.

For the second question: It is not clear what the function is. Are we dealing with $\left[\cos(2x-e^x)\right]^2$ or $\cos((2x-e^x)^2)$?

The Product Rule part is handled fine. But at a certain stage you need the derivative of $x\ln(x^5)$. Probably the simplest way to handle that is to use $\log(x^5)=5\log x$. So we want the derivative of $5x\log x$. Use the Product Rule. Or else we can work directly with the expression as is, and use Product Rule and Chain Rule.

For the other half, you need to use the Chain Rule. Details depend on interpretation of the question. The first step is to get the parentheses right.

-

Let $f(x)=\log x$. Then $$f'(x)=\lim_{h \to 0}\frac{\log(x+h)+\log x}{h}=\lim_{h \to 0}\frac{1}{h}.\log \frac{x+h}{x}=\lim_{h \to 0}\frac{1}{x}.\frac{x}{h}.\log (1+\frac{h}{x})=\frac{1}{x}\lim_{z \to 0}\frac{1}{z}.\log (1+z)=\frac{1}{x}$$where $z=\frac{h}{x}$

-

As you seem to be using $\log(x)$ and $\ln{(x)}$ to mean something different, I assume $\log(x)=\log_{a}(x)$, where $a\not=\rm{e}$?

Therefore we first need to find: $$\frac{d}{dx}(\log_{a}(x))=\frac{d}{dx}(\frac{1}{\ln{a}}\ln{x})=\frac{1}{\ln{a}}\frac{d}{dx}(\ln{x})=\frac{1}{x\ln{a}}$$

Therefore, in order to differentiate your first function, $f_{1}(x)\equiv\sin(2x^{2}-3\log_{a}(x))$, we use the chain rule:

$$\frac{df_{1}}{dx}=\frac{d}{dx}(2x^{2}-3\log_{a}(x))\cdot\cos(2x^{2}-3\log_{a}(x))=(4x-\frac{3}{x\ln{a}})\cdot\cos(2x^{2}-3\log_{a}(x))$$

And the second function, $f_{2}(x)\equiv x\log_{a}(x^{5})\cdot\cos^{2}(2x-\mathrm{e}^{x})$ using the product rule and chain rule:

$$\frac{df_{2}}{dx}=\log_{a}(x^{5})\cdot\cos^{2}(2x-\mathrm{e}^{x})+x\cdot\frac{d}{dx}(\log_{a}(x^{5}))\cdot\cos^{2}(2x-\mathrm{e}^{x})+x\log_{a}(x^{5})\cdot\frac{d}{dx}(\cos^{2}(2x-\mathrm{e}^{x})\\=\log_{a}(x^{5})\cos^{2}(2x-\mathrm{e}^{x})+\frac{4x^{4}}{\ln{a}}\cos^{2}(2x-\mathrm{e}^{x})+-2x\log_{a}(x^{5})(\mathrm{e}^{x}-2)\cos(2x-\mathrm{e}^{x})\sin(2x-\mathrm{e}^{x})$$

-