5 Week 5

We close “differentiation” by considering functions that have more than one variable, and differentiating with respect to either of them.

We then move on to look at the opposite process to differentiation, called integration. Given the derivative of a function, can we find a function that gave rise to that derivative?

5.1 Partial Differentiation

If an expression is a function of two variables then it can be differentiated with respect to either of the variables.

For example, suppose \[ z(x,y) = x^2+xy+y^2. \] If we fix the value of the variable \(y\) and consider this as a function of the variable \(x\) only.

For example, if \(y=2\), then \[ z(x,2) = x^2 + 2x + 4. \] We can differentiate this function with respect to \(x\) to get \(\mathrm{d}z(x,2)/\mathrm{d}x = 2x+2\).

Similarly, we can fix the value of the variable \(x\) and consider it as a function of \(y\) only. For example if \(x=-1\), then \[ z(-1,y) = 1-y+y^2. \] T

For example, if \(y=2\), then \[ z(x,2) = \phantom{x^2 + 2x + 4.} \] We can differentiate this function with respect to \(x\) to get \(\mathrm{d}z(x,2)/\mathrm{d}x =\)

(Recall: \(z(x,y) = x^2+xy+y^2\).)

Similarly, we can fix the value of the variable \(x\) and consider it as a function of \(y\) only. For example if \(x=-1\), then \[ z(-1,y) = \] The derivative of this with respect to \(y\) is then \(\mathrm{d}z(-1,y)/\mathrm{d}y =\)

In general, if we think of \(y\) as being a fixed constant (not worrying about the actual value), then we can differentiate \(z\) with respect to \(x\). We use the following notation \[ \frac{\partial z}{\partial x} = 2x+y. \] In the same way, thinking of \(x\) as being a fixed constant and differentiating with respect to \(y\) we write \[ \frac{\partial z}{\partial y} = x + 2y. \]

(Recall: \(z(x,y) = x^2+xy+y^2\).)

In general, if we think of \(y\) as being a fixed constant (not worrying about the actual value), then we can differentiate \(z\) with respect to \(x\). We use the following notation \[ \frac{\partial z}{\partial x} = \phantom{2x+y.} \] In the same way, thinking of \(x\) as being a fixed constant and differentiating with respect to \(y\) we write \[ \frac{\partial z}{\partial y} = \phantom{x + 2y.} \]

Consider the expression for the volume of a cylinder, \(V = \pi r^2h\) where \(r\) is the radius of the cylinder and \(h\) is its height. (Figure 5.1)

cylinder

Figure 5.1: cylinder

The two different “derivatives” are \[\begin{align*} \text{treating }h\text{ as a constant } \frac{\partial V}{\partial r} &= 2\pi rh\\ \text{treating }r\text{ as a constant } \frac{\partial V}{\partial h} &= \pi r^2 \end{align*}\]

The two different “derivatives” are \[\begin{align*} \text{treating }h\text{ as a constant } \frac{\partial V}{\partial r} &= \phantom{2\pi rh}\\ \text{treating }r\text{ as a constant } \frac{\partial V}{\partial h} &= \phantom{\pi r^2} \end{align*}\]

We use the symbol \(\partial\) in the derivatives above to indicate that there is more than one variable by which the expression may be differentiated and that we have chosen to treat any other variables as constants while differentiating.

The first type of derivative tells us how the volume would vary as the radius was varied for a cylinder of constant height. The second type of derivative tells us how the volume would vary as the height varied for a cylinder of constant radius.

When a function of more than one variable is differentiated with respect to one variable only, this process is called partial differentiation.

Example 5.1 From the function \(z=x^3y^2\), determine \(\partial z/\partial x\) and \(\partial z/\partial y\).

Solution. \[ \frac{\partial z}{\partial x} = 3x^2y^2,\;\frac{\partial z}{\partial y} = 2yx^3. \]

Example 5.2 From the function \(z=3x^5-5y^3+6\), determine \(\partial z/\partial x\) and \(\partial z/\partial y\).

Solution. \[ \frac{\partial z}{\partial x} = 15x^4,\;\frac{\partial z}{\partial y} = -15y^2. \]

5.1.1 Successive partial derivatives

If a second partial derivative is required and there are, say, two variables, then a second derivative may be made with each of these variables.

Example 5.3 Calculate all possible “second partial derivatives” of \[ z=3x^2+2x^2y^2+3y^2. \]

Solution. \[ \frac{\partial z}{\partial x} = 6x+4xy^2,\;\frac{\partial z}{\partial y} = 4x^2y+6y. \] So \[ \frac{\partial}{\partial x}\left(\frac{\partial z}{\partial x}\right) = \frac{\partial^2 z}{\partial x^2} = 6+4y^2 \] \[ \frac{\partial}{\partial y}\left(\frac{\partial z}{\partial y}\right) = \frac{\partial^2 z}{\partial y^2} = 6+4x^2 \] \[ \frac{\partial}{\partial x}\left(\frac{\partial z}{\partial y}\right) = \frac{\partial^2 z}{\partial x\partial y} = 8xy \] \[ \frac{\partial}{\partial y}\left(\frac{\partial z}{\partial x}\right) = \frac{\partial^2 z}{\partial y\partial x} = 8xy \]

(Recall: \(z=3x^2+2x^2y^2+3y^2\).)

Example 5.4 Calculate all possible “second partial derivatives” of \[ z = x\cos(y)-y\cos(x) \]

Solution. \[ \frac{\partial z}{\partial x} = \cos(y)+y\sin(x),\;\frac{\partial z}{\partial y} = -x\sin(y)-\cos(x). \] So \[ \frac{\partial}{\partial x}\left(\frac{\partial z}{\partial x}\right) = \frac{\partial^2 z}{\partial x^2} = y\cos(x) \] \[ \frac{\partial}{\partial y}\left(\frac{\partial z}{\partial y}\right) = \frac{\partial^2 z}{\partial y^2} = -x\cos(y) \] \[ \frac{\partial}{\partial x}\left(\frac{\partial z}{\partial y}\right) = \frac{\partial^2 z}{\partial x\partial y} = -\sin(y)+\sin(x) \] \[ \frac{\partial}{\partial y}\left(\frac{\partial z}{\partial x}\right) = \frac{\partial^2 z}{\partial y\partial x} = -\sin(y)+\sin(x) \]

5.2 Integration as the opposite of differentiation

Given a function \(f(x)\), we have seen the notion of the inverse function, that is a function \(g(x)\) such that \(f(g(x)) = x\) (or \(g(f(x))=x\); which one?). For example if \(f(x) = x^2\) (for \(x\geq0\)), then taking \(g(x) = \sqrt{x}\) (for \(x\geq0\)) indeed verifies \(f(g(x)) = (\sqrt{x})^2 = x\). The inverse ‘undoes’ what the original function does.

Integration is the “inverse” of differentiation. That is, having been given the derivative of a function, we are asking; what was the original function that was differentiated to get that derivative? (xkcd)

The symbol for integration is \(\displaystyle\int\), which is the Old English symbol for “s”. The symbol is used to indicate that integration is a summation process. We shall see why later.

5.2.1 Integration by rule

Suppose \(\mathrm{d}y/\mathrm{d} x = 2x\). Then the instruction “integrate this function with respect to \(x\)” is written \[ \int 2x \,\mathrm{d}x \] We know that to get \[ \frac{\mathrm{d}y}{\mathrm{d}x} = 2x \] we could have started with \(y = x^2\) so this is one possible solution.

However, we could also have started with \(y = x^2 + 5\) or \(y = x^2 + 1\) or \(y = x^2 + 25\) or \(y = x^2 + 1245\).

However, we could also have started with \(y =\)

We can’t tell which because all information about the any constant value is lost when we differentiate. To make this clear we write \[ \int 2x \,\mathrm{d}x = x^2 + c \] where “\(c\)” represents an arbitrary constant.

General rules for simple functions follow from the differentiation rules:

For differentiation, we had that if \(y = x^n\), then \(\mathrm{d}y/\mathrm{d} x= nx^{n-1}\).

Thus for integration, if \(\mathrm{d}y/\mathrm{d}x = x^n\) then \(y=\displaystyle\int x^n \,\mathrm{d}x = \frac{x^{n+1}}{n+1} + c\), if \(n \ne -1\).

After a function has been integrated, the result of integration may be checked by differentiating the answer.

Similarly as for derivatives, constants and \(\pm\) “come out of the integral”:

  • Summation Rule: \(\displaystyle\int(f(x)+g(x))\,\mathrm{d}x = \displaystyle\int f(x)\,\mathrm{d}x + \displaystyle\int g(x)\,\mathrm{d}x\).
  • Coefficient Rule: \(\displaystyle\int af(x)\,\mathrm{d}x = a\displaystyle\int f(x)\,\mathrm{d}x\).
  • Power Rule: \(\displaystyle\int x^n \,\mathrm{d}x = x^{n+1}/(n+1) + c\).

Example 5.5 Integrate the functions

  1. \(y=x^3\)
  2. \(y=3x^2\)
  3. \(y=6x-4\)
  4. \(y=(8x^2-4x+5)/x^4\)
  5. \(y=x^{3/5}(2x-\sqrt{x})\)

Solution.

  1. \(\displaystyle\int x^3 \,\mathrm{d}x = x^4/4+c\),
  2. \(\displaystyle\int 3x^2 \,\mathrm{d}x = 3x^3/3+c = x^3+c\),
  3. \(\displaystyle\int(6x-4)\,\mathrm{d}x = \displaystyle\int 6x \,\mathrm{d}x - \displaystyle\int 4\,\mathrm{d}x = 6x^2/2-4x+c = 3x^2-4x+c\),
  4. \(y=(8x^2-4x+5)/x^4 = 8/x^2-4/x^3+5/x^4 = 8x^{-2}-4x^{-3}+5x^{-4}\) and so \[\begin{align*} \int y \,\mathrm{d}x& = \int 8x^{-2}\,\mathrm{d}x\int -4x^{-3}\,\mathrm{d}x+\int5x^{-4}\,\mathrm{d}x = \frac{8x^{-1}}{-1}-\frac{4x^{-2}}{-2}+\frac{5x^{-3}}{-3}+C\\ &=\frac{-1}{8x}+\frac{2}{x^2}-\frac{5}{3x^3} = \frac{-3x^2+48x-40}{24x^3} + C, \end{align*}\]
  5. \(y = x^{3/5}(2x-\sqrt{x}) = 2x^{8/5}-x^{11/10}\) and so \[ \int y \,\mathrm{d}x = \int 2x^{8/5}\,\mathrm{d}x-\int x^{11/10}\,\mathrm{d}x = \frac{2x^{13/5}}{13/5} - \frac{x^{21/10}}{21/10}+C = \frac{10}{13}x^{13/5}-\frac{10}{21}x^{21/10} + C. \]

(Recall: 4. \(y=(8x^2-4x+5)/x^4\))

(Recall: 5. \(y=x^{3/5}(2x-\sqrt{x})\))

5.3 Indefinite Integration

The result of an integration which has the arbitrary constant (we used letter \(c\) in the examples above) is called an indefinite integration, because it does not tell us which of an infinite number of possible functions is the “correct” one – they are all “correct” answers to the question of finding a function which differentiates to the given one.

To determine the value of \(c\), we need more information, such as a pair of co-ordinates through which our particular solution (curve) passes. Such additional information is called a boundary condition.

Example 5.6 Find \(y\), the integral of \(4x + 5\), with the correct constant, given that the boundary condition is: When \(x = 1, y = 3\).

Solution. \[ y = \int(4x+5)\,\mathrm{d}x = \frac{4x^2}{2} + 5x+c = 2x^2+5x+c \] Now we use the condition that when \(x=1\) then \(y=3\) so that \[ 3 = 2\times 1^2 + 5\times1 + c = 7+c. \] Hence \(c = 3-7=-4\) and therefore \[ y = 2x^2+5x-4. \]

Example 5.7 Find \(y\), the integral of \(3\sqrt{x} - 2/x^2\), with the correct constant, given thatthe boundary condition is: When \(x = 1, y = 4\).

Solution. \[\begin{align*} y& = \int(3\sqrt{x}-2/x^2)\,\mathrm{d}x = 3\int x^{1/2}\,\mathrm{d}x - 2\int x^{-2}\,\mathrm{d}x\\ &= \frac{3x^{3/2}}{3/2} - \frac{2x^{-1}}{-1}+C = 2x^{3/2}+\frac2x+C. \end{align*}\] Now the boundary condition tells us that when \(x=1, y = 4\) and so \(4=2\times1^{3/2}+2/1+C = 2+2+C\). Hence \(C=0\) and so \[ y = 2x^{3/2}+\frac 2x. \]

5.3.1 Standard integrals

For differentiation we had some standard derivatives which are used without explanation. The same is true for integration. A list is given below.

derivative integral
\(\frac{\mathrm{d}}{\,\mathrm{d}x}(x^n)=nx^{n-1}\) \(\displaystyle\int x^n\,\mathrm{d}x = \frac{x^{n+1}}{n+1}+c, n\ne -1\)
\(\frac{\mathrm{d}}{\,\mathrm{d}x}(\ln(x)) = \frac 1x\) \(\displaystyle\int\frac{1}{x}\,\mathrm{d}x = \ln( | x | )+c, x\neq0\)
\(\frac{\mathrm{d}}{\,\mathrm{d}x}(e^x)\,\mathrm{d}x = e^x\) \(\displaystyle\int e^x \,\mathrm{d}x = e^x + c\)
\(\frac{\mathrm{d}}{\,\mathrm{d}x}(e^{kx})\,\mathrm{d}x = ke^{kx}\) \(\displaystyle\int e^{kx} \,\mathrm{d}x = \frac{e^{kx}}{k} + c\)
\(\frac{\mathrm{d}}{\,\mathrm{d}x}(a^x)\,\mathrm{d}x = a^x\ln(a)\) \(\displaystyle\int a^x \,\mathrm{d}x = \frac{a^x}{\ln(a)} + c\)
\(\frac{\mathrm{d}}{\,\mathrm{d}x}(\sin(x))\,\mathrm{d}x=\cos(x)\) \(\displaystyle\int \sin(x)\,\mathrm{d}x=-\cos(x)+c\)
\(\frac{\mathrm{d}}{\,\mathrm{d}x}(\cos(x))\,\mathrm{d}x=-\sin(x)\) \(\displaystyle\int \cos(x)\,\mathrm{d}x=\sin(x)+c\)
\(\frac{\mathrm{d}}{\,\mathrm{d}x}(\tan(x))\,\mathrm{d}x=\sec^2(x)\) \(\displaystyle\int \sec^2(x)\,\mathrm{d}x=\tan(x)+c\)

Example 5.8 Find \(y\), the integral of \(\cos(2x)\).

Solution. Notice that \[ \frac{\mathrm{d}}{\mathrm{d}x}\sin(2x) = 2\cos(2x) \] and so \[ \int\cos(2x)\,\mathrm{d}x = \frac12\sin(2x)+c. \]

This works in general: if \[ \int f(x)\,\mathrm{d}x = g(x) + c\text{ then }\int f(kx)\,\mathrm{d}x = \frac1kg(kx) + c. \]

This works in general: if \[ \int f(x)\,\mathrm{d}x = g(x) + c\text{ then }\int f(kx)\,\mathrm{d}x = \phantom{\frac1kg(kx) + c.} \]

Example 5.9 Find \(y\), the integral of \(2\sin(x) - \sec^2(x)+1/\pi\), with the correct constant, given that the boundary condition is: When \(x = \pi/4, y = 0\).

Solution. \[\begin{align*} y& = \int(2\sin(x) - \sec^2(x)+\frac1{\pi})\,\mathrm{d}x = 2\int \sin(x)\,\mathrm{d}x - \int \sec^2(x)\,\mathrm{d}x + \frac{1}{\pi}\int 1\,\mathrm{d}x\\ &= -2\cos(x)-\tan(x)+\frac{x}{\pi}+C \end{align*}\] Now the boundary condition tells us that when \(x=\pi/4, y = 0\) and so \(0=-2\cos(\pi/4)-\tan(\pi/4)+\pi/(4\pi)+C = -\sqrt{2}-1+1/4+C\). Hence \(C=\sqrt{2}+3/4\) and so \[ y = -2\cos(x)-\tan(x)+\frac{x}{\pi}+\sqrt{2}+\frac34. \]

Example 5.10 Calculate \(\displaystyle\int\sin^2(x)\,\mathrm{d}x\).

Solution. This is not one of our standard integrals so at first sight it would appear we cannot integrate this function (as yet). However, recall that \[ \cos(2x) = \cos^2(x)-\sin^2(x) = 1-2\sin^2(x). \] Hence \[ \sin^2(x) = \frac{1-\cos(2x)}{2}\text{ and so }\int\sin^2(x)\,\mathrm{d}x = \frac12\int(1-\cos(2x))\,\mathrm{d}x \] Now by Example 5.8 we know that \(\displaystyle\int\cos(2x)\,\mathrm{d}x = \frac12\sin(2x)+C\). Hence \[ \int\sin^2(x)\,\mathrm{d}x = \frac12\int(1-\cos(2x))\,\mathrm{d}x = \frac12\left(x-\frac12\sin(2x)\right)+C = \frac{2x-\sin(2x)}{4}+C. \] Note that we can check we are correct by differentiation: \[ \frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{2x-\sin(2x)}{4}\right)=\frac14\left(2-2\cos(2x)\right)=\frac12\left(1-\cos(2x)\right)=\sin^2(x). \]