Mathematical stretching exercises...

  • The chain rule (for functions of many variables)
  • Integration by parts

The chain rule

The chain rule tells you how to take the derivative of a "function of a function". So, let $f(x)$ and $g(x)$ be two functions. The chain rule says... $\frac{d(f(g(x))}{dx} = \frac{df}{dg} \frac{dg}{dx}.$

You can extend that even further. So, for example, we'd like to find the derivative of $f(g(h(x))) = \sin (e^{kx})$, where $f(x)=\sin(x)$ and $g(x)=e^{x}$ and $h(x)=kx$. The chain rule says:

$\frac{d}{dx}\sin(e^{kx}) = \cos(e^{kx}) \frac{d}{dx}e^{kx} = \cos(e^{kx}) e^{kx}\frac{d}{dx}kx$
$\ \ \ =\cos(e^{kx})e^{kx}k.$

The chain rule: function of multiple variables

Now, consider a function $f(x,y)$, where in turn, $x(t)$ and $y(t)$ are functions of a parameter $t$.

Now, the derivative $df/dt$ is calculated like this: $$\frac{df}{dt}=\frac{\del f}{\del x}\frac{dx}{dt} + \frac{\del f}{\del y}\frac{dy}{dt}.$$

Consider $f(x,y)=\sin(xy^2)$, where $x=x(t)$ and $y=y(t)$ are functions of $t$. Use the above to calculate $\frac{d}{dt}f(x(t),y(t))$.

$$\begineq \frac{dz}{dt}&=& \frac{\del z}{\del x} \frac{dx}{dt} + \frac{\del z}{\del y} \frac{dy}{dt}\\ &=& \cos(xy^2)\cdot y^2 \frac{dx}{dt} + \cos(xy^2)\cdot x2y \frac{dy}{dt}\\ &=& y\cos(xy^2)\left[y \frac{dx}{dt} + 2x \frac{dy}{dt}\right]. \endeq$$

Integration by parts

The derivative of the product of two functions $f(x)$ and $g(x)$ is: (Here, for example, $f'(x)\equiv\frac{d}{dx}f(x)$.) $$\frac{d}{dx}[f(x)g(x)] = f'(x)g(x) + f(x)g'(x).$$

Integrating both sides: $$\begineq \int_a^b \frac{d}{dx}[f(x)g(x)] dx &=&\\ [f(x)g(x)]_a^b &=& \int_a^b f'(x)g(x) dx + \int_a^b f(x)g'(x) dx.\endeq$$

Rearranging...

$$\int_a^b f(x)g'(x) dx = \left.f(x)g(x)\right|_{x=a}^b - \int_a^b f'(x)g(x)dx.$$

For example, $$\int \frac{\ln x}{x^2} dx=?$$

With a little imagination, see the integrand as a product of $f(x)=\ln x$ and $g'(x)=1/x^2=x^{-2}$. Then $g(x)=-1/x$, and $f'(x)=1/x$ and the integral can be written as: $$\begineq \int \frac{\ln x }{x^2}dx = \int f(x)g'(x)\,dx &=&f(x)g(x)-\int f'(x)g(x)\,dx\\ &=& -\frac{\ln x }{x}- \int \frac{1}{x}\left(-\frac{1}{x}\right) dx\\ &=& -\frac{\ln x}{x} -\frac{1}{x} + C .\endeq$$

Checking...

Practice

Integrate these two expressions using integration by parts

  1. $\int x\cos x\,dx$

    $$\int x\cos x\,dx=\cos x + x \sin x$$

  2. $\int (2+5x)e^{x/3}\,dx$

    $$\int (2+5x)e^{x/3}\,dx=(15x-39)e^{x/3}$$