A Practical Guide to Quantitative Finance Interviews
Contents

3.3 Partial Derivatives and Multiple Integrals

Partial derivative:

w=f(x,y)⇒∂f∂x(x0,y0)=lim⁡Δx→0f(x0+Δx,y0)−f(x0,y0)Δx=fxw=f(x,y)\Rightarrow\frac{\partial f}{\partial x}(x_0,y_0)=\lim_{\Delta x\to0}\frac{f(x_0+\Delta x,y_0)-f(x_0,y_0)}{\Delta x}=f_x

Second order partial derivatives:

∂2f∂x2=∂∂x(∂f∂x),∂2f∂x∂y=∂∂x(∂f∂y)=∂∂y(∂f∂x)\frac{\partial^2f}{\partial x^2}=\frac{\partial}{\partial x}\left(\frac{\partial f}{\partial x}\right),\quad\frac{\partial^2f}{\partial x\partial y}=\frac{\partial}{\partial x}\left(\frac{\partial f}{\partial y}\right)=\frac{\partial}{\partial y}\left(\frac{\partial f}{\partial x}\right)

The general chain rule: Suppose that w=f(x1,x2,⋯ ,xm)w=f(x_1,x_2,\cdots,x_m) and that each of variables x1, x2, ⋯ , xmx_1,\ x_2,\ \cdots,\ x_m is a function of the variables t1, t2, ⋯ , tnt_1,\ t_2,\ \cdots,\ t_n. If all these functions have continuous first-order partial derivatives, then

∂w∂ti=∂w∂x1∂x1∂ti+∂w∂x2∂x2∂ti+⋯+∂w∂xm∂xm∂ti\frac{\partial w}{\partial t_i}=\frac{\partial w}{\partial x_1}\frac{\partial x_1}{\partial t_i}+\frac{\partial w}{\partial x_2}\frac{\partial x_2}{\partial t_i}+\cdots+\frac{\partial w}{\partial x_m}\frac{\partial x_m}{\partial t_i}

for each ii, 1≤i≤n1\le i\le n.

41

Changing Cartesian integrals into polar integrals: The variables in two-dimension plane can be mapped into polar coordinates: x=rcos⁡θx=r\cos\theta, y=rsin⁡θy=r\sin\theta. Tthe integration in a continuous polar region RR is converted to

∬Rf(x,y)dxdy=∬Rf(rcos⁡θ,rsin⁡θ)r dr dθ.\iint_R f(x,y)dxdy=\iint_R f(r\cos\theta,r\sin\theta)r\,dr\,d\theta.

Calculate ∫0∞e−x2/2dx\displaystyle\int_0^\infty e^{-x^2/2}dx.

Solution: Hopefully you happen to remember that the probability density function (pdf) of the standard normal distribution is f(x)=12πe−x2/2\displaystyle f(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2}. By definition, we have

∫−∞∞f(x)dx=∫−∞∞12πe−x2/2dx=2∫0∞12πe−x2/2dx=1⇒∫0∞e−x2/2dx=π2.\int_{-\infty}^{\infty}f(x)dx=\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx=2\int_0^\infty\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx=1\Rightarrow\int_0^\infty e^{-x^2/2}dx=\sqrt{\frac{\pi}{2}}.

If you’ve forgotten the pdf of the standard normal distribution or if you are specifically asked to prove ∫−∞∞12πe−x2/2dx=1\displaystyle\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx=1, you will need to use polar integrals to solve the problem:

∫−∞∞e−x2/2dx∫−∞∞e−y2/2dy=∫−∞∞∫−∞∞e−(x2+y2)/2dxdy=∫0∞∫02πe−(r2cos⁡2θ+r2sin⁡2θ)/2r dr dθ=∫0∞∫02πe−r2/2r dr dθ=−∫0∞e−r2/2d(−r2/2)∫02πdθ=−[e−r2/2]0∞[θ]02π=2π\begin{aligned} \int_{-\infty}^{\infty}e^{-x^2/2}dx\int_{-\infty}^{\infty}e^{-y^2/2}dy &=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(x^2+y^2)/2}dxdy\\ &=\int_0^\infty\int_0^{2\pi}e^{-(r^2\cos^2\theta+r^2\sin^2\theta)/2}r\,dr\,d\theta\\ &=\int_0^\infty\int_0^{2\pi}e^{-r^2/2}r\,dr\,d\theta\\ &=-\int_0^\infty e^{-r^2/2}d(-r^2/2)\int_0^{2\pi}d\theta\\ &=-\left[e^{-r^2/2}\right]_0^\infty[\theta]_0^{2\pi}=2\pi \end{aligned}

Since ∫−∞∞e−x2/2dx=∫−∞∞e−y2/2dy\displaystyle\int_{-\infty}^{\infty}e^{-x^2/2}dx=\int_{-\infty}^{\infty}e^{-y^2/2}dy, we have ∫−∞∞e−x2/2dx=2π⇒∫0∞e−x2/2dx=π2\displaystyle\int_{-\infty}^{\infty}e^{-x^2/2}dx=\sqrt{2\pi}\Rightarrow\int_0^\infty e^{-x^2/2}dx=\sqrt{\frac{\pi}{2}}.