# Why is it possible to differentiate $\dfrac{\sqrt{x+3}{\cdot}3^x\cos^3\left(x\right)}{\left(3x+2\right)^2}$ in this very simple way?

I've been tasked to differentiate the function

$$f(x) = \dfrac{\sqrt{x+3}{\cdot}3^x\cos^3\left(x\right)}{\left(3x+2\right)^2}$$

This looks like an extremely tedious task for anyone who isn't a calculator; and that's because it is extremely tedious when all you have are your normal differentiation rules (chain rule, product rule, quotient rule). I've given up attempting this due to the sheer complexity of the resulting terms.

However, there are differentiation calculators that can solve this task easily. One of the ones I found gives an especially interesting solution: $$f'(x) = -\dfrac{\sqrt{x+3}{\cdot}3^{x+1}\cos^2\left(x\right)\sin\left(x\right)}{\left(3x+2\right)^2}-\dfrac{2\sqrt{x+3}{\cdot}3^{x+1}\cos^3\left(x\right)}{\left(3x+2\right)^3}+\dfrac{\ln\left(3\right)\sqrt{x+3}{\cdot}3^x\cos^3\left(x\right)}{\left(3x+2\right)^2}+\dfrac{3^x\cos^3\left(x\right)}{2\sqrt{x+3}\left(3x+2\right)^2}$$

Upon closer inspection, you'll realize that each of the four "component functions" $$3^x$$, $$\cos^3(x)$$, $$\sqrt{x+3}$$ and $$(3x+2)^2$$ have been differentiated in one summand respectively. But is this actually possible? It certainly is counter-intuitive given only the aforementioned rules.

Is the above the correct derivative of $$f(x)$$, or is this an error of the calculator? If the former, what exact rule has been utilized here?

• This is a straightforward application of the product rule for more than one function.$$(f_1f_2\cdots f_n)'=\sum_{k=1}^nf_k'\prod_{1\le i\le n,i\ne k}f_i$$ – Peter Foreman Nov 13 '19 at 23:52

They seem to use logarithmic differentiation, which is quite efficacious in this situation. The logarithmic derivative of a function $$f$$ is the derivative of $$\ln\bigl(|f|\bigr)$$, i.e. $$\;\dfrac{f'}f$$. It behace like the logarithm w.r.t. products, quotient and exponentiation.

Thus, in this case, you have $$\frac{f'}f=\frac12\frac{1}{x+3}+\ln 3+ 3\frac{-\sin x}{\cos x} -2\frac{3}{3x+2},$$ and you'll obtain $$f'$$ multiplying this result by $$f$$ and simplifying.

• How exactly does one argue that $\ln|f| = \frac{f'}{f}$? Intuitively, $f'$ is the rate at which a function value grows, while $f$ is the actual value. $\ln|f|$ on the other hand gives the power to which to raise $e$ to receive the corresponding value of $f$. – StckXchnge-nub12 Nov 14 '19 at 0:16
• $f'/f$ is the derivative of $\ln(|f|)$, not the logarithm itself. – Bernard Nov 14 '19 at 0:25

Take log first, $$\ln f(x) = \frac12 \ln(x+3)+x\ln3 + 3\ln\cos x- 2\ln(3x+2)$$

Then, take derivatives of each term,

$$\frac{f'(x)}{f(x)}=\frac12\frac1{x+3}+\ln3-3\tan x -\frac2{3x+2}$$

Rearrange and then multiply out,

$$f'(x)=\dfrac{\sqrt{x+3}{\cdot}3^x\cos^3\left(x\right)}{\left(3x+2\right)^2}\left(\frac12\frac1{x+3}+\ln3-3\tan x -\frac2{3x+2} \right)$$