Chapter 5 Week 5

5.1 Preliminary infomation

Some functions are more difficult to determine their ‘rate of change’ than those listed in Chapter 4, and so we can use new ‘rules’ to help us determine this. This difficulty may arrise because the function is a ‘compound’ function (such as the Maxwell-Boltzmann distribution), or because the function has more than one variable (the Master equation in thermodynamics has both pressure and temperature as active variables).

In this workshop we will recap the standard differentials previously studied, and expand on this so that we can determine, gradients, rates and turning points for more complicated functions.

A recap of standard differentials…

\[\begin{equation*} \begin{array}{ccc} f(x) \equiv y & & f^{\prime}(x) \equiv \dfrac{\textrm{d}y}{\textrm{d}x}\\ \hline A & &0 \\ Ax^n & &nAx^{n-1} \\ \dfrac{A}{x^n} \equiv A x^{-n} & &-nA x^{-n-1} \\ e^{Ax} & &Ae^{Ax} \\ A \ln Bx & &\dfrac{A}{x} \\ \sin Ax & &A\cos Ax \\ \cos Ax & &-A\sin Ax \\ \tan Ax & &-A\sec^2 Ax \\ Au + Bv & &A\dfrac{\textrm{d}u}{\textrm{d}x} + B\dfrac{\textrm{d}v}{\textrm{d}x} \\ \end{array} \end{equation*}\]

Now we can apply these rules to more complicated functions.

5.1.1 The Chain Rule

If differentiating a function of a function we use the ‘Chain Rule’:

\[\begin{equation} \dfrac{\textrm{d}y}{\textrm{d}x}=\dfrac{\textrm{d}y}{\textrm{d}u} \times \dfrac{\textrm{d}u}{\textrm{d}x} \tag{5.1} \end{equation}\]

When we use the term ‘function of a function’ we are referring to nested functions, these can be difficult to spot at first, but with practice we can identify part of our function to express as a variable \(u\), and have a second function acting on \(u\).

An example of a nested function can be a natural log. I have previously used one of our ‘rules of logs’ to show the differentiation of the function \(y = \ln ax\) (Section 4.1.7), but we can use the chain rule to do the same thing.

If \(y = \ln {ax}\), let \(u=ax\), so we can express our log as \(y = \ln u\).

Applying the chain rule, we need to determine \(\dfrac{\textrm{d}y}{\textrm{d}u}\) and \(\dfrac{\textrm{d}u}{\textrm{d}x}\).

\(y = \ln u\) then \(\dfrac{\textrm{d}y}{\textrm{d}u} = \dfrac{1}{u}\).

\(u=ax\) then \(\dfrac{\textrm{d}u}{\textrm{d}x}=a\).

Applying the chain rule, then \(\dfrac{\textrm{d}y}{\textrm{d}x}=\dfrac{1}{u} \times a\).

Substituting \(u = ax\), then \(\dfrac{\textrm{d}y}{\textrm{d}x}=\dfrac{1}{ax} \times a\), and cancelling the \(a\)s.

\(\dfrac{\textrm{d}y}{\textrm{d}x}=\dfrac{1}{x}\), the same result as in Section 4.1.7.

If we want to differentiate the function \(y=\cos ^2 x\) we first have to understand the notation of the function, and recognise how we can simplify this function.

The notation \(\cos ^2 x\) is just saying ‘cos x, squared’ or \((\cos x)^2\).

Recognising this helps us to identify that we can simplify \(y=\cos ^2 x\) to \(y=u^2\), by using \(u=\cos x\).

Knowing the chain rule, we need to determine \(\dfrac{\textrm{d}u}{\textrm{d}x}\) and \(\dfrac{\textrm{d}y}{\textrm{d}u}\).

If \(u=\cos x\), then \(\dfrac{\textrm{d}u}{\textrm{d}x} = -sin x\)

and \(y=u^2\), \(\dfrac{\textrm{d}y}{\textrm{d}u}=2u\)

Combining this: \(\dfrac{\textrm{d}y}{\textrm{d}x} = 2u \times -\sin x\)

and substituting \(u\) back in, \(\dfrac{\textrm{d}y}{\textrm{d}x} = 2\cos x \times -\sin x\)

and tidying up, we can say \(\dfrac{\textrm{d}}{\textrm{d}x}\cos ^2 x\) is

\(\dfrac{\textrm{d}y}{\textrm{d}x} = -2\sin x\cos x\)

Another example of a nested function is \(y=\cos x^2\).

In the case of \(y=\cos x^2\) we can say \(u=x^2\), so our original function becomes \(y=\cos u\).

If we now differentiate \(y\) with respect to \(u\), and \(u\), with respect to \(x\) we have all of the infomation we need to use the chain rule.

\(\dfrac{\textrm{d}y}{\textrm{d}u} = -\sin u\) and \(\dfrac{\textrm{d}u}{\textrm{d}x}=2x\).

Therefore \(\dfrac{\textrm{d}y}{\textrm{d}x} = -\sin u \times 2x\), and so with a little bit of substitution for \(u\) and tidying up:

\(\dfrac{\textrm{d}y}{\textrm{d}x} = -2x\sin x^2\)

5.1.2 The Product Rule

If differentiate a function times a function we use the ‘Product Rule’, if :

\[\begin{equation*} y= uv \end{equation*}\]

…where \(u\) and \(v\) are different functions of \(x\) (\(u(x)\) and \(v(x)\)). The first derivative of this compound function may be found using the general differential form for products:

\[\begin{equation} \dfrac{\textrm{d}(uv)}{\textrm{d}x} = v(x)\dfrac{\textrm{d}u(x)}{\textrm{d}x} + u(x)\dfrac{\textrm{d}v(x)}{\textrm{d}x} \tag{5.2} \end{equation}\]

In effect we are taking each of the two separate parts of the function, keeping one part the same and differentiating the other, then doing the same things in reverse. It makes more sense when you see it in action, but the product rule works when we have products (functions that are multiplied by each other).

In these notes I will often use the short hand \(\textrm{d}u\) to stand for \(\dfrac{\textrm{d}u(x)}{\textrm{d}x}\) and \(\textrm{d}v\) to stand for \(\dfrac{\textrm{d}v(x)}{\textrm{d}x}\).

If we consider \(y=xe^x\) we have a function which is a product of two separate functions of \(x\) (the two ‘sub-functions’ are multiplied by each other), then we can say:

\(u= x\) and \(v=e^x\)

then applying the product rule for the function \(y=uv\) where \(u\) and \(v\) are both functions of \(x\), \(\textrm{d}(uv) = v\textrm{d}u + u\textrm{d}v\), we need to determine the differentials of the functions \(u\) and \(v\) with respect to \(x\).

\(\textrm{d}u=1\) and \(\textrm{d}v=e^x\)

then combining everything together:

\(\dfrac{\textrm{d}y}{\textrm{d}x}=x e^x + 1 \times e^x\) or \(\dfrac{\textrm{d}y}{\textrm{d}x}=x e^x + e^x\)

We can also use the product rule if we have two terms divided by each other such as \(y=\frac{\sin x}{x}\), because we can express this as a product by rearranging the equation slightly to \(y=x^{-1}\sin x\).

If we want to differentiate \(y=\frac{\sin x}{x}\) we can use the product rule if we rearrange this as a product of two functions.

\(y=x^{-1}\sin x\)

We can say \(u=x^{-1}\) and \(v=\sin x\)

We then have to determine the differentials with respect to \(x\).

\(\textrm{d}u=-x^{-2}\) and \(\textrm{d}v=\cos x\)

Consequently, combining everything using the product rule:

\(\dfrac{\textrm{d}y}{\textrm{d}x}=x^{-1}\cos x - x^{-2}\sin x\)

or rearranging this back into the original fractions:

\(\dfrac{\textrm{d}y}{\textrm{d}x}=\dfrac{\cos x}{x}-\dfrac{\sin x}{x^2}\)

Previously in section 5.1.1 we differentiated \(y=\cos ^2 x\) using the chain rule, but we can also use the product rule.

If \(y=\cos^2 x\), we can also think of this as a product, \(y= \cos x \cos x\).

In this case: \(u= \cos x\) and \(v=\cos x\) also.

Following the product rule we need to determine \(\textrm{d}u\) and \(\textrm{d}v\).

\(\textrm{d}u = \textrm{d}v = -\sin x\)

Putting it all together:

\(\dfrac{\textrm{d}y}{\textrm{d}x}= \cos x \times -\sin x + \cos x \times -\sin x\), which rearranges and simplifies to:

\(\dfrac{\textrm{d}y}{\textrm{d}x}= -2\sin x\cos x\)

5.1.3 Partial differentiation

Any good scientist knows that you should only change one variable at a time to understand the effect it has on a system. This is exactly what partial differentiation does, although it recognises that there may be more than one variable in the system…

Partial differentiation uses a different notation to standard differentiation to denote there is more than one variable. Subscritps are used to denote variables which are kept constant.

If y is a function of both x and z, then we can differentiate with respect to either variable, in this case we treat the other variable as a constant and differentiate as we ever have. The notation for differentiating y with respect to z as x is kept constant would be:

\[\begin{equation*} \left(\frac{\partial y}{\partial z}\right)_x \end{equation*}\]

In some circumstances you may wish to differentiate a function first by one variable and then by another, the notation is this case is:

\[\begin{equation*} \left(\frac{\partial^2 y}{\partial x \partial z}\right) \end{equation*}\]

this is implying that the partial derivative of y with respect to x was determined first and then the partial derivate of that first derivative was determined with respect to z. It should not matter in which order you perform these functions, they should both yield the same answer.

The notation \(\left(\frac{\partial^2 y}{\partial x ^2}\right)_z\) would imply you differentiate \(y\) with respect to \(x\) twice, whilst keeping the variable \(z\) constant.

Partial derivatives are essential in science as they represent the scientific method, we look at how one variable affects another whilst keeping all of the other variables constant.

In thermodynamics we see many of our variables be functions of both pressure and temperature, and so partial derivatives are used.

We can consider and equation you are already familiar with which has multiple variables, the ideal gas law.

\[\begin{equation} pV = nRT \tag{1.2} \end{equation}\]

and we can investigate how each of the terms are inter-related, since \(p\), \(V\), \(n\) & \(T\) are all variables. I am aware this is the exact opposite of how the ideal gas law was constructed but it works as an example.

We can determine an expression for how the pressure, \(p\), of a gas varies with temperature, \(T\), by differentiating an expression with \(p\) as teh subject with respect to \(T\), whilst keeping \(n\) & \(V\) as constants.

Rearranging equation (1.2) to make \(p\) the subject:

\[\begin{equation*} p = \frac{nRT}{V} \end{equation*}\]

and then differentiating \(p\) with respect to \(T\) (whilst keeping \(n\) and \(V\) constant):

\[\begin{equation*} \left(\frac{\partial p}{\partial T}\right)_{n,V}=\frac{nR}{V} \end{equation*}\]

this says that pressure and temperature are directly proportional with a constant of proportionality \(\frac{nR}{V}\), or thinking of it another way in a plot of \(p\) against \(T\) the gradient of the line will be \(\frac{nR}{V}\).

This is Gay-Lussac’s law, and is one of the relationships that went into building the ideal gas law.

We can determine the other relationships that went into building the ideal gas law, by differentiating the function in different ways.

If we make \(p\) the subject and differentiating with respect to \(V\) we get the expression \(\left(\frac{\partial p}{\partial V}\right)_{n,T}=-\frac{nRT}{V^2}\), this is an expression of Boyle’s law.

We can make \(V\) the subject and differentiating with respect to \(T\) we get the expression \(\left(\frac{\partial V}{\partial T}\right)_{n,p}=\frac{nR}{p}\), or the volume is directly proportional to the temperature (Charles’ law) with a constant of proportionality \(\frac{nR}{p}\).

The final relationship that makes the ideal gas law is Avagadro’s law, which shows how the volume, \(V\), is related to the number of moles of a gas, \(n\). If we make \(V\) the subject and differentiate with respect to \(n\), we get the expression \(\left(\frac{\partial V}{\partial n}\right)_{p,T}=\frac{RT}{p}\). The variables are directly proportional, or the gradient of a plot with \(V\) on the \(y\) axis and \(n\) on the \(x\) axis would be \(\frac{RT}{p}\).

This shows the importance of recognizing that when a function depends upon multiple variables we have to recognise this when doing differentiation, but that the actual process of differentiation is identical to when there is just one variable.

5.2 Questions

5.2.1 Chain rule

Find the turning points \((x,y)\) for the following functions:

  1. \(y = sin^2(x)\)
  2. \(y = sin(e^{4x})\)
  3. \(y = e^{(7x^2 + 2x)}\)
  4. \(y = (x-1)^9\)

5.2.2 Product rule questions

Differentiate the following using the product rule:

  1. \(y = x e^{7x}+ 7xe^x\)
  2. \(y = 5x \cos (2x)\)
  3. \(y = \frac{\sin x}{x^2}\)
  4. \(y = \tan x\)

5.2.3 More complex differentiation questions

Differentiate the following (you will need to decide if you need the product rule or the chain rule):

  1. \(y = x \ln x\)
  2. \(y = \sin ^7 (5x)+ \cos ^5 (7x)\)
  3. \(y = x^2 e^{x^2}\)
  4. \(y = e^{\sin x^2}\)

5.2.4 Partial differentiation questions

For the following function determine:

\(\left(\frac{\partial y}{\partial z}\right)_x\), \(\left(\frac{\partial y}{\partial x}\right)_z\), \(\left(\frac{\partial^2 y}{\partial z^2}\right)_x\), \(\left(\frac{\partial^2 y}{\partial x^z}\right)_z\), \(\left(\frac{\partial^2 y}{\partial x \partial z}\right)\) and \(\left(\frac{\partial^2 y}{\partial z \partial x}\right)\)

  1. \(y = x^6z -3x^2z^3+x^2z+6z^6+5\)
  2. \(y = e^{3x}+ze^{2x}+x^2e^{-z}-z^2\)
  3. \(y=\frac{\sin (3z)}{x}-\frac{1}{e^{3x}z^2}\)
  4. \(y=\sin(3z^2+2xz+x^2)\)*

*this one is involved - it uses both the chain and the product rule!

5.2.5 Applied questions

  1. The radius of a spherical balloon is increasing at a rate of 0.2 m s−1. Find the rate of increase of (a) the volume and (b) the surface area of the balloon at the instant when the radius is 1.6 m.

  2. Determine an expression for the equilibrium separation, \(r_{\textrm{eq}}\) of two atoms in a bond using the Morse potential:

\[\begin{equation*} V_{\textrm{Morse}}= D(1-e^{-a(r-r_0)})^2 \end{equation*}\]

5.3 Answers

5.3.1 Chain rule

  1. \(\dfrac{\textrm{d}y}{\textrm{d}x}= 2 \sin x \cos x\)
  2. \(\dfrac{\textrm{d}y}{\textrm{d}x}=4e^{4x}\cos (e^{4x})\)
  3. \(\dfrac{\textrm{d}y}{\textrm{d}x}= (14x+2)e^{(7x^2 + 2x)}\)
  4. \(\dfrac{\textrm{d}y}{\textrm{d}x}= 9 (x-1)^8\)

5.3.2 Product rule questions

  1. \(\dfrac{\textrm{d}y}{\textrm{d}x}=e^{7x}+7xe^{7x}+ 7e^x+7xe^x\)
  2. \(\dfrac{\textrm{d}y}{\textrm{d}x}=5 \cos (2x)-10x \sin (2x)\)
  3. \(\dfrac{\textrm{d}y}{\textrm{d}x}= \frac{\cos x}{x^2}-\frac{2\sin x}{x^3}\)
  4. \(\dfrac{\textrm{d}y}{\textrm{d}x}=\frac{1}{\cos^2 x}\)

5.3.3 More complex differentiation questions

  1. \(\dfrac{\textrm{d}y}{\textrm{d}x}=\ln x +1\)
  2. \(\dfrac{\textrm{d}y}{\textrm{d}x}=35 \cos (5x) \sin^6 (5x) - 35 \sin (7x) \cos^4(7x)\)
  3. \(\dfrac{\textrm{d}y}{\textrm{d}x}=2x e^{x^2}+ 2x^3e^{x^2}\)
  4. \(y=2x \cos x^2 e^{\sin x^2}\)

5.3.4 Partial differentiation questions

  1. \(\left(\frac{\partial y}{\partial z}\right)_x= x^6-9x^2z^2+x^2+36z^5\), \(\left(\frac{\partial y}{\partial x}\right)_z=6x^5z-6xz^3+2xz\), \(\left(\frac{\partial^2 y}{\partial z^2}\right)_x=-18x^2z+180z^4\), \(\left(\frac{\partial^2 y}{\partial x^z}\right)_z=30x^4z-6z^3+2z\), \(\left(\frac{\partial^2 y}{\partial x \partial z}\right)=6x^5-18xz^2+2x\) and \(\left(\frac{\partial^2 y}{\partial z \partial x}\right)=6x^5-18xz^2+2x\)

  2. \(\left(\frac{\partial y}{\partial z}\right)_x=e^{2x}-x^2e^{-z}-2z\), \(\left(\frac{\partial y}{\partial x}\right)_z=3e^{3x}+2e^{2x}z+2xe^{-z}\), \(\left(\frac{\partial^2 y}{\partial z^2}\right)_x=x^2e^{-z}-2\), \(\left(\frac{\partial^2 y}{\partial x^2}\right)_z=9e^{3x}+4e^{2x}z+ 2e^{-z}\), \(\left(\frac{\partial^2 y}{\partial x \partial z}\right)=2e^{2x}-2xe^{-z}\) and \(\left(\frac{\partial^2 y}{\partial z \partial x}\right)=2e^{2x}-2xe^{-z}\)

  3. \(\left(\frac{\partial y}{\partial z}\right)_x=\frac{\cos (3z)}{x}+\frac{2}{e^{3x}z^3}\), \(\left(\frac{\partial y}{\partial x}\right)_z=-\frac{\sin (3z)}{x^2}+\frac{3}{e^{3x}z^2}\), \(\left(\frac{\partial^2 y}{\partial z^2}\right)_x=-9\frac{\sin (3z)}{x}-\frac{6}{e^{3x}z^4}\), \(\left(\frac{\partial^2 y}{\partial x^z}\right)_z=\frac{2\sin (3z)}{x^3}-\frac{9}{e^{3x}z^2}\), \(\left(\frac{\partial^2 y}{\partial x \partial z}\right)=\frac{-3\cos (3z)}{x^2}-\frac{6}{e^{3x}z^3}\) and \(\left(\frac{\partial^2 y}{\partial z \partial x}\right)=\frac{-3\cos (3z)}{x^2}-\frac{6}{e^{3x}z^3}\)

  4. \(\left(\frac{\partial y}{\partial z}\right)_x=(6z+2x)\cos(3z^2+2xz+x^2)\), \(\left(\frac{\partial y}{\partial x}\right)_z=(2z+2x)\cos(3z^2+2xz+x^2)\), \(\left(\frac{\partial^2 y}{\partial z^2}\right)_x=2\cos(3z^2+2xz+x^2)-(2z+2x)^2\sin(3z^2+2xz+x^2)\), \(\left(\frac{\partial^2 y}{\partial x^z}\right)_z=6\cos(3z^2+2xz+x^2)-(6z+2x)^2\sin(3z^2+2xz+x^2)\), \(\left(\frac{\partial^2 y}{\partial x \partial z}\right)=2\cos(3z^2+2xz+x^2)-(2z+2x)(6z+2x)\sin(3z^2+2xz+x^2)\) and \(\left(\frac{\partial^2 y}{\partial z \partial x}\right)=2\cos(3z^2+2xz+x^2)-(2z+2x)(6z+2x)\sin(3z^2+2xz+x^2)\) if you can do this one you can do them all!!!

5.3.5 Applied Questions

  1. \(\dfrac{\textrm{d}V}{\textrm{d}t}= 0.8 \pi r^2= 6\) m3 s-1, \(\dfrac{\textrm{d}SA}{\textrm{d}t}=1.6 \pi r = 8 \times 10^1\) m2 s-1

Since there is just one significant figure in the question the answers should only be reported to one significant figure.

This means that for the value of ‘80’ we need to use standard form as any number we share is deemed to be significant.

  1. \(r_{eq}=r_0\)