1. ## Differentiation.

Just wanted to check if I am differentiating these functions correctly.

$\displaystyle 1. f(x) = tan 2x$
$\displaystyle f'(x) = sec^2x(2x)2$
$\displaystyle f'(x) = 2sec^2x$

$\displaystyle 2. f(x) = (cosx-1)(sinx+1)$
$\displaystyle f'(x) = -sinx(sinx+1)+cosx(cosx-1)$
$\displaystyle f'(x) = -sin^2x-sinx+cos^2x-cosx$

$\displaystyle 3. f(x) = (cosx-sinx)^2$
$\displaystyle f'(x) = 2(cosx-sinx)(-sinx-cosx)$

$\displaystyle 4. f(x) = ln(cosx)+e^{cosx}$
$\displaystyle f'(x) = \frac{1}{x}cosx(-sinx)+e^{cosx}(-sinx)$

If a function can be simplified even further, can you please show me.

2. the chain rule says that the derivative of f(g(x)) is f'(g(x)) times g'(x)
HERE are my corrections

Originally Posted by dwat
Just wanted to check if I am differentiating these functions correctly.

$\displaystyle 1. f(x) = tan (2x)$
$\displaystyle f'(x) = sec^2(2x)\cdot 2$
$\displaystyle f'(x) = 2sec^2(2x)$
The (2x) cannot change

I'd multiply this first
$\displaystyle 2. f(x) = (\cos x-1)(\sin x+1)=\sin x \cos x+\cos x-\sin x -1$
$\displaystyle f'(x)=-\sin^2 x +\cos^2 x-\sin x -\cos x$
which is the same as yours, but less work
But your way was ok here

$\displaystyle f'(x) = -sinx(sinx+1)+cosx(cosx-1)$
$\displaystyle f'(x) = -sin^2x-sinx+cos^2x-cosx$

$\displaystyle 3. f(x) = (cosx-sinx)^2$
$\displaystyle f'(x) = 2(cosx-sinx)(-sinx-cosx)$
This is correct but you should multiply out the terms to see if there is a simpler form, which I doubt.

$\displaystyle 4. f(x) = ln(\cos x)+e^{\cos x}$
The first derivative is wrong, the second is correct
$\displaystyle f'(x) = {-\sin x\over \cos x}+e^{\cos x}(-\sin x)$

which can be reduced to $\displaystyle -\tan x-\sin x e^{\cos x}$.

If a function can be simplified even further, can you please show me.

3. 1) $\displaystyle f'(x) = sec^{2}(2x)*2 = 2sec^{2}(2x)$

2) correct

3) correct

4) $\displaystyle f'(x) = \frac {1}{cos(x)} \Big(-sin(x) \Big) + e^{cos(x)}\Big(-sin(x)\Big) = -tan(x) - sin(x)e^{cos(x)}$

4. Originally Posted by Random Variable
1) $\displaystyle f'(x) = sec^{2}(2x)*2 = 2sec^{2}(2x)$

2) correct

3) correct

4) $\displaystyle f'(x) = \frac {1}{cos(x)} \Big(-sin(x) \Big) + e^{cos(x)}\Big(-sin(x)\Big) = -tan(x) - sin(x)e^{cos(x)}$
OK, Thanks for the corrections. what I don't get is the last one still. I understand the second part but not the first.

$\displaystyle f(x) = ln(cosx)$ using the chain rule

wouldn't $\displaystyle ln$ be the outer function and $\displaystyle {cosx}$ be the inner function?

and if you differentiate $\displaystyle ln = \frac {1}{x}(cosx)*-sinx$

or is this the same as $\displaystyle f'(x) = \frac {1}{cos(x)} \Big(-sin(x) \Big)$

5. you're having trouble with the chain rule
as I wrote above you CANNOT change the inner function g(x)

In $\displaystyle f(x) = \ln(\cos x)$ the outer function is ln and the inner is cosine

The derivative of the log is 1 over the ENTIRE inner function giving us $\displaystyle {1\over \cos x}$

Next multiply that by the derivative of the inner function

the derivative of the cosine x is $\displaystyle -\sin x$.

Next multiply these two.

6. Originally Posted by matheagle
you're having trouble with the chain rule
as I wrote above you CANNOT change the inner function g(x)
Could you please explain the procedure step by step as to how you went about using the chain rule for the $\displaystyle ln(cosx)$ please?

7. It's f'(g(x))=1/cos x times g'(x) which is -sin x.

Better now?

8. Originally Posted by matheagle
you're having trouble with the chain rule
as I wrote above you CANNOT change the inner function g(x)

In $\displaystyle f(x) = \ln(\cos x)$ the outer function is ln and the inner is cosine

The derivative of the log is 1 over the ENTIRE inner function giving us $\displaystyle {1\over \cos x}$

Next mutiply that by the derivative of the inner function

the derivative of the cosine x is $\displaystyle -\sin x$.

Next multiply these two.
I didn't change the inner function, what I did was I only differentiated $\displaystyle ln$which is where I got $\displaystyle \frac{1}{x}$ then left the inner function as $\displaystyle {cosx}$ and then differentiate the inner function to $\displaystyle -sinx$. Hence where I came up with $\displaystyle \frac{1}{x}(cosx)(-sinx)$

But I see how you did it. 1 over the inner function left untouch. I'm struggling to understand why $\displaystyle {cosx}$ ends up within the differentiation of $\displaystyle ln$ unless you replace the $\displaystyle x$ in the $\displaystyle ln$ function with the inner function.

So basically, any $\displaystyle ln$ would produce a solution with $\displaystyle \frac{1}{x}$ where the inner function will always end up at the bottom replacing $\displaystyle x$ e.g. $\displaystyle ln(sinx)$

$\displaystyle f'(x) = \frac{1}{sinx}({cosx})$

is that correct?

BTW, thank you for your help

9. you did change the inner function, which is cosine x not just x.
The chain rule is just the product of two functions f' of g(x) which is one over g(x)=cos x here, then times the derivative of cos x.

Try setting f(x)=ln x and g(x) =cos x. Obtain the derivatives and plug into f'(g(x)) and g'(x).

and yes, the derivative of ln sin x is cot x.
More importantly you now know the integral of tan x and cot x.