# Chain rule and product rule

#### Petrus

##### Well-known member
Hello MHB,
I got one exempel that I dont get same result as my book.
Exempel: If $$\displaystyle z=f(x,y)$$ has continuos second-order partial derivates and $$\displaystyle x=r^2+s^2$$ and $$\displaystyle y=2rs$$ find $$\displaystyle \frac{d^2z}{dr^2}$$
So what I did before checking soulotion:
$$\displaystyle \frac{d^2z}{dr^2}=\frac{dz}{dr} \frac{d}{dr}$$
So I start with solving $$\displaystyle \frac{dz}{dr}=\frac{dz}{dx}\frac{dx}{dr}+\frac{dz}{dy}\frac{dy}{dr} = \frac{dz}{dx}(2r)+\frac{dz}{dy}(2s)$$
so now we got $$\displaystyle \frac{d}{dr}(\frac{dz}{dx}(2r)+\frac{dz}{dy}(2s))$$ and that is equal to $$\displaystyle 2r\frac{d}{dr}\frac{dz}{dx}+2s\frac{d}{dr}\frac{dz}{dy}$$
my book soloution:
$$\displaystyle \frac{d^2z}{dr^2}= \frac{d}{dr}(\frac{dz}{dx}(2r)+\frac{dz}{dy}(2s))$$ and they equal that to $$\displaystyle 2\frac{dz}{dx}+2r\frac{d}{dr}(\frac{dz}{dx})+2s \frac{d}{dr}(\frac{dz}{dy})$$
my question is where do they get that extra $$\displaystyle 2\frac{dz}{dx}$$ (I suspect it was a accident) and my last question why do they got parantes on $$\displaystyle (\frac{dz}{dx})$$ and $$\displaystyle (\frac{dz}{dy})$$
then they solve $$\displaystyle \frac{d}{dr} (\frac{dz}{dx})$$ and $$\displaystyle \frac{d}{dr}(\frac{dz}{dx})$$
why do they do that and how do they do it? unfortently I have to run so I cant post fully soloution, will post it later.

Regards,

Last edited:

#### ZaidAlyafey

##### Well-known member
MHB Math Helper
Re: chain rule and product rule

so now we got $$\displaystyle \frac{d}{dr}(\frac{dz}{dx}(2r)+\frac{dz}{dy}(2s))$$ and that is equal to $$\displaystyle 2r\frac{d}{dr}\frac{dz}{dx}+2s\frac{d}{dr}\frac{dz}{dy}$$
here you have a mistake $$\displaystyle 2r$$ can't be taken out , it is not constant .

use product rule

Last edited:

#### Petrus

##### Well-known member
Re: chain rule and product rule

here you have a mistake $$\displaystyle 2r$$ can't be taken out , it is not constant .
ignore thanks zaid

#### Petrus

##### Well-known member
Re: chain rule and product rule

here you have a mistake $$\displaystyle 2r$$ can't be taken out , it is not constant .

use product rule
I got one question. How do we know for sure that our function z got variable r in it? May sound stupid but I would like to know? Is it because we can rewrite x and y?

#### ZaidAlyafey

##### Well-known member
MHB Math Helper
Re: chain rule and product rule

I got one question. How do we know for sure that our function z got variable r in it? May sound stupid but I would like to know? Is it because we can rewrite x and y?
We can't make sure , but it depends on r because both x and y depends on the value of r and s.

#### Petrus

##### Well-known member
I dont understand this part
$$\displaystyle \frac{d}{dr}(\frac{dz}{dx})=\frac{d}{dx}(\frac{dz}{dx})\frac{dx}{dr}+(\frac{d}{dy}(\frac{dz}{dx}) \frac{dy}{dr}=\frac{d^z}{dz^2}(2r)+\frac{d^2z}{dydx}(2s)$$
they do same with $$\displaystyle \frac{d}{dr}( \frac{dz}{dy})$$ and I dont understand it, what does it means to take $$\displaystyle \frac{d}{dr}(\frac{dz}{dx})$$

Regards,

#### ZaidAlyafey

##### Well-known member
MHB Math Helper
We know that :

$$\displaystyle \frac{d}{dr}(z) = \frac{dz}{dx}\cdot \frac{dx}{dr}+\frac{dz}{dy}\cdot \frac{dy}{dr}$$

but we want to find here $$\displaystyle \frac{d}{dr} \left( \frac{dz}{dx}\right)$$

so what do we do using the chain rule ?

#### ZaidAlyafey

##### Well-known member
MHB Math Helper
Here is a hint

substitute $$\displaystyle \frac{dz}{dx}$$ instead of each $$\displaystyle z$$

#### Petrus

##### Well-known member
Here is a hint

substitute $$\displaystyle \frac{dz}{dx}$$ instead of each $$\displaystyle z$$
that made it more clear, I was like thinking and thinking and then when I read your hint it made clear!! I was never thinking about that!
$$\displaystyle \frac{d}{dr}(z) = \frac{dz}{dx}\cdot \frac{dx}{dr}+\frac{dz}{dy}\cdot \frac{dy}{dr} <=> \frac{d}{dr}\frac{dz}{dx}=\frac{d(\frac{dz}{dx})}{dx}\frac{dx}{dr}+ \frac{d( \frac{dz}{dx})}{dy}\frac{dy}{dr} <=> \frac{d}{dr}\frac{dz}{dx}=\frac{\frac{d^2z}{dx}}{dx}\frac{dx}{dr}+ \frac{ \frac{d^2z}{dx}}{dy}\frac{dy}{dr}$$ and now we can use the rule $$\displaystyle \frac{ \frac{a}{b}}{\frac{c}{d}} = \frac{ad}{bc}$$ to make it easy to see I always add an /1 in evry term in bottom exempel $$\displaystyle dx= \frac{dx}{1}$$(I somehow screw it when I try it with latex :S) so we got $$\displaystyle \frac{d}{dr}\frac{dz}{dx}=\frac{d^2z}{(dx)^2}\frac{dx}{dr}+ \frac{d^2z}{dxdy}\frac{dy}{dr} <=>\frac{d}{dr}\frac{dz}{dx}= \frac{d}{dx}\frac{dz}{dx}\frac{dx}{dr}+\frac{d}{dx}\frac{dz}{dy}\frac{dy}{dr}$$

(Huh was a challange to do this on $$\displaystyle \LaTeX$$ but worked well)

Last edited:

#### ZaidAlyafey

##### Well-known member
MHB Math Helper
$$\displaystyle \frac{d}{dr}(z) = \frac{dz}{dx}\cdot \frac{dx}{dr}+\frac{dz}{dy}\cdot \frac{dy}{dr} <=> \frac{d}{dr}\frac{dz}{dx}=\frac{d(\frac{dz}{dz})}{dx}\frac{dx}{dr}+ \frac{d( \frac{dz}{dx})}{dy}\frac{dy}{dr}$$
You have some mistakes , how did you get $$\displaystyle \frac{dz}{dz}$$?

#### Petrus

##### Well-known member
You have some mistakes , how did you get $$\displaystyle \frac{dz}{dz}$$?
Typo... I am working with edit it... got confused:S

#### Petrus

##### Well-known member
Thanks Zaid I finish edit it and now I understand what my book did Unfortently I could not figoure it out by myself but now I learned it! Thanks for taking your time

#### ZaidAlyafey

##### Well-known member
MHB Math Helper
You have some wrong notations

$$\displaystyle \frac{d}{dx} \left( \frac{dz}{dx}\right)$$

what is that equal to ?

#### Petrus

##### Well-known member
You have some wrong notations

$$\displaystyle \frac{d}{dx} \left( \frac{dz}{dx}\right)$$

what is that equal to ?
$$\displaystyle \frac{d^2z}{(dx)^2}$$

#### ZaidAlyafey

##### Well-known member
MHB Math Helper
$$\displaystyle \frac{d^2z}{(dx)^2}$$
This is the second derivative of z with respect to x , it isn't usual multiplication !

#### Petrus

##### Well-known member
This is the second derivative of z with respect to x , it isn't usual multiplication !
I always have write it as that :s but I think in my brain that it means second derivate but that is obvious wrong.... $$\displaystyle \frac{d^2z}{dx^2}$$

#### ZaidAlyafey

##### Well-known member
MHB Math Helper
I always have write it as that :s but I think in my brain that it means second derivate but that is obvious wrong.... $$\displaystyle \frac{d^2z}{dx^2}$$
The most important thing that you understand , it is not a matter of notations it is a matter of comprehending the concept behind , best luck .