# Chain Rule

#### Yankel

##### Active member
Hello all,

I need to find the second order derivative of w by t, and to calculate it's value at t=1.

This is what I know about w, x and y.

$w=ln(x+y)$

$x=e^{t}$

$y=e^{-t}$

The answer in the book is:

$\frac{4}{(e^{t}+e^{-t})^{2}}$

I got another answer and I don't know what I did wrong, my solution is attached as an image.

Would appreciate your help with it. Thank you.

P.S According to Maple I am correct

Last edited:

#### lfdahl

##### Well-known member
Your calculations are all the way through OK. It is just the very end of your equations, that needs a lift:

Try to calculate the difference:

$(e^t+e^{-t})^2-(e^t-e^{-t})^2$

what do you get?

Last edited:

#### ThePerfectHacker

##### Well-known member
Start with a function $f(x,y)$. Substitute two functions $x=g(t)$ and $y=h(t)$ to get the composite function $F(t) = f(g(t),h(t))$. The chain rule says that,
$$\frac{dF}{dt} = \frac{\partial f}{\partial x}\frac{dx}{dt} + \frac{\partial f}{\partial y}\frac{dy}{dt}$$
Now when you compute the second derivative you use the product rule, so,
$$\frac{d^2 F}{dt^2} = \frac{d}{dt} \left( \frac{\partial f}{\partial x} \right) \frac{dx}{dt} + \frac{\partial f}{\partial x}\frac{d^2 x}{dt^2} + \frac{d}{dt} \left( \frac{\partial f}{\partial y} \right) \frac{dy}{dt} + \frac{\partial f}{\partial y}\frac{d^2y}{dt^2}$$
To make things easier to follow let $A = \frac{\partial f}{\partial x}$, so,
$$\frac{d}{dt}\left( \frac{\partial f}{\partial x}\right) = \frac{dA}{dt} = \frac{\partial A}{\partial x} \frac{dx}{dt} + \frac{\partial A}{\partial y} \frac{dy}{dt} = f_{xx} \frac{dx}{dt} + f_{xy}\frac{dy}{dt}$$
In a similar way if we have,
$$\frac{d}{dt}\left( \frac{\partial f}{\partial y} \right) = f_{yx}\frac{dx}{dt} + f_{yy} \frac{dy}{dt}$$
Therefore our 2nd derivative formula is,
$$\frac{d^2F}{dt} = (f_{xx} x' + f_{xy}y')x' + f_x \cdot x'' + (f_{yx}x' + f_{yy}y')y' + f_y \cdot y''$$
This simplifies to, (recall that $f_{xy} = f_{yx}$),
$$\frac{d^2 F}{dt} = f_{xx} (x')^2 + 2f_{xy}x'y' + f_{yy}(y')^2 + f_x\cdot x'' + f_y\cdot y''$$

#### Boromir

##### Banned
Hello all,

I need to find the second order derivative of w by t, and to calculate it's value at t=1.

This is what I know about w, x and y.

$w=ln(x+y)$

$x=e^{t}$

$y=e^{-t}$

The answer in the book is:

$\frac{4}{(e^{t}+e^{-t})^{2}}$

I got another answer and I don't know what I did wrong, my solution is attached as an image.

View attachment 1997

Would appreciate your help with it. Thank you.

P.S According to Maple I am correct
The derivative of $x+y$ is $e^t-e^{-t}$. Using the chain rule therefore, the derivative of w is $e^t-e^{-t}$ multiplied by $\frac{1}{x+y}$ which is equal to $\frac{e^t-e^{-t}}{e^t+e^{-t}}$ Then use quotient rule. x and y are just labels- easier to bypass them

#### Yankel

##### Active member
lfdahl,

what I get is: 2e^(-2t) where does it lead me ?

ThePerfectHacker, honestly, you lost me

and Boromir, isn't what I did identical to what you suggest ?

guys, I am quite confused, did I get it wrong or right ? I can't see what I did wrong here.

#### lfdahl

##### Well-known member
lfdahl,

what I get is: 2e^(-2t) where does it lead me ?

ThePerfectHacker, honestly, you lost me

and Boromir, isn't what I did identical to what you suggest ?

guys, I am quite confused, did I get it wrong or right ? I can't see what I did wrong here.
$(e^t+e^{-t})^2-(e^t-e^{-t})^2 = (x+y)^2-(x-y)^2 = x^2+y^2+2xy-(x^2+y^2-2xy)$

Can you continue?

#### Yankel

##### Active member
Right, I get 4, I see what you mean. But I can't see where my last move was incorrect. Can it be that both expressions are equal ?

Look at it more simply, if my first derivative is tanh(t), doesn't it mean that it's derivative should be 1-tanh(t) ? Even without calculating all the way ?

#### lfdahl

##### Well-known member
I would expect:

tanh'(t) = 1 - tanh2(t)

- and this is also the result you get.

#### Yankel

##### Active member
Thanks, you were very helpful, and I found my mistake thanks to you.

It is 1-tanh(t)^2 and I wrote 1-tanh(t) without the power, that's why Maple told me the expressions are not identical...