Skip to contentA Practical Guide to Quantitative Finance Interviews
Contents
3.2 Integration
Basics of integration
Again, let’s begin with some basic definitions and equations used in integration.
If we can find a function F(x) with derivative f(x), then we call F(x) an antiderivative of f(x).
If f(x)=F′(x), ∫abf(x)=∫abF′(x)dx=[F(x)]ab=F(b)−F(a)
37dxdF(x)=f(x),F(a)=ya⇒F(x)=ya+∫axf(t)dt
The generalized power rule in reverse:∫ukdu=k+1uk+1+c(k=1), where c is any constant.
Integration by substitution:
∫f(g(x))⋅g′(x)dx=∫f(u)duwith u=g(x),du=g′(x)dx
Substitution in definite integrals:∫abf(g(x))⋅g′(x)dx=∫g(a)g(b)f(u)du
Integration by parts:∫udv=uv−∫vdu
A. What is the integral of ln(x)?
Solution: This is an example of integration by parts. Let u=lnx and v=x, we have d(uv)=vdu+udv=(x×1/x)dx+lnxdx,
∴∫lnxdx=xlnx−∫dx=xlnx−x+c,where c is any constant.
B. What is the integral of sec(x) from x=0 to x=π/6?
Solution: Clearly this problem is directly related to differentiation/integration of trigonometric functions. Although there are derivative functions for all basic trigonometric functions, we only need to remember two of them: dxdsinx=cosx, dxdcosx=−sinx. The rest can be derived using the product rule or the quotient rule. For example,
and ∫0π/6secx=ln(sec(π/6)+tan(π/6))−ln(sec(0)+tan(0))=ln(3)
Applications of integration
A. Suppose that two cylinders each with radius 1 intersect at right angles and their centers also intersect. What is the volume of the intersection?
Solution: This problem is an application of integration to volume calculation. For these applied problems, the most difficult part is to correctly formulate the integration. The general integration function to calculate 3D volume is V=∫z1z2A(z)dz where A(z) is the cross-sectional area of the solid cut by a plane perpendicular to the z-axis at coordinate z. The key here is to find the right expression for cross-sectional area A as a function of z.
Figure 3.1 gives us a clue. If you cut the intersection by a horizontal plane, the cut will be a square with side-length (2r)2−(2z)2. Taking advantage of symmetry, we can calculate the total volume as
An alternative approach requires even better 3D imagination. Let’s imagine a sphere that is inscribed inside both cylinders, so it is inscribed inside the intersection as well. The sphere should have a radius of r/2. At each cut perpendicular to the z-axis, the circle from the sphere is inscribed in the square from the intersection as well. So Acircle=4πAsquare. Since it’s true for all z values, we have
Vsphere=34π(2r)3=4πVintersection⇒Vintersection=16/3r3=16/3.39Figure 3.1 Interaction of two cylinders
B. The snow began to fall some time before noon at a constant rate. The city of Cambridge sent out a snow plow at noon to clear Massachusetts Avenue from MIT to Harvard. The plow removed snow at a constant volume per minute. At 1 pm, it had moved 2 miles and at 2 pm, 3 miles. When did the snow begin to fall?
Solution: Let’s denote noon as time 0 and assume snow began to fall T hours before noon. The speed at which the plow moves is inversely related to the vertical cross-sectional area of the snow: v=c1/A(t), where v is the speed of the plow, c1 is a constant representing the volume of snow that the plow can remove every hour and A(t) is the cross-sectional area of the snow. If t is defined as the time after noon, we also have A(t)=c2(t+T), where c2 is the rate of cross-sectional area increase per hour (since the snow falls at a constant rate). So v=c2(t+T)c1=t+Tc where c=c2c1. Taking the integration, we have
Overall, this question, although fairly straightforward, tests analytical skills, integration knowledge and algebra knowledge.
Expected value using integration
Integration is used extensively to calculate the unconditional or conditional expected value of continuous random variables. In Chapter 4, we will demonstrate its value in probability and statistics. Here we just use one example to show its application:
If X is a standard normal random variable, X∼N(0,1), what is E[X∣X>0]?
Solution: Since X∼N(0,1), the probability density function of x is f(x)=2π1e−1/2x2 and we have E[X∣X>0]=∫0∞xf(x)dx=∫0∞x2π1e−1/2x2dx.
Because d(−1/2x2)=−x and ∫eudy=eu+c, where c is an arbitrary constant, it is obvious that we can use integration by substitution by letting u=−1/2x2. Replace e−1/2x2 with eu and xdx with −du, we have