# Intro # Multiple Integrals - Notation If we take horizontal slices across the region: $A = \int \int_{R} f(x,y)\, dx \, dy$ Which is the equivalent to: $\int \left[ \int f(x,y) \, dx \right] \, dy $ And if you're feeling up to it, you can write the $dx \ dy$ term at the end as $dA$: $A = \int \int_{R} f(x,y)\, dA$ Make sure to get those inference skills before anything else! Parse the internal integral before anything! If we take vertical slices across the region: $A = \int \int_{R} f(x,y)\, dx \, dy$ The order of these doesn't matter! For volume integrals, we write: $V = \int \int \int_{S} \, dx \, dy \, dz $ Where $S$ refers to the solid we're finding the volume of =). **TIP:** Remember to order the integrals in the way that makes it most convenient for you to solve (i.e put the one with the most variables first.) But everyone's different, so I won't press you for longer. Have fun! >[!Example]- Example Problem >Evaluate: >$\int_{0}^1 \int_{1}^2 (1-y)x^2 \, dx \, dy $ > >**Solution:** >Evaluate the first integral: >$\int_{0}^1 \left[ \frac{x^3}{3} - \frac{yx^3}{3} \right]^2_{1}\, dy $ >$\int _{0}^1 \frac{7}{3} - \frac{7y}{3}\, dy $ >Then solve this integral to get: >$\int _{0}^1 \frac{7}{3} - \frac{7y}{3}\, dy = \left[ \frac{7y}{3} - \frac{7y^2}{6} \right]_{0}^1$ >$\int_{0}^1 \int_{1}^2 (1-y)x^2 \, dx \, dy = \frac{7}{6}$ >Finished! Easy, huh? # Line Integrals *For this one, let's use an example!* Say we got a particle, with a force $F$ acting on it. This force is variable, and is defined using the function $f(x)$. Now, imagine that this particle travels along a curve, defined with the variable $C$ as shown: %%the deets. hehe.%% Now finding that 'distance travelled' isn't so intuitive, huh? As you'd expect, we'll use the [[Calculus Basics (Maths)#BONUS The Length Integral|arclength integral]] to find an expression for that: $ds = \sqrt{ dx^2 + dy^2 }$ We'll sum these small segments over the curve to get our total distance, which gives us: $A = \int_{a}^b f(x,y) \, ds $ We can make this easier for us by realising that: $ds = \sqrt{ (\frac{dx}{dt})^2 + (\frac{dy}{dt}^2)} \ dt$ Where both of the latter terms are partial derivatives! Ultimately, that lets us simplify our expression in terms of $dt$, $x$, and $y$, and both of the latter variables can also be expressed as functions of $t$: $A = \int_{a}^b f(x(t),y(t)) \sqrt{ x'(t)^2 + y'(t)^2 } \, dt $ It is often the case that questions with line integrals have you parametrise the multivariable function with respect to time. In the event that the enclosing path is a circle with radius $r$, these functions will follow the general form: $x(t) = r \cos t$$y(t) = r \sin t$Such as the example I'll now show you! >[!Example]- Example Problem: The Quintessential Cylinder (MecMath) >Prove that the volume of a cylinder is $2 \pi r h$ with a line integral! >![[cylinder.png]] >**Solution:** >We'll be integrating within the bounds of the cylinder, or the height. In the $xy$ plane, the cylinder will appear to be a circle, so the enclosing curve is $f(x,y)$ is $x^2 + y^2 = r^2$, and is bounded from $0$ to $2 \pi$. Therefore: >$x'(t) = -r\sin t$ >$y'(t) = r\cos t$ >That's the plane we'll go through, but we're left with an unknown: the height of the cylinder itself! You can think of it as the circle being 'projected' along this height, which, for example: >$V = \int_{C} f(x,y) \, ds = \int_{0}^{2\pi} \int_{0}^h (r) \, dh \, dt $ >Where we integrate an infinite number of these circles along the height $r$, which is essentially what a volume is! So: >$V = hr \int_{0}^{2\pi} \int (1) \, dt $ >$V = 2\pi rh$ >Nice! And that's a crash course to why you can replace $f(x,y)$ with $h$, even when you take the parametrised versions for the derivatives. I hope that cleared out some confusion for you! ## Applications of the Line Integral: Vector Fields and Polygonal Paths We can also use the line integral to integrate through vector fields, such as that of gravitational potential! Say you have a vector field defined with the arbitrary function: $f(x,y) = P(x,y) \imath + Q(x,y) \jmath$ We can let the position vector to an arbitrary point within this field be represented by: $r(t) = x(t) \imath + y(t) \jmath$ This means that the line integral along a curve within this vector field is: $\int_{C} \, ds = \int P(x,y) \, dx + \int Q(x,y) \, dy$ $\int_{C} \, ds = \int P(x(t),y(t))x'(t) \, dt + \int Q(x(t),y(t))y'(t) \, dt$ Let's take a look at the expression for $r(t)$. Is $r'(t)$ obvious yet? That's right! It's $x'(t) \imath + y'(t) \jmath$. This means that the integral is just the dot product between the position vector $r(t)$ and the function itself, or: $\int_{C} \, ds = \int f \cdot{} \, dr $ Finish. How very nice of it! >[!Example]- Example Problem - Revisiting the Cylinder (MecMath) >Use a line integral to find the lateral surface area of the part of the cylinder $x^2+ y^2$= 4 below the plane $x+2y+ z = 6$ and above the $xy$-plane. >![[IT'S A CYLINDER STUCK IN A PLANE.png]] >**Solution**: >Some among you may have noticed that the line integral approach is needlessly complicated when it comes to finding the volume of the cylinder. Now, time to show why it's really useful! > >From the above equation, we get a radius of $2$ for the cylinder's base. This means: >$\int_{C} f(x,y) \, ds $ >The height is equivalent to the $z$ axis. We can use the plane equation to find an expression for this height, as shown: >$z = 6- x - 2y$ >$z = 6 - 2\cos t - 4\sin t$ >This serves as the upper bound for our integral (as we're finding the volume BELOW the plane!), which is: >$V = \pi \int_{0}^2\pi \int_{0}^{6 - 2\cos t - 4\sin t} \, dz \, dt $ >$V = \pi \int_{0}^2\pi [6 - 2 \cos t - 4 \sin t]\, dt $ >Now all we have to do is plug in the numbers to get: >$V = \pi[6t - 2\sin t + 4\cos t]_{0}^2\pi$ >$V = 12\pi + 4 - 4$ >$V = 12\pi$ >Nice! >That would've been more difficult with the slices, don't you think? ## Negative Line Integrals Now, it's probably obvious to you that: $\int_{C} f(x,y) \, ds = \int_{-C} f(x,y) \, ds $ Where if you traverse a curve in two different directions, the integral of the function along it will still be the same! An integral's a scalar, is it? Wait. But how about when the function's a vector field? If the line integral has a direction, then we'll get: $\int_{C} f(x,y) \, ds = -\int_{-C} f(x,y) \, ds $ Crazy, huh? >[!Success]- Proving the Identity >In a vector field, $x = x(t)$ and $y = y(t)$, as per the $f(x,y) = P(x,y)\imath + Q(x,y) \jmath$ convention for a vector field. In this case, $t$ is the distance across the curve $C$ we travel along to integrate over the vector field. Therefore, when we traverse a curve in the other direction, we're essentially taking the *negative* of the parameter $t$, starting at the point $a + b$, which are the two (invisible!) general form limits of the integral. Therefore, the new parameter for the curve is $a+b - t$, as shown: >$\int_{-C} f(x,y) \, ds = \int_{C} f(x(a+b-t), y(a+b-t)) \, ds $ >$\int_{-C} f(x(a+b-t), y(a+b-t)) \, ds = \int P(x(a+b-t), y(a+b-t)) \, \frac{dx(a+b-t)}{dt} dt + \int Q(x(a+b-t), y(a+b-t)) \, \frac{dy(a+b-t)}{dt} dt$ >A Let's simplify this by calling $a+b-t$ a variable, say, $w$: >$\int_{-C} f(x, y) \, ds = \int P(x(w), y(w)) x'(w) \,dw + \int Q(x(w), y(w)) x'(w) \,dw$ >As $\frac{dw}{dt} = -1$, we can write: >$\int_{-C} f(x, y) \, ds = -\int P(x(w), y(w)) \, dt - \int Q(x(w), y(w)) \,dt $ >Where it becomes obvious (haha, I used it! Tell me if it isn't though.): >$\int_{C} f(x,y) \, ds = -\int_{-C} f(x,y) \, ds$ ## Parametrising Line Integrals In addition, the value of the integral will actually stay the same even with different parametrisations! To prove this, let's take a function $f(x,y)$ with parametrisations in the variable $t$. If we want to take a different parameter, say, the variable $u$, we can define a function $a(u)$, defined as $t = a(u)$, as our parameter. For simplicity's sake, we can reduce this down into the $\hat{x}(u)$ and $\hat{y}(u)$ functions, which we assign the value: $x(t) = \hat{x}(u) = x(a(u))$ Now, we can rewrite our generic integral in terms of $u$ (where I show only the $x$ coordinate, because I'm too lazy): $\int_{a}^b P(x(t), y(t)) x'(t) \, dt = \int_{c}^d P(x(a(u)), y(a(u))) \hat{x}'(u) \, dt $ To find $\hat{x}'(u)$, we can use the chain rule, where: $\hat{x}'u = \frac{dx}{dt} \frac{dt}{du}$ And $\frac{dt}{du}$ can be found by using the function $a$: $\frac{dt}{du} = a'(u)$ So the integral becomes: $\int_{c}^d P(x(a(u)), y(a(u))) \hat{x}'(u) \, du = \int_{c}^d P(x(a(u)), y(a(u))) x'(t) a'(u) \, dt $ If we do some rearranging of the above equations (again!), we can get a value for $dt$, which is $dt = a'(u) \,du$. Therefore, the expression becomes: $\int_{a}^b P(x(t), y(t)) x'(t) \, dt = \int_{c}^d P(x(a(u)), y(a(u))) x'(t) \, du$ Which simplify to the same things (and are therefore equal!!!). ## Closed Curves and Potential Now, let's move on to closed curves - essentially, curves which loop back in, then close on themselves. See: ![[closedcurveoops.png]] *A small sacrifice to learn vector calculus!* That notwithstanding, when we take the line integral over a closed curve, we'll get: $\int_C f(x,y) \, ds = 0$ Or, if $f(x,y)$ is a vector field: $\int \int f(x,y) \cdot dr = 0 $ >[!Success]- Proving this! >![[ellipsepath.png]] >Say we want to find the area under the entire ellipse. Since the curve is closed, the 'limits' are technically at $0, 2\pi$, which offers a result of 0. Easy, huh? > >Alright, alright, I'm NOT going to leave you to dry like that. To perform this line integral, we'll be taking the limits as the points $P1$ and $P2$. To do this, we'll have to take two curves, where if we take the curve $C1$ as our first, which travels over the northern half of the ellipse, we will have to take the negative of the $C2$ curve, which travels from $P1$ to $P2$ through the southern half. We can therefore write this as: > >$0 = \int_{C_{1}} f(x,y) \cdot dr - \int_{C_{2}} \cdot dr $ > >But let's take a moment to think about this. This simple equation means that, for ANY points on this ellipse, no matter how close or far they are, $\int_{C_{1}} f(x,y) \cdot dr = \int_{C_{2}} \cdot dr$! This means you could also reverse this and still get the same answer, meaning that the line integral is also **path-independent.** > >Perfect! Finally, let's move on to something that, in hindsight, will be 'obvious'! No, I'm not joking. Remember how the integral's an anti-derivative? Well... the line integral is actually the 'anti-gradient', in a sense, where we integrate over the two dimensions of a gradient. So if we take the output of the line integral as a function $F$, we can actually rewrite our integral as: $\int_C f(x,y) \cdot dr= \int_{C} \nabla F \cdot dr $ This will mean that, if the limits of the line integral are $a$ and $b$, the integral will evaluate to: $\int_{a}^b f(x,y) \cdot \, dr = F(b) - F(a) $ Which also allows us an easier way of evaluating these integrals in the case that $f(x,y)$ is a vector field, where we can just work backwards! Remember that the dot product between $f(x,y)$ and $dr$ will just give $f(x,y) = P(x,y) \imath \ dx + Q(x,y) \jmath \ dy$, which we can use to find a general expression for the function $F$. Here's an example to help you out! Can you tell what the answer will be if the curve is closed? >[!Tip] Closed Curve Tips >Small tip, but you can actually tell the answer of a line integral just from its parametrisations (usually given!). > >If the curve goes from $0$ to $2\pi$, and is parametrised using the trigonometric functions, this usually refers to it being circular/elliptical in nature and has us take the entire (closed!) curve. So remember - look at the parameters first, and before you get your hopes up, look at the limits next! # Green's Theorem If, however, the closed curve doesn't have a potential and is *smooth* (aka, if you split the big curve into smaller curves, the derivatives of the functions would still be continuous), we can use **Green's Theorem** to find the area enclosed within these lines. This theorem is given by: $\oint f \cdot dr = \int \int \left( \frac{\delta Q}{\delta x} - \frac{\delta P}{\delta y}\right) \, dA $ Assuming that the curve follows the general form $f(x,y) = P(x,y)\, dx + Q(x,y)\, dy$. >[!Success]- Proving Green's Theorem > >First, let's take a look at what the expanded integral is. This'll help us get an idea of what we'll have to do: >$\oint f \cdot dr = \oint P(x,y) \, dx + \oint Q(x,y) \, dy$ > >Let's zero in onto the $P(x,y)$ part for now. If we take some region $R$ and split it into two, taking points $x_1$ and $x_2$, the leftmost and rightmost parts of the curve, as the vertices, we can get the following diagram: > >![[greensshape.png]] > >The curves $C_1$ and $C_2$ will pass through the $y$ coordinates $y_1$ and $y_2$, which are the minimum and maximum $y$ values on the curve respectively (not to scale!). So the total integral $\oint P(x,y) \, dx$ over the curve can be rewritten using the logical conclusion that $C = C_1 + C_2$: > >$\oint P(x,y) \, dx = \int_{C_{1}} P(x,y) \, dx + \int_{C_{2}} P(x,y) \, dx $ > >Now, we can substitute with the limits of each curve! The limit will go from start to finish of the line, so: > >$\oint P(x,y) \, dx = \int_{x_{1}}^{x_{2}} P(x,y) \, dx + \int_{x_{2}}^{x_{1}} P(x,y) \, dx $ > >So the last integral is the complete opposite of the original integral. This gives us: > >$\oint P(x,y) \, dx =- \int_{x_{1}}^{x_{2}} P(x,y_{1}) - P(x,y_{2}) \, dx $ > >Where we can now begin to substitute our values for $y$ into our equation! We can rewrite this internal bit as: > >$\oint P(x,y) \, dx = -\int_{x_{1}}^{x_{2}} [P(x,y)]_{y_{1}}^{y_{2}} \, dx $ > >The inside of which looks suspiciously like an integral, doesn't it? We can 'break' this integral open by partially differentiating the expression with respect to $y$, as shown: >$ -\int_{x_{1}}^{x_{2}} [P(x,y)]_{y_{1}}^{y_{2}} \, dx = -\int_{x_{1}}^{x_{2}} \int_{y_{1}}^{y_{2}} \frac{\delta P}{\delta y} \, dy \, dx$ > >Which is a double integral over an area $A$: > >$ -\int_{x_{1}}^{x_{2}} \int_{y_{1}}^{y_{2}} \frac{\delta P}{\delta y} \, dy \, dx = -\iint \frac{\delta P}{\delta y} \, dA$ > >(And it is about here that I discovered the existence of the \iint command! Oops...) > >So that's the first part of the Green's Theorem! Now, we just have to do the same thing for $Q(x,y) \, dy$, where we take edited versions of the $C_1$ and $C_2$ curves: >$\oint Q(x,y) \, dy = \int_{C_{1}} Q(x,y) \, dy + \int_{C_{2}} Q(x,y) \, dy$ > >Now, for the first curve, notice how the curve from $y_1$ to $y_2$ will pass through the point $x_2$, and how the curve from $y_2$ to $y_1$ passes through the point $x_1$. So, we can write the upper and lower bounds of these curves as shown: > >$\int_{C_{1}} Q(x,y) \, dy + \int_{C_{2}} Q(x,y) \, dy = \int_{y_{2}}^{y_{1}} Q(x_{1},y) \, dy + \int_{y_{1}}^{y_{2}} Q(x_{2},y) \, dy$ > >Ideally, we want $x_2$ to be on the top, which means we'll rewrite our integrals as: >$\int_{y_{2}}^{y_{1}} Q(x_{1},y) \, dy + \int_{y_{1}}^{y_{2}} Q(x_{1},y) \, dy = - \int_{y_{1}}^{y_{2}} Q(x_{1},y) \, dy + \int_{x_{1}}^{x_{2}} Q(x_{2},y) \, dy $ > >$- \int_{y_{1}}^{y_{2}} Q(x_{1},y) \, dy + \int_{y_{1}}^{y_{2}} Q(x_{2},y) \, dy = \int_{y_{1}}^{y_{2}} (Q(x_{2},y) - Q(x_{1},y)) \, dy $ > >$\int_{y_{1}}^{y_{2}} (Q(x_{2},y) - Q(x_{1},y)) \, dy = \int_{y_{1}}^{y_{2}}[ Q(x,y)]_{x_{1}}^{x_{2}}\, dy $ > $\int_{y_{1}}^{y_{2}}[ Q(x,y)]_{x_{1}}^{x_{2}}\, dy = \int_{y_{1}}^{y_{2}} \int \frac{\delta Q}{\delta x} \, dx \, dy$ > Which equals to: > > $ \iint_{R} \frac{\delta Q}{\delta x} \, dA$ > So, going back to the **very** top, using the identity between the total line integral and those of the vector fields, we can rewrite that first expression as: > $\oint f(x,y) \cdot dr = \iint_{R} (\frac{\delta Q}{\delta x} - \frac{\delta P}{\delta y}) dA$ >Finished! One final tip before you go, however - look at the function first, before rushing to apply this formula! > >- If the function has a potential $\nabla F(x,y)$ (i.e the integrals $\int P(x,y) \, dx$ and $\int Q(x,y) \, dy$ have constants that do not contradict each other), **the value of the integral is zero!** Then you can skip all the steps you might've once needed. > We can also use Green's Theorem to find the areas of various shapes! One special shape that's good to consider, however, is the **annulus**, or the "2D Donut", defined by the functions $P(x,y) =-\frac{y}{x^2+y^2}$ and $Q(x,y) =\frac{x}{x^2+y^2}$ ![[annulus.png]] So, if we take the outer R1 curve as travelling counterclockwise, and the inner R2 curve as travelling clockwise, we get: $\oint f(x,y) \cdot dr = 0$ If we run the above expressions through Green's Theorem, then we get: $\frac{\delta Q}{\delta x} = \frac{(x^2+y^2) - (2x^2)}{(x^2+y^2)^2} = \frac{y^2-x^2}{(x^2+y^2)^2}$ $\frac{\delta P}{\delta y} = -\frac{(x^2+y^2) - (2y^2)}{(x^2+y^2)^2} = \frac{y^2-x^2}{(x^2+y^2)^2}$ Which gives us: $\iint_{R} \left( \frac{\delta Q}{\delta x} - \frac{\delta P}{\delta y}\right) \, dA = 0$ So, now we know that this type of curve, where **subregions** exist, follow Green's Theorem! This means we can now find the line integrals over odd shapes, which is VERY useful! >[!Example]- Proving that $\oint f(x,y) \cdot dr = 0$! >Now, we'll first have to repackage this question to make it more digestible. We can assume, that if the annular regions $R_1$ and $R_2$ are circular, that they follow the general equation $x^2 + y^2 = r^2$, where $r^2$ is the radius of each region and is therefore constant. This essentially means that for a circular closed curve, we get a region of: > >$\oint_{C} r \, dx + r \, dy$ >As the parametrisations for $x$ and $y$ are $r \cos t$ and $r \sin t$ respectively. And remember, $dr =\sqrt{ dx^2 + dy^2 }$! For the case when the curve is elliptical, we can replace $r$ with $a$ and $b$, which can refer to either the semi-major or semi-minor axis of the ellipse (see [[Conics - Circles, Parabolas & More! (Maths)#Ellipses|Ellipses]]. From here, it's a simple case of finding the possible 'potential' function of the curve: >$\int r \, dx = rx + c$ >$\int r \, dy = c + ry$ >This means that the constants for each integral give the other function, so the total potential function is: >$F(x,y) = rx + ry$ >As this function exists, $\oint f(x,y) \cdot dr = 0$ for this circular curve! Quick aside - this also means that the curve is **simply joined** - aka, the opposite of a smooth curve. >[!Example]- A Triangular Curve - Example Problem! >Take the line integral of a function $f(x,y) = \oint_{C} (e^{x^2}+y^2) \, dx + (e^{y^2} + x^2) \, dy$, where $C$ is the boundary of the triangle with vertices (0,0), (4,0), and (0,4). > >**SOLUTION:** > >Let's plot the curve before we jump ahead! Remember - don't skip your steps. Believe me, I've been there. >![[righttrianglecurve.png]] >Now, let's plug this equation into Green's Theorem. The $P(x,y)$ and $Q(x,y)$ functions are pretty well-defined, thank god! >$\oint_{C} (e^{x^2}+y^2) \, dx + (e^{y^2} + x^2) \, dy = \iint_{R} (2x - 2y) \, dA$ >If we do the $dy$ integration first, we can go back to the sloping curve, which is $y = -x + 4$. Therefore, the limit of the $y$ integral is $-x + 4$, and the limits of the $x$ coordinate are 0 to 4, as shown: >$\iint_{R} (2x - 2y) \, dA = \int_{0}^4 \int_{0}^{-x+4} (2x-2y) \, dy \, dx$ > >So you get: > >$= \int_{0}^{4} [2xy - y^2]_{0}^{-x+4} \, dx$ > >$= \int_{0}^{4} [2x(-x+4) - (-x+4)^2] \, dx$ > >$= \int_{0}^{4} [-2x^2+8x - (x^2-8x +16)] \, dx$ >$= \int_{0}^{4} -3x^2 + 16x - 16 \, dx $ >$= [-x^3 + 8x^2 - 16x]_{0}^{4} $ >$= -64 + 128 - 64 = 0$ > >Finish! Yes, the answer is 0... just like that of a simply-joined closed curve! =) # The Divergence Theorem # What's Next? You're done with the grunt work! Next up are the operators (next year :/). Donations keep me going! Click this button to donate: Or alternatively, subscribe to my patreon! https://www.patreon.com/c/cheesyminecart/membership