CalculusWithJuliaNotes.jl/quarto/0e7f54ed/integral_vector_calculus/line_integrals.html
2022-08-11 13:15:19 -04:00

3036 lines
210 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.0.32">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Calculus with Julia - 60&nbsp; Line and Surface Integrals</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<script src="../site_libs/quarto-nav/quarto-nav.js"></script>
<script src="../site_libs/quarto-nav/headroom.min.js"></script>
<script src="../site_libs/clipboard/clipboard.min.js"></script>
<script src="../site_libs/quarto-search/autocomplete.umd.js"></script>
<script src="../site_libs/quarto-search/fuse.min.js"></script>
<script src="../site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="../">
<link href="../integral_vector_calculus/div_grad_curl.html" rel="next">
<link href="../integral_vector_calculus/double_triple_integrals.html" rel="prev">
<script src="../site_libs/quarto-html/quarto.js"></script>
<script src="../site_libs/quarto-html/popper.min.js"></script>
<script src="../site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="../site_libs/quarto-html/anchor.min.js"></script>
<link href="../site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="../site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="../site_libs/bootstrap/bootstrap.min.js"></script>
<link href="../site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="../site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script id="quarto-search-options" type="application/json">{
"location": "navbar",
"copy-button": false,
"collapse-after": 3,
"panel-placement": "end",
"type": "overlay",
"limit": 20,
"language": {
"search-no-results-text": "No results",
"search-matching-documents-text": "matching documents",
"search-copy-link-title": "Copy link to search",
"search-hide-matches-text": "Hide additional matches",
"search-more-match-text": "more match in this document",
"search-more-matches-text": "more matches in this document",
"search-clear-button-title": "Clear",
"search-detached-cancel-button-title": "Cancel",
"search-submit-button-title": "Submit"
}
}</script>
<script async="" src="https://hypothes.is/embed.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" integrity="sha512-c3Nl8+7g4LMSTdrm621y7kf9v3SDPnhxLNhcjFJbKECVnmZHTdo+IRO05sNLTH/D3vA6u1X32ehoLC7WFVdheg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script type="application/javascript">define('jquery', [],function() {return window.jQuery;})</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script>
</head>
<body class="nav-sidebar floating nav-fixed">
<div id="quarto-search-results"></div>
<header id="quarto-header" class="headroom fixed-top">
<nav class="navbar navbar-expand-lg navbar-dark ">
<div class="navbar-container container-fluid">
<a class="navbar-brand" href="../index.html">
<img src="../logo.png" alt="">
<span class="navbar-title">Calculus with Julia</span>
</a>
<div id="quarto-search" class="" title="Search"></div>
</div> <!-- /container-fluid -->
</nav>
<nav class="quarto-secondary-nav" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<div class="container-fluid d-flex justify-content-between">
<h1 class="quarto-secondary-nav-title"><span class="chapter-number">60</span>&nbsp; <span class="chapter-title">Line and Surface Integrals</span></h1>
<button type="button" class="quarto-btn-toggle btn" aria-label="Show secondary navigation">
<i class="bi bi-chevron-right"></i>
</button>
</div>
</nav>
</header>
<!-- content -->
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article page-navbar">
<!-- sidebar -->
<nav id="quarto-sidebar" class="sidebar collapse sidebar-navigation floating overflow-auto">
<div class="mt-2 flex-shrink-0 align-items-center">
<div class="sidebar-search">
<div id="quarto-search" class="" title="Search"></div>
</div>
</div>
<div class="sidebar-menu-container">
<ul class="list-unstyled mt-1">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../index.html" class="sidebar-item-text sidebar-link">Preface</a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="false">Precalculus Concepts</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/calculator.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">From calculator to computer</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/variables.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Variables</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/numbers_types.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Number systems</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/logical_expressions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">4</span>&nbsp; <span class="chapter-title">Inequalities, Logical expressions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/vectors.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Vectors</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/ranges.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">6</span>&nbsp; <span class="chapter-title">Ranges and Sets</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">7</span>&nbsp; <span class="chapter-title">Functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/plotting.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">8</span>&nbsp; <span class="chapter-title">The Graph of a Function</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/transformations.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">9</span>&nbsp; <span class="chapter-title">Function manipulations</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/inversefunctions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">10</span>&nbsp; <span class="chapter-title">The Inverse of a Function</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/polynomial.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">11</span>&nbsp; <span class="chapter-title">Polynomials</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/polynomial_roots.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">12</span>&nbsp; <span class="chapter-title">Roots of a polynomial</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/polynomials_package.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">13</span>&nbsp; <span class="chapter-title">The Polynomials package</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/rational_functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">14</span>&nbsp; <span class="chapter-title">Rational functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/exp_log_functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">15</span>&nbsp; <span class="chapter-title">Exponential and logarithmic functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/trig_functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">16</span>&nbsp; <span class="chapter-title">Trigonometric functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/julia_overview.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">17</span>&nbsp; <span class="chapter-title">Overview of Julia commands</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="false">Limits</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../limits/limits.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">18</span>&nbsp; <span class="chapter-title">Limits</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../limits/limits_extensions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">19</span>&nbsp; <span class="chapter-title">Limits, issues, extensions of the concept</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../limits/continuity.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">20</span>&nbsp; <span class="chapter-title">Continuity</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../limits/intermediate_value_theorem.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">21</span>&nbsp; <span class="chapter-title">Implications of continuity</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" aria-expanded="false">Derivatives</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/derivatives.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">22</span>&nbsp; <span class="chapter-title">Derivatives</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/numeric_derivatives.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">23</span>&nbsp; <span class="chapter-title">Numeric derivatives</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/symbolic_derivatives.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">24</span>&nbsp; <span class="chapter-title">Symbolic derivatives</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/mean_value_theorem.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">25</span>&nbsp; <span class="chapter-title">The mean value theorem for differentiable functions.</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/optimization.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">26</span>&nbsp; <span class="chapter-title">Optimization</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/first_second_derivatives.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">27</span>&nbsp; <span class="chapter-title">The first and second derivatives</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/curve_sketching.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">28</span>&nbsp; <span class="chapter-title">Curve Sketching</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/linearization.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">29</span>&nbsp; <span class="chapter-title">Linearization</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/newtons_method.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">30</span>&nbsp; <span class="chapter-title">Newtons method</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/more_zeros.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">31</span>&nbsp; <span class="chapter-title">Derivative-free alternatives to Newtons method</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/lhospitals_rule.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">32</span>&nbsp; <span class="chapter-title">LHospitals Rule</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/implicit_differentiation.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">33</span>&nbsp; <span class="chapter-title">Implicit Differentiation</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/related_rates.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">34</span>&nbsp; <span class="chapter-title">Related rates</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/taylor_series_polynomials.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">35</span>&nbsp; <span class="chapter-title">Taylor Polynomials and other Approximating Polynomials</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="false">Integrals</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-4" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/area.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">36</span>&nbsp; <span class="chapter-title">Area under a curve</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/ftc.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">37</span>&nbsp; <span class="chapter-title">Fundamental Theorem or Calculus</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/substitution.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">38</span>&nbsp; <span class="chapter-title">Substitution</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/integration_by_parts.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">39</span>&nbsp; <span class="chapter-title">Integration By Parts</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/partial_fractions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">40</span>&nbsp; <span class="chapter-title">Partial Fractions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/improper_integrals.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">41</span>&nbsp; <span class="chapter-title">Improper Integrals</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/mean_value_theorem.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">42</span>&nbsp; <span class="chapter-title">Mean value theorem for integrals</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/area_between_curves.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">43</span>&nbsp; <span class="chapter-title">Area between two curves</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/center_of_mass.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">44</span>&nbsp; <span class="chapter-title">Center of Mass</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/volumes_slice.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">45</span>&nbsp; <span class="chapter-title">Volumes by slicing</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/arc_length.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">46</span>&nbsp; <span class="chapter-title">Arc length</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/surface_area.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">47</span>&nbsp; <span class="chapter-title">Surface Area</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" aria-expanded="false">ODEs</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-5" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../ODEs/odes.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">48</span>&nbsp; <span class="chapter-title">ODEs</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../ODEs/euler.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">49</span>&nbsp; <span class="chapter-title">Eulers method</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../ODEs/solve.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">50</span>&nbsp; <span class="chapter-title">The problem-algorithm-solve interface</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../ODEs/differential_equations.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">51</span>&nbsp; <span class="chapter-title">The <code>DifferentialEquations</code> suite</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" aria-expanded="false">Differential vector calculus</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-6" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/polar_coordinates.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">52</span>&nbsp; <span class="chapter-title">Polar Coordinates and Curves</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/vectors.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">53</span>&nbsp; <span class="chapter-title">Vectors and matrices</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/vector_valued_functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">54</span>&nbsp; <span class="chapter-title">Vector-valued functions, <span class="math inline">\(f:R \rightarrow R^n\)</span></span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/scalar_functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">55</span>&nbsp; <span class="chapter-title">Scalar functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/scalar_functions_applications.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">56</span>&nbsp; <span class="chapter-title">Applications with scalar functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/vector_fields.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">57</span>&nbsp; <span class="chapter-title">Functions <span class="math inline">\(R^n \rightarrow R^m\)</span></span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/plots_plotting.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">58</span>&nbsp; <span class="chapter-title">2D and 3D plots in Julia with Plots</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-7" aria-expanded="true">Integral vector calculus</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-7" aria-expanded="true">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-7" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integral_vector_calculus/double_triple_integrals.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">59</span>&nbsp; <span class="chapter-title">Multi-dimensional integrals</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integral_vector_calculus/line_integrals.html" class="sidebar-item-text sidebar-link active"><span class="chapter-number">60</span>&nbsp; <span class="chapter-title">Line and Surface Integrals</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integral_vector_calculus/div_grad_curl.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">61</span>&nbsp; <span class="chapter-title">The Gradient, Divergence, and Curl</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integral_vector_calculus/stokes_theorem.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">62</span>&nbsp; <span class="chapter-title">Greens Theorem, Stokes Theorem, and the Divergence Theorem</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integral_vector_calculus/review.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">63</span>&nbsp; <span class="chapter-title">Quick Review of Vector Calculus</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-8" aria-expanded="false">Alternatives</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-8" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-8" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../alternatives/plotly_plotting.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">64</span>&nbsp; <span class="chapter-title">JavaScript based plotting libraries</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../alternatives/makie_plotting.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">65</span>&nbsp; <span class="chapter-title">Calculus plots with Makie</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-9" aria-expanded="false">Appendices</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-9" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-9" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../misc/getting_started_with_julia.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">66</span>&nbsp; <span class="chapter-title">Getting started with Julia</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../misc/julia_interfaces.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">67</span>&nbsp; <span class="chapter-title">Julia interfaces</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../misc/calculus_with_julia.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">68</span>&nbsp; <span class="chapter-title">The <code>CalculusWithJulia</code> package</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../misc/unicode.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">69</span>&nbsp; <span class="chapter-title">Usages of Unicode symbols</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../misc/quick_notes.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">70</span>&nbsp; <span class="chapter-title">Quick introduction to Calculus with Julia</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../references.html" class="sidebar-item-text sidebar-link">References</a>
</div>
</li>
</ul>
</div>
</nav>
<!-- margin-sidebar -->
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
<nav id="TOC" role="doc-toc">
<h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#line-integrals" id="toc-line-integrals" class="nav-link active" data-scroll-target="#line-integrals"> <span class="header-section-number">60.1</span> Line integrals</a>
<ul class="collapse">
<li><a href="#example" id="toc-example" class="nav-link" data-scroll-target="#example"> <span class="header-section-number">60.1.1</span> Example</a></li>
<li><a href="#line-integrals-and-vector-fields-work-and-flow" id="toc-line-integrals-and-vector-fields-work-and-flow" class="nav-link" data-scroll-target="#line-integrals-and-vector-fields-work-and-flow"> <span class="header-section-number">60.1.2</span> Line integrals and vector fields; work and flow</a></li>
<li><a href="#examples" id="toc-examples" class="nav-link" data-scroll-target="#examples"> <span class="header-section-number">60.1.3</span> Examples</a></li>
<li><a href="#closed-curves-and-regions" id="toc-closed-curves-and-regions" class="nav-link" data-scroll-target="#closed-curves-and-regions"> <span class="header-section-number">60.1.4</span> Closed curves and regions;</a></li>
<li><a href="#the-fundamental-theorem-of-line-integrals" id="toc-the-fundamental-theorem-of-line-integrals" class="nav-link" data-scroll-target="#the-fundamental-theorem-of-line-integrals"> <span class="header-section-number">60.1.5</span> The fundamental theorem of line integrals</a></li>
<li><a href="#flow-across-a-curve" id="toc-flow-across-a-curve" class="nav-link" data-scroll-target="#flow-across-a-curve"> <span class="header-section-number">60.1.6</span> Flow across a curve</a></li>
</ul></li>
<li><a href="#surface-integrals" id="toc-surface-integrals" class="nav-link" data-scroll-target="#surface-integrals"> <span class="header-section-number">60.2</span> Surface integrals</a>
<ul class="collapse">
<li><a href="#examples-1" id="toc-examples-1" class="nav-link" data-scroll-target="#examples-1"> <span class="header-section-number">60.2.1</span> Examples</a></li>
<li><a href="#orientation" id="toc-orientation" class="nav-link" data-scroll-target="#orientation"> <span class="header-section-number">60.2.2</span> Orientation</a></li>
<li><a href="#surface-integrals-in-vector-fields" id="toc-surface-integrals-in-vector-fields" class="nav-link" data-scroll-target="#surface-integrals-in-vector-fields"> <span class="header-section-number">60.2.3</span> Surface integrals in vector fields</a></li>
</ul></li>
<li><a href="#questions" id="toc-questions" class="nav-link" data-scroll-target="#questions"> <span class="header-section-number">60.3</span> Questions</a></li>
</ul>
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/jverzani/CalculusWithJuliaNotes.jl/edit/main/quarto/integral_vector_calculus/line_integrals.qmd" class="toc-action">Edit this page</a></p><p><a href="https://github.com/jverzani/CalculusWithJuliaNotes.jl/issues/new" class="toc-action">Report an issue</a></p></div></div></nav>
</div>
<!-- main -->
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title d-none d-lg-block"><span class="chapter-number">60</span>&nbsp; <span class="chapter-title">Line and Surface Integrals</span></h1>
</div>
<div class="quarto-title-meta">
</div>
</header>
<p>This section uses these add-on packages:</p>
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">CalculusWithJulia</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">Plots</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">QuadGK</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">SymPy</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">HCubature</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<hr>
<p>This section discusses generalizations to the one- and two-dimensional definite integral. These two integrals integrate a function over a one or two dimensional region (e.g., <span class="math inline">\([a,b]\)</span> or <span class="math inline">\([a,b]\times[c,d]\)</span>). The generalization is to change this region to a one-dimensional piece of path in <span class="math inline">\(R^n\)</span> or a two-dimensional surface in <span class="math inline">\(R^3\)</span>.</p>
<p>To fix notation, consider <span class="math inline">\(\int_a^b f(x)dx\)</span> and <span class="math inline">\(\int_a^b\int_c^d g(x,y) dy dx\)</span>. In defining both, a Riemann sum is involved, these involve a partition of <span class="math inline">\([a,b]\)</span> or <span class="math inline">\([a,b]\times[c,d]\)</span> and terms like <span class="math inline">\(f(c_i) \Delta{x_i}\)</span> and <span class="math inline">\(g(c_i, d_j) \Delta{x_i}\Delta{y_j}\)</span>. The <span class="math inline">\(\Delta\)</span>s the diameter of an intervals <span class="math inline">\(I_i\)</span> or <span class="math inline">\(J_j\)</span>. Consider now two parameterizations: <span class="math inline">\(\vec{r}(t)\)</span> for <span class="math inline">\(t\)</span> in <span class="math inline">\([a,b]\)</span> and <span class="math inline">\(\Phi(u,v)\)</span> for <span class="math inline">\((u,v)\)</span> in <span class="math inline">\([a,b]\times[c,d]\)</span>. One is a parameterization of a space curve, <span class="math inline">\(\vec{r}:R\rightarrow R^n\)</span>; the other a parameterization of a surface, <span class="math inline">\(\Phi:R^2 \rightarrow R^3\)</span>. The <em>image</em> of <span class="math inline">\(I_i\)</span> or <span class="math inline">\(I_i\times{J_j}\)</span> under <span class="math inline">\(\vec{r}\)</span> and <span class="math inline">\(\Phi\)</span>, respectively, will look <em>almost</em> linear if the intervals are small enough, so, at least on the microscopic level. A Riemann term can be based around this fact, provided it is understood how much the two parameterizations change the interval <span class="math inline">\(I_i\)</span> or region <span class="math inline">\(I_i\times{J_j}\)</span>.</p>
<p>This chapter will quantify this change, describing it in terms of associated vectors to <span class="math inline">\(\vec{r}\)</span> and <span class="math inline">\(\Phi\)</span>, yielding formulas for an integral of a <em>scalar</em> function along a path or over a surface. Furthermore, these integrals will be generalized to give meaning to physically useful interactions between the path or surface and a vector field.</p>
<section id="line-integrals" class="level2" data-number="60.1">
<h2 data-number="60.1" class="anchored" data-anchor-id="line-integrals"><span class="header-section-number">60.1</span> Line integrals</h2>
<p>In <a href="../integrals/arc-length.html">arc length</a> a formula to give the arc-length of the graph of a univariate function or parameterized curve in <span class="math inline">\(2\)</span> dimensions is given in terms of an integral. The intuitive approximation involved segments of the curve. To review, let <span class="math inline">\(\vec{r}(t)\)</span>, <span class="math inline">\(a \leq t \leq b\)</span>, describe a curve, <span class="math inline">\(C\)</span>, in <span class="math inline">\(R^n\)</span>, <span class="math inline">\(n \geq 2\)</span>. Partition <span class="math inline">\([a,b]\)</span> into <span class="math inline">\(a=t_0 &lt; t_1 &lt; \cdots &lt; t_{n-1} &lt; t_n = b\)</span>.</p>
<p>Consider the path segment connecting <span class="math inline">\(\vec{r}(t_{i-1})\)</span> to <span class="math inline">\(\vec{r}(t_i)\)</span>. If the partition of <span class="math inline">\([a,b]\)</span> is microscopically small, this path will be <em>approximated</em> by <span class="math inline">\(\vec{r}(t_i) - \vec{r}(t_{i-1})\)</span>. This difference in turn is approximately <span class="math inline">\(\vec{r}'(t_i) (t_i - t_{i-1}) = \vec{r}'(t_i) \Delta{t}_i\)</span>, provided <span class="math inline">\(\vec{r}\)</span> is differentiable.</p>
<p>If <span class="math inline">\(f:R^n \rightarrow R\)</span> is a scalar function. Taking right-hand end points, we can consider the Riemann sum <span class="math inline">\(\sum (f\circ\vec{r})(t_i) \|\vec{r}'(t_i)\| \Delta{t}_i\)</span>. For integrable functions, this sum converges to the <em>line integral</em> defined as a one-dimensional integral for a given parameterization:</p>
<p><span class="math display">\[
\int_a^b f(\vec{r}(t)) \| \vec{r}'(t) \| dt.
\]</span></p>
<p>The weight <span class="math inline">\(\| \vec{r}'(t) \|\)</span> can be interpreted by how much the parameterization stretches (or contracts) an interval <span class="math inline">\([t_{i-1},t_i]\)</span> when mapped to its corresponding path segment.</p>
<hr>
<p>The curve <span class="math inline">\(C\)</span> can be parameterized many different ways by introducing a function <span class="math inline">\(s(t)\)</span> to change the time. If we use the arc-length parameterization with <span class="math inline">\(\gamma(0) = a\)</span> and <span class="math inline">\(\gamma(l) = b\)</span>, where <span class="math inline">\(l\)</span> is the arc-length of <span class="math inline">\(C\)</span>, then we have by change of variables <span class="math inline">\(t = \gamma(s)\)</span> that</p>
<p><span class="math display">\[
\int_a^b f(\vec{r}(t)) \| \vec{r}'(t) \| dt =
\int_0^l (f \circ \vec{r} \circ \gamma)(s) \| \frac{d\vec{r}}{dt}\mid_{t = \gamma(s)}\| \gamma'(s) ds.
\]</span></p>
<p>But, by the chain rule:</p>
<p><span class="math display">\[
\frac{d(\vec{r} \circ\gamma)}{du}(s) = \frac{d\vec{r}}{dt}\mid_{t=\gamma(s)} \frac{d\gamma}{du}.
\]</span></p>
<p>Since <span class="math inline">\(\gamma\)</span> is increasing, <span class="math inline">\(\gamma' \geq 0\)</span>, so we get:</p>
<p><span class="math display">\[
\int_a^b f(\vec{r}(t)) \| \vec{r}'(t) \| dt =
\int_0^l (f \circ \vec{r} \circ \gamma)(s) \|\frac{d(\vec{r}\circ\gamma)}{ds}\| ds =
\int_0^l (f \circ \vec{r} \circ \gamma)(s) ds.
\]</span></p>
<p>The last line, as the derivative is the unit tangent vector, <span class="math inline">\(T\)</span>, with norm <span class="math inline">\(1\)</span>.</p>
<p>This shows that the line integral is <em>not</em> dependent on the parameterization. The notation <span class="math inline">\(\int_C f ds\)</span> is used to represent the line integral of a scalar function, the <span class="math inline">\(ds\)</span> emphasizing an implicit parameterization of <span class="math inline">\(C\)</span> by arc-length. When <span class="math inline">\(C\)</span> is a closed curve, the <span class="math inline">\(\oint_C fds\)</span> is used to indicate that.</p>
<section id="example" class="level3" data-number="60.1.1">
<h3 data-number="60.1.1" class="anchored" data-anchor-id="example"><span class="header-section-number">60.1.1</span> Example</h3>
<p>When <span class="math inline">\(f\)</span> is identically <span class="math inline">\(1\)</span>, the line integral returns the arc length. When <span class="math inline">\(f\)</span> varies, then the line integral can be interpreted a few ways. First, if <span class="math inline">\(f \geq 0\)</span> and we consider a sheet hung from the curve <span class="math inline">\(f\circ \vec{r}\)</span> and cut to just touch the ground, the line integral gives the area of this sheet, in the same way an integral gives the area under a positive curve.</p>
<p>If the composition <span class="math inline">\(f \circ \vec{r}\)</span> is viewed as a density of the arc (as though it were constructed out of some non-uniform material), then the line integral can be seen to return the mass of the arc.</p>
<p>Suppose <span class="math inline">\(\rho(x,y,z) = 5 - z\)</span> gives the density of an arc where the arc is parameterized by <span class="math inline">\(\vec{r}(t) = \langle \cos(t), 0, \sin(t) \rangle\)</span>, <span class="math inline">\(0 \leq t \leq \pi\)</span>. (A half-circular arc.) Find the mass of the arc.</p>
<div class="cell" data-execution_count="4">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">rho</span>(x,y,z) <span class="op">=</span> <span class="fl">5</span> <span class="op">-</span> z</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="fu">rho</span>(v) <span class="op">=</span> <span class="fu">rho</span>(v<span class="op">...</span>)</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(t) <span class="op">=</span> [<span class="fu">cos</span>(t), <span class="fl">0</span>, <span class="fu">sin</span>(t)]</span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> t</span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a>rp <span class="op">=</span> <span class="fu">diff</span>.(<span class="fu">r</span>(t),t) <span class="co"># r'</span></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a>area <span class="op">=</span> <span class="fu">integrate</span>((rho <span class="op"></span> r)(t) <span class="op">*</span> <span class="fu">norm</span>(rp), (t, <span class="fl">0</span>, PI))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="5">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
-2 + 5 \pi
\]
</span>
</div>
</div>
<p>Continuing, we could find the center of mass by integrating <span class="math inline">\(\int_C z (f\circ \vec{r}) \|r'\| dt\)</span>:</p>
<div class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>Mz <span class="op">=</span> <span class="fu">integrate</span>(<span class="fu">r</span>(t)[<span class="fl">3</span>] <span class="op">*</span> (rho <span class="op"></span> r)(t) <span class="op">*</span> <span class="fu">norm</span>(rp), (t, <span class="fl">0</span>, PI))</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>Mz</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="6">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
10 - \frac{\pi}{2}
\]
</span>
</div>
</div>
<p>Finally, we get the center of mass by</p>
<div class="cell" data-execution_count="6">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>Mz <span class="op">/</span> area</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="7">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\frac{10 - \frac{\pi}{2}}{-2 + 5 \pi}
\]
</span>
</div>
</div>
<section id="example-1" class="level5">
<h5 class="anchored" data-anchor-id="example-1">Example</h5>
<p>Let <span class="math inline">\(f(x,y,z) = x\sin(y)\cos(z)\)</span> and <span class="math inline">\(C\)</span> the path described by <span class="math inline">\(\vec{r}(t) = \langle t, t^2, t^3\rangle\)</span> for <span class="math inline">\(0 \leq t \leq \pi\)</span>. Find the line integral <span class="math inline">\(\int_C fds\)</span>.</p>
<p>We find the numeric value with:</p>
<div class="cell" data-hold="true" data-execution_count="7">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">f</span>(x,y,z) <span class="op">=</span> <span class="fu">x*sin</span>(y)<span class="fu">*cos</span>(z)</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="fu">f</span>(v) <span class="op">=</span> <span class="fu">f</span>(v<span class="op">...</span>)</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(t) <span class="op">=</span> [t, t<span class="op">^</span><span class="fl">2</span>, t<span class="op">^</span><span class="fl">3</span>]</span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="fu">integrand</span>(t) <span class="op">=</span> (f <span class="op"></span> r)(t) <span class="op">*</span> <span class="fu">norm</span>(r<span class="op">'</span>(t))</span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a><span class="fu">quadgk</span>(integrand, <span class="fl">0</span>, <span class="cn">pi</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="8">
<pre><code>(-1.2230621144956229, 1.783298175794812e-8)</code></pre>
</div>
</div>
</section>
<section id="example-2" class="level5">
<h5 class="anchored" data-anchor-id="example-2">Example</h5>
<p>Imagine the <span class="math inline">\(z\)</span> axis is a wire and in the <span class="math inline">\(x\)</span>-<span class="math inline">\(y\)</span> plane the unit circle is a path. If there is a magnetic field, <span class="math inline">\(B\)</span>, then the field will induce a current to flow along the wire. [Amperes]https://tinyurl.com/y4gl9pgu) circuital law states <span class="math inline">\(\oint_C B\cdot\hat{T} ds = \mu_0 I\)</span>, where <span class="math inline">\(\mu_0\)</span> is a constant and <span class="math inline">\(I\)</span> the current. If the magnetic field is given by <span class="math inline">\(B=(x^2+y^2)^{1/2}\langle -y,x,0\rangle\)</span> compute <span class="math inline">\(I\)</span> in terms of <span class="math inline">\(\mu_0\)</span>.</p>
<p>We have the path is parameterized by <span class="math inline">\(\vec{r}(t) = \langle \cos(t), \sin(t), 0\rangle\)</span>, and so <span class="math inline">\(\hat{T} = \langle -\sin(t), \cos(t), 0\rangle\)</span> and the integrand, <span class="math inline">\(B\cdot\hat{T}\)</span> is</p>
<p><span class="math display">\[
(x^2 + y^2)^{-1/2}\langle -\sin(t), \cos(t), 0\rangle\cdot
\langle -\sin(t), \cos(t), 0\rangle = (x^2 + y^2)(-1/2),
\]</span></p>
<p>which is <span class="math inline">\(1\)</span> on the path <span class="math inline">\(C\)</span>. So <span class="math inline">\(\int_C B\cdot\hat{T} ds = \int_C ds = 2\pi\)</span>. So the current satisfies <span class="math inline">\(2\pi = \mu_0 I\)</span>, so <span class="math inline">\(I = (2\pi)/\mu_0\)</span>.</p>
<p>(Amperes law is more typically used to find <span class="math inline">\(B\)</span> from an current, then <span class="math inline">\(I\)</span> from <span class="math inline">\(B\)</span>, for special circumstances. The Biot-Savart does this more generally.)</p>
</section>
</section>
<section id="line-integrals-and-vector-fields-work-and-flow" class="level3" data-number="60.1.2">
<h3 data-number="60.1.2" class="anchored" data-anchor-id="line-integrals-and-vector-fields-work-and-flow"><span class="header-section-number">60.1.2</span> Line integrals and vector fields; work and flow</h3>
<p>As defined above, the line integral is defined for a scalar function, but this can be generalized. If <span class="math inline">\(F:R^n \rightarrow R^n\)</span> is a vector field, then each component is a scalar function, so the integral <span class="math inline">\(\int (F\circ\vec{r}) \|\vec{r}'\| dt\)</span> can be defined component by component to yield a vector.</p>
<p>However, it proves more interesting to define an integral incorporating how properties of the path interact with the vector field. The key is <span class="math inline">\(\vec{r}'(t) dt = \hat{T} \| \vec{r}'(t)\|dt\)</span> describes both the magnitude of how the parameterization stretches an interval but also a direction the path is taking. This direction allows interaction with the vector field.</p>
<p>The canonical example is <a href="https://en.wikipedia.org/wiki/Work_(physics)">work</a>, which is a measure of a force times a distance. For an object following a path, the work done is still a force times a distance, but only that force in the direction of the motion is considered. (The <em>constraint force</em> keeping the object on the path does no work.) Mathematically, <span class="math inline">\(\hat{T}\)</span> describes the direction of motion along a path, so the work done in moving an object over a small segment of the path is <span class="math inline">\((F\cdot\hat{T}) \Delta{s}\)</span>. Adding up incremental amounts of work leads to a Riemann sum for a line integral involving a vector field.</p>
<blockquote class="blockquote">
<p>The <em>work</em> done in moving an object along a path <span class="math inline">\(C\)</span> by a force field, <span class="math inline">\(F\)</span>, is given by the integral</p>
<p><span class="math display">\[
\int_C (F \cdot \hat{T}) ds = \int_C F\cdot d\vec{r} = \int_a^b ((F\circ\vec{r}) \cdot \frac{d\vec{r}}{dt})(t) dt.
\]</span></p>
</blockquote>
<hr>
<p>In the <span class="math inline">\(n=2\)</span> case, there is another useful interpretation of the line integral. In this dimension the normal vector, <span class="math inline">\(\hat{N}\)</span>, is well defined in terms of the tangent vector, <span class="math inline">\(\hat{T}\)</span>, through a rotation: <span class="math inline">\(\langle a,b\rangle^t = \langle b,-a\rangle^t\)</span>. (The negative, <span class="math inline">\(\langle -b,a\rangle\)</span> is also a candidate, the difference in this choice would lead to a sign difference in in the answer.) This allows the definition of a different line integral, called a flow integral, as detailed later:</p>
<blockquote class="blockquote">
<p>The <em>flow</em> across a curve <span class="math inline">\(C\)</span> is given by</p>
<p><span class="math display">\[
\int_C (F\cdot\hat{N}) ds = \int_a^b (F \circ \vec{r})(t) \cdot (\vec{r}'(t))^t dt.
\]</span></p>
</blockquote>
</section>
<section id="examples" class="level3" data-number="60.1.3">
<h3 data-number="60.1.3" class="anchored" data-anchor-id="examples"><span class="header-section-number">60.1.3</span> Examples</h3>
<section id="example-3" class="level5">
<h5 class="anchored" data-anchor-id="example-3">Example</h5>
<p>Let <span class="math inline">\(F(x,y,z) = \langle x - y, x^2 - y^2, x^2 - z^2 \rangle\)</span> and <span class="math inline">\(\vec{r}(t) = \langle t, t^2, t^3 \rangle\)</span>. Find the work required to move an object along the curve described by <span class="math inline">\(\vec{r}\)</span> between <span class="math inline">\(0\)</span> and <span class="math inline">\(1\)</span>.</p>
<div class="cell" data-hold="true" data-execution_count="8">
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(x,y,z) <span class="op">=</span> [x<span class="op">-</span>y, x<span class="op">^</span><span class="fl">2</span> <span class="op">-</span> y<span class="op">^</span><span class="fl">2</span>, x<span class="op">^</span><span class="fl">2</span> <span class="op">-</span> z<span class="op">^</span><span class="fl">2</span>]</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(v) <span class="op">=</span> <span class="fu">F</span>(v<span class="op">...</span>)</span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(t) <span class="op">=</span> [t, t<span class="op">^</span><span class="fl">2</span>, t<span class="op">^</span><span class="fl">3</span>]</span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> t<span class="op">::</span><span class="dt">real</span></span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a><span class="fu">integrate</span>((F <span class="op"></span> r)(t) <span class="op"></span> <span class="fu">diff</span>.(<span class="fu">r</span>(t), t), (t, <span class="fl">0</span>, <span class="fl">1</span>))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="9">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\frac{3}{5}
\]
</span>
</div>
</div>
</section>
<section id="example-4" class="level5">
<h5 class="anchored" data-anchor-id="example-4">Example</h5>
<p>Let <span class="math inline">\(C\)</span> be a closed curve. For a closed curve, the work integral is also termed the <em>circulation</em>. For the vector field <span class="math inline">\(F(x,y) = \langle -y, x\rangle\)</span> compute the circulation around the triangle with vertices <span class="math inline">\((-1,0)\)</span>, <span class="math inline">\((1,0)\)</span>, and <span class="math inline">\((0,1)\)</span>.</p>
<p>We have three integrals using <span class="math inline">\(\vec{r}_1(t) = \langle -1+2t, 0\rangle\)</span>, <span class="math inline">\(\vec{r}_2(t) = \langle 1-t, t\rangle\)</span> and <span class="math inline">\(\vec{r}_3(t) = \langle -t, 1-t \rangle\)</span>, all from <span class="math inline">\(0\)</span> to <span class="math inline">\(1\)</span>. (Check that the parameterization is counter clockwise.)</p>
<p>The circulation then is:</p>
<div class="cell" data-hold="true" data-execution_count="9">
<div class="sourceCode cell-code" id="cb8"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">r1</span>(t) <span class="op">=</span> [<span class="op">-</span><span class="fl">1</span> <span class="op">+</span> <span class="fl">2</span>t, <span class="fl">0</span>]</span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="fu">r2</span>(t) <span class="op">=</span> [<span class="fl">1</span><span class="op">-</span>t, t]</span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="fu">r3</span>(t) <span class="op">=</span> [<span class="op">-</span>t, <span class="fl">1</span><span class="op">-</span>t]</span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(x,y) <span class="op">=</span> [<span class="op">-</span>y, x]</span>
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(v) <span class="op">=</span> <span class="fu">F</span>(v<span class="op">...</span>)</span>
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a><span class="fu">integrand</span>(r) <span class="op">=</span> t <span class="op">-&gt;</span> (F <span class="op"></span> r)(t) <span class="op"></span> r<span class="op">'</span>(t)</span>
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a>C1 <span class="op">=</span> <span class="fu">quadgk</span>(<span class="fu">integrand</span>(r1), <span class="fl">0</span>, <span class="fl">1</span>)[<span class="fl">1</span>]</span>
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a>C2 <span class="op">=</span> <span class="fu">quadgk</span>(<span class="fu">integrand</span>(r2), <span class="fl">0</span>, <span class="fl">1</span>)[<span class="fl">1</span>]</span>
<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a>C3 <span class="op">=</span> <span class="fu">quadgk</span>(<span class="fu">integrand</span>(r3), <span class="fl">0</span>, <span class="fl">1</span>)[<span class="fl">1</span>]</span>
<span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a>C1 <span class="op">+</span> C2 <span class="op">+</span> C3</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="10">
<pre><code>2.0</code></pre>
</div>
</div>
<p>That this is non-zero reflects a feature of the vector field. In this case, the vector field spirals around the origin, and the circulation is non zero.</p>
</section>
<section id="example-5" class="level5">
<h5 class="anchored" data-anchor-id="example-5">Example</h5>
<p>Let <span class="math inline">\(F\)</span> be the force of gravity exerted by a mass <span class="math inline">\(M\)</span> on a mass <span class="math inline">\(m\)</span> a distance <span class="math inline">\(\vec{r}\)</span> away, that is <span class="math inline">\(F(\vec{r}) = -(GMm/\|\vec{r}\|^2)\hat{r}\)</span>.</p>
<p>Let <span class="math inline">\(\vec{r}(t) = \langle 1-t, 0, t\rangle\)</span>, <span class="math inline">\(0 \leq t \leq 1\)</span>. For concreteness, we take <span class="math inline">\(G M m\)</span> to be <span class="math inline">\(10\)</span>. Then the work to move the mass is given by:</p>
<div class="cell" data-execution_count="10">
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">uvec</span>(v) <span class="op">=</span> v<span class="op">/</span><span class="fu">norm</span>(v) <span class="co"># unit vector</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a>GMm <span class="op">=</span> <span class="fl">10</span></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a><span class="fu">Fₘ</span>(r) <span class="op">=</span> <span class="op">-</span> GMm <span class="op">/</span><span class="fu">norm</span>(r)<span class="op">^</span><span class="fl">2</span> <span class="op">*</span> <span class="fu">uvec</span>(r)</span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a><span class="fu">rₘ</span>(t) <span class="op">=</span> [<span class="fl">1</span><span class="op">-</span>t, <span class="fl">0</span>, t]</span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a><span class="fu">quadgk</span>(t <span class="op">-&gt;</span> (Fₘ <span class="op"></span> rₘ)(t) <span class="op"></span> rₘ<span class="op">'</span>(t), <span class="fl">0</span>, <span class="fl">1</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="11">
<pre><code>(0.0, 0.0)</code></pre>
</div>
</div>
<p>Hmm, a value of <span class="math inline">\(0\)</span>. Thats a bit surprising at first glance. Maybe it had something to do with the specific path chosen. To investigate, we connect the start and endpoints with a circular arc, instead of a straight line:</p>
<div class="cell" data-execution_count="11">
<div class="sourceCode cell-code" id="cb12"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="fu">rₒ</span>(t) <span class="op">=</span> [<span class="fu">cos</span>(t), <span class="fl">0</span>, <span class="fu">sin</span>(t)]</span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="fu">quadgk</span>(t <span class="op">-&gt;</span> (Fₘ <span class="op"></span> rₒ)(t) <span class="op"></span> rₒ<span class="op">'</span>(t), <span class="fl">0</span>, <span class="fl">1</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="12">
<pre><code>(-1.2493163125924272e-17, 2.7429251495998208e-17)</code></pre>
</div>
</div>
<p>Still <span class="math inline">\(0\)</span>. We will see next that this is not surprising if something about <span class="math inline">\(F\)</span> is known.</p>
<div class="callout-note callout callout-style-default callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-caption-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>The <a href="https://www.washingtonpost.com/outlook/everything-you-thought-you-knew-about-gravity-is-wrong/2019/08/01/627f3696-a723-11e9-a3a6-ab670962db05_story.html%22">Washington Post</a> had an article by Richard Panek with the quote “Well, yes — depending on what we mean by attraction. Two bodies of mass dont actually exert some mysterious tugging on each other. Newton himself tried to avoid the word attraction for this very reason. All (!) he was trying to do was find the math to describe the motions both down here on Earth and up there among the planets (of which Earth, thanks to Copernicus and Kepler and Galileo, was one).” The point being the formula above is a mathematical description of the force, but not an explanation of how the force actually is transferred.</p>
</div>
</div>
</section>
<section id="work-in-a-conservative-vector-field" class="level4">
<h4 class="anchored" data-anchor-id="work-in-a-conservative-vector-field">Work in a <em>conservative</em> vector field</h4>
<p>Let <span class="math inline">\(f: R^n \rightarrow R\)</span> be a scalar function. Its gradient, <span class="math inline">\(\nabla f\)</span> is a <em>vector field</em>. For a <em>scalar</em> function, we have by the chain rule:</p>
<p><span class="math display">\[
\frac{d(f \circ \vec{r})}{dt} = \nabla{f}(\vec{r}(t)) \cdot \frac{d\vec{r}}{dt}.
\]</span></p>
<p>If we integrate, we see:</p>
<p><span class="math display">\[
W = \int_a^b \nabla{f}(\vec{r}(t)) \cdot \frac{d\vec{r}}{dt} dt =
\int_a^b \frac{d(f \circ \vec{r})}{dt} dt =
(f\circ\vec{r})\mid_{t = a}^b =
(f\circ\vec{r})(b) - (f\circ\vec{r})(a),
\]</span></p>
<p>using the Fundamental Theorem of Calculus.</p>
<p>The main point above is that <em>if</em> the vector field is the gradient of a scalar field, then the work done depends <em>only</em> on the endpoints of the path and not the path itself.</p>
<blockquote class="blockquote">
<p><strong>Conservative vector field</strong>: If <span class="math inline">\(F\)</span> is a vector field defined in an <em>open</em> region <span class="math inline">\(R\)</span>; <span class="math inline">\(A\)</span> and <span class="math inline">\(B\)</span> are points in <span class="math inline">\(R\)</span> and <em>if</em> for <em>any</em> curve <span class="math inline">\(C\)</span> in <span class="math inline">\(R\)</span> connecting <span class="math inline">\(A\)</span> to <span class="math inline">\(B\)</span>, the line integral of <span class="math inline">\(F \cdot \vec{T}\)</span> over <span class="math inline">\(C\)</span> depends <em>only</em> on the endpoint <span class="math inline">\(A\)</span> and <span class="math inline">\(B\)</span> and not the path, then the line integral is called <em>path indenpendent</em> and the field is called a <em>conservative field</em>.</p>
</blockquote>
<p>The force of gravity is the gradient of a scalar field. As such, the two integrals above which yield <span class="math inline">\(0\)</span> could have been computed more directly. The particular scalar field is <span class="math inline">\(f = -GMm/\|\vec{r}\|\)</span>, which goes by the name the gravitational <em>potential</em> function. As seen, <span class="math inline">\(f\)</span> depends only on magnitude, and as the endpoints of the path in the example have the same distance to the origin, the work integral, <span class="math inline">\((f\circ\vec{r})(b) - (f\circ\vec{r})(a)\)</span> will be <span class="math inline">\(0\)</span>.</p>
<section id="example-6" class="level5">
<h5 class="anchored" data-anchor-id="example-6">Example</h5>
<p>Coulombs law states that the electrostatic force between two charged particles is proportional to the product of their charges and <em>inversely</em> proportional to square of the distance between the two particles. That is,</p>
<p><span class="math display">\[
F = k\frac{ q q_0}{\|\vec{r}\|^2}\frac{\vec{r}}{\|\vec{r}\|}.
\]</span></p>
<p>This is similar to gravitational force and is a <em>conservative force</em>. We saw that a line integral for work in a conservative force depends only on the endpoints. Verify, that for a closed loop the work integral will yield <span class="math inline">\(0\)</span>.</p>
<p>Take as a closed loop the unit circle, parameterized by arc-length by <span class="math inline">\(\vec{r}(t) = \langle \cos(t), \sin(t)\rangle\)</span>. The unit tangent will be <span class="math inline">\(\hat{T} = \vec{r}'(t) = \langle -\sin(t), \cos(t) \rangle\)</span>. The work to move a particle of charge <span class="math inline">\(q_0\)</span> about a partical of charge <span class="math inline">\(q\)</span> at the origin around the unit circle would be computed through:</p>
<div class="cell" data-hold="true" data-execution_count="12">
<div class="sourceCode cell-code" id="cb14"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> k q q0 t</span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(r) <span class="op">=</span> k<span class="op">*</span>q<span class="op">*</span>q0 <span class="op">*</span> r <span class="op">/</span> <span class="fu">norm</span>(r)<span class="op">^</span><span class="fl">3</span></span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(t) <span class="op">=</span> [<span class="fu">cos</span>(t), <span class="fu">sin</span>(t)]</span>
<span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a><span class="fu">T</span>(r) <span class="op">=</span> [<span class="op">-</span>r[<span class="fl">2</span>], r[<span class="fl">1</span>]]</span>
<span id="cb14-5"><a href="#cb14-5" aria-hidden="true" tabindex="-1"></a>W <span class="op">=</span> <span class="fu">integrate</span>(<span class="fu">F</span>(<span class="fu">r</span>(t)) <span class="op"></span> <span class="fu">T</span>(<span class="fu">r</span>(t)), (t, <span class="fl">0</span>, <span class="fl">2</span>PI))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="13">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
0
\]
</span>
</div>
</div>
</section>
</section>
</section>
<section id="closed-curves-and-regions" class="level3" data-number="60.1.4">
<h3 data-number="60.1.4" class="anchored" data-anchor-id="closed-curves-and-regions"><span class="header-section-number">60.1.4</span> Closed curves and regions;</h3>
<p>There are technical assumptions about curves and regions that are necessary for some statements to be made:</p>
<ul>
<li>Let <span class="math inline">\(C\)</span> be a <a href="https://en.wikipedia.org/wiki/Jordan_curve_theorem">Jordan</a> curve - a non-self-intersecting continuous loop in the plane. Such a curve divides the plane into two regions, one bounded and one unbounded. The normal to a Jordan curve is assumed to be in the direction of the unbounded part.</li>
<li>Further, we will assume that our curves are <em>piecewise smooth</em>. That is comprised of finitely many smooth pieces, continuously connected.</li>
<li>The region enclosed by a closed curve has an <em>interior</em>, <span class="math inline">\(D\)</span>, which we assume is an <em>open</em> set (one for which every point in <span class="math inline">\(D\)</span> has some “ball” about it entirely within <span class="math inline">\(D\)</span> as well.)</li>
<li>The region <span class="math inline">\(D\)</span> is <em>connected</em> meaning between any two points there is a continuous path in <span class="math inline">\(D\)</span> between the two points.</li>
<li>The region <span class="math inline">\(D\)</span> is <em>simply connected</em>. This means it has no “holes.” Technically, any path in <span class="math inline">\(D\)</span> can be contracted to a point. Connected means one piece, simply connected means no holes.</li>
</ul>
</section>
<section id="the-fundamental-theorem-of-line-integrals" class="level3" data-number="60.1.5">
<h3 data-number="60.1.5" class="anchored" data-anchor-id="the-fundamental-theorem-of-line-integrals"><span class="header-section-number">60.1.5</span> The fundamental theorem of line integrals</h3>
<p>The fact that work in a potential field is path independent is a consequence of the Fundamental Theorem of Line <a href="https://en.wikipedia.org/wiki/Gradient_theorem">Integrals</a>:</p>
<blockquote class="blockquote">
<p>Let <span class="math inline">\(U\)</span> be an open subset of <span class="math inline">\(R^n\)</span>, <span class="math inline">\(f: U \rightarrow R\)</span> a <em>differentiable</em> function and <span class="math inline">\(\vec{r}: R \rightarrow R^n\)</span> a differentiable function such that the the path <span class="math inline">\(C = \vec{r}(t)\)</span>, <span class="math inline">\(a\leq t\leq b\)</span> is contained in <span class="math inline">\(U\)</span>. Then</p>
<p><span class="math display">\[
\int_C \nabla{f} \cdot d\vec{r} =
\int_a^b \nabla{f}(\vec{r}(t)) \cdot \vec{r}'(t) dt =
f(\vec{r}(b)) - f(\vec{r}(a)).
\]</span></p>
</blockquote>
<p>That is, a line integral through a gradient field can be evaluated by evaluating the original scalar field at the endpoints of the curve. In other words, line integrals through gradient fields are conservative.</p>
<p>Are conservative fields gradient fields? The answer is yes.</p>
<p>Assume <span class="math inline">\(U\)</span> is an open region in <span class="math inline">\(R^n\)</span> and <span class="math inline">\(F\)</span> is a continuous and conservative vector field in <span class="math inline">\(U\)</span>.</p>
<p>Let <span class="math inline">\(a\)</span> in <span class="math inline">\(U\)</span> be some fixed point. For <span class="math inline">\(\vec{x}\)</span> in <span class="math inline">\(U\)</span>, define:</p>
<p><span class="math display">\[
\phi(\vec{x}) = \int_{\vec\gamma[a,\vec{x}]} F \cdot \frac{d\vec\gamma}{dt}dt,
\]</span></p>
<p>where <span class="math inline">\(\vec\gamma\)</span> is <em>any</em> differentiable path in <span class="math inline">\(U\)</span> connecting <span class="math inline">\(a\)</span> to <span class="math inline">\(\vec{x}\)</span> (as a point in <span class="math inline">\(U\)</span>). The function <span class="math inline">\(\phi\)</span> is uniquely defined, as the integral only depends on the endpoints, not the choice of path.</p>
<p>It is <a href="https://en.wikipedia.org/wiki/Gradient_theorem#Converse_of_the_gradient_theorem">shown</a> that the directional derivative <span class="math inline">\(\nabla{\phi} \cdot \vec{v}\)</span> is equal to <span class="math inline">\(F \cdot \vec{v}\)</span> by showing</p>
<p><span class="math display">\[
\lim_{t \rightarrow 0}\frac{\phi(\vec{x} + t\vec{v}) - \phi(\vec{x})}{t}
= \lim_{t \rightarrow 0} \frac{1}{t} \int_{\vec\gamma[\vec{x},\vec{x}+t\vec{v}]} F \cdot \frac{d\vec\gamma}{dt}dt
= F(\vec{x}) \cdot \vec{v}.
\]</span></p>
<p>This is so for all <span class="math inline">\(\vec{v}\)</span>, so in particular for the coordinate vectors. So <span class="math inline">\(\nabla\phi = F\)</span>.</p>
<section id="example-7" class="level5">
<h5 class="anchored" data-anchor-id="example-7">Example</h5>
<p>Let <span class="math inline">\(Radial(x,y) = \langle x, y\rangle\)</span>. This is a conservative field. Show the work integral over the half circle in the upper half plane is the same as the work integral over the <span class="math inline">\(x\)</span> axis connecting <span class="math inline">\(-1\)</span> to <span class="math inline">\(1\)</span>.</p>
<p>We have:</p>
<div class="cell" data-execution_count="13">
<div class="sourceCode cell-code" id="cb15"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="fu">Radial</span>(x,y) <span class="op">=</span> [x,y]</span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="fu">Radial</span>(v) <span class="op">=</span> <span class="fu">Radial</span>(v<span class="op">...</span>)</span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a><span class="fu">r₁</span>(t) <span class="op">=</span> [<span class="op">-</span><span class="fl">1</span> <span class="op">+</span> t, <span class="fl">0</span>]</span>
<span id="cb15-5"><a href="#cb15-5" aria-hidden="true" tabindex="-1"></a><span class="fu">quadgk</span>(t <span class="op">-&gt;</span> <span class="fu">Radial</span>(<span class="fu">r₁</span>(t)) <span class="op"></span> r₁<span class="op">'</span>(t), <span class="fl">0</span>, <span class="fl">2</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="14">
<pre><code>(0.0, 0.0)</code></pre>
</div>
</div>
<p>Compared to</p>
<div class="cell" data-execution_count="14">
<div class="sourceCode cell-code" id="cb17"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="fu">r₂</span>(t) <span class="op">=</span> [<span class="fu">-cos</span>(t), <span class="fu">sin</span>(t)]</span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a><span class="fu">quadgk</span>(t <span class="op">-&gt;</span> <span class="fu">Radial</span>(<span class="fu">r₂</span>(t)) <span class="op"></span> r₂<span class="op">'</span>(t), <span class="fl">0</span>, <span class="cn">pi</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="15">
<pre><code>(0.0, 0.0)</code></pre>
</div>
</div>
</section>
<section id="example-8" class="level5">
<h5 class="anchored" data-anchor-id="example-8">Example</h5>
<hr>
<p>Not all vector fields are conservative. How can a vector field in <span class="math inline">\(U\)</span> be identified as conservative? For now, this would require either finding a scalar potential <em>or</em> showing all line integrals are path independent.</p>
<p>In dimension <span class="math inline">\(2\)</span> there is an easy to check method assuming <span class="math inline">\(U\)</span> is <em>simply connected</em>: If <span class="math inline">\(F=\langle F_x, F_y\rangle\)</span> is continuously differentiable in an simply connected region <em>and</em> <span class="math inline">\(\partial{F_y}/\partial{x} - \partial{F_x}/\partial{y} = 0\)</span> then <span class="math inline">\(F\)</span> is conservative. A similarly statement is available in dimension <span class="math inline">\(3\)</span>. The reasoning behind this will come from the upcoming Greens theorem.</p>
</section>
</section>
<section id="flow-across-a-curve" class="level3" data-number="60.1.6">
<h3 data-number="60.1.6" class="anchored" data-anchor-id="flow-across-a-curve"><span class="header-section-number">60.1.6</span> Flow across a curve</h3>
<p>The flow integral in the <span class="math inline">\(n=2\)</span> case was</p>
<p><span class="math display">\[
\int_C (F\cdot\hat{N}) ds = \int_a^b (F \circ \vec{r})(t) \cdot (\vec{r}'(t))^{t} dt,
\]</span></p>
<p>where <span class="math inline">\(\langle a,b\rangle^t = \langle b, -a\rangle\)</span>.</p>
<p>For a given section of <span class="math inline">\(C\)</span>, the vector field breaks down into a tangential and normal component. The tangential component moves along the curve and so doesnt contribute to any flow <em>across</em> the curve, only the normal component will contribute. Hence the <span class="math inline">\(F\cdot\hat{N}\)</span> integrand. The following figure indicates the flow of a vector field by horizontal lines, the closeness of the lines representing strength, though these are all evenly space. The two line segments have equal length, but the one captures more flow than the other, as its normal vector is more parallel to the flow lines:</p>
<div class="cell" data-hold="true" data-execution_count="15">
<div class="cell-output cell-output-display" data-execution_count="16">
<p><img src="line_integrals_files/figure-html/cell-16-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The flow integral is typically computed for a closed (Jordan) curve, measuring the total flow out of a region. In this case, the integral is written <span class="math inline">\(\oint_C (F\cdot\hat{N})ds\)</span>.</p>
<div class="callout-note callout callout-style-default callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-caption-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>For a Jordan curve, the positive orientation of the curve is such that the normal direction (proportional to <span class="math inline">\(\hat{T}'\)</span>) points away from the bounded interior. For a non-closed path, the choice of parameterization will determine the normal and the integral for flow across a curve is dependent - up to its sign - on this choice.</p>
</div>
</div>
<section id="example-9" class="level5">
<h5 class="anchored" data-anchor-id="example-9">Example</h5>
<p>The <a href="https://www.nytimes.com/interactive/2019/06/20/world/asia/hong-kong-protest-size.html">New York Times</a> showed aerial photos to estimate the number of protest marchers in Hong Kong. This is a more precise way to estimate crowd size, but requires a drone or some such to take photos. If one is on the ground, the number of marchers could be <em>estimated</em> by finding the flow of marchers across a given width. In the Times article, we see “Protestors packed the width of Hennessy Road for more than 5 hours. If this road is 50 meters wide and the rate of the marchers is 3 kilometers per hour, estimate the number of marchers.</p>
<p>The basic idea is to compute the rate of flow <em>across</em> a part of the street and then multiply by time. For computational sake, say the marchers are on a grid of 1 meters (that is in a 40m wide street, there is room for 40 marchers at a time. In one minute, the marchers move 50 meters:</p>
<div class="cell" data-execution_count="16">
<div class="sourceCode cell-code" id="cb19"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="fl">3000</span><span class="op">/</span><span class="fl">60</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="17">
<pre><code>50.0</code></pre>
</div>
</div>
<p>This means the rate of marchers per minute is <code>40 * 50</code>. If this is steady over 5 hours, this <em>simple</em> count gives:</p>
<div class="cell" data-execution_count="17">
<div class="sourceCode cell-code" id="cb21"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="fl">40</span> <span class="op">*</span> <span class="fl">50</span> <span class="op">*</span> <span class="fl">5</span> <span class="op">*</span> <span class="fl">60</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="18">
<pre><code>600000</code></pre>
</div>
</div>
<p>This is short of the estimate 2M marchers, but useful for a rough estimate. The point is from rates of flow, which can be calculated locally, amounts over bigger scales can be computed. The word “<em>across</em>” is used, as only the direction across the part of the street counts in the computation. Were the marchers in total unison and then told to take a step to the left and a step to the right, they would have motion, but since it wasnt across the line in the road (rather along the line) there would be no contribution to the count. The dot product with the normal vector formalizes this.</p>
</section>
<section id="example-10" class="level5">
<h5 class="anchored" data-anchor-id="example-10">Example</h5>
<p>Let a path <span class="math inline">\(C\)</span> be parameterized by <span class="math inline">\(\vec{r}(t) = \langle \cos(t), 2\sin(t)\rangle\)</span>, <span class="math inline">\(0 \leq t \leq \pi/2\)</span> and <span class="math inline">\(F(x,y) = \langle \cos(x), \sin(xy)\rangle\)</span>. Compute the flow across <span class="math inline">\(C\)</span>.</p>
<p>We have</p>
<div class="cell" data-hold="true" data-execution_count="18">
<div class="sourceCode cell-code" id="cb23"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(t) <span class="op">=</span> [<span class="fu">cos</span>(t), <span class="fl">2</span><span class="fu">sin</span>(t)]</span>
<span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(x,y) <span class="op">=</span> [<span class="fu">cos</span>(x), <span class="fu">sin</span>(x<span class="op">*</span>y)]</span>
<span id="cb23-3"><a href="#cb23-3" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(v) <span class="op">=</span> <span class="fu">F</span>(v<span class="op">...</span>)</span>
<span id="cb23-4"><a href="#cb23-4" aria-hidden="true" tabindex="-1"></a><span class="fu">normal</span>(a,b) <span class="op">=</span> [b, <span class="op">-</span>a]</span>
<span id="cb23-5"><a href="#cb23-5" aria-hidden="true" tabindex="-1"></a><span class="fu">G</span>(t) <span class="op">=</span> (F <span class="op"></span> r)(t) <span class="op"></span> <span class="fu">normal</span>(<span class="fu">r</span>(t)<span class="op">...</span>)</span>
<span id="cb23-6"><a href="#cb23-6" aria-hidden="true" tabindex="-1"></a>a, b <span class="op">=</span> <span class="fl">0</span>, <span class="cn">pi</span><span class="op">/</span><span class="fl">2</span></span>
<span id="cb23-7"><a href="#cb23-7" aria-hidden="true" tabindex="-1"></a><span class="fu">quadgk</span>(G, a, b)[<span class="fl">1</span>]</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="19">
<pre><code>1.0894497472261733</code></pre>
</div>
</div>
</section>
<section id="example-11" class="level5">
<h5 class="anchored" data-anchor-id="example-11">Example</h5>
<p>Example, let <span class="math inline">\(F(x,y) = \langle -y, x\rangle\)</span> be a vector field. (It represents an rotational flow.) What is the flow across the unit circle?</p>
<div class="cell" data-hold="true" data-execution_count="19">
<div class="sourceCode cell-code" id="cb25"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> t<span class="op">::</span><span class="dt">real</span></span>
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(x,y) <span class="op">=</span> [<span class="op">-</span>y,x]</span>
<span id="cb25-3"><a href="#cb25-3" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(v) <span class="op">=</span> <span class="fu">F</span>(v<span class="op">...</span>)</span>
<span id="cb25-4"><a href="#cb25-4" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(t) <span class="op">=</span> [<span class="fu">cos</span>(t),<span class="fu">sin</span>(t)]</span>
<span id="cb25-5"><a href="#cb25-5" aria-hidden="true" tabindex="-1"></a><span class="fu">T</span>(t) <span class="op">=</span> <span class="fu">diff</span>.(<span class="fu">r</span>(t), t)</span>
<span id="cb25-6"><a href="#cb25-6" aria-hidden="true" tabindex="-1"></a><span class="fu">normal</span>(a,b) <span class="op">=</span> [b,<span class="op">-</span>a]</span>
<span id="cb25-7"><a href="#cb25-7" aria-hidden="true" tabindex="-1"></a><span class="fu">integrate</span>((F <span class="op"></span> r)(t) <span class="op"></span> <span class="fu">normal</span>(<span class="fu">T</span>(t)<span class="op">...</span>) , (t, <span class="fl">0</span>, <span class="fl">2</span>PI))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="20">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
0
\]
</span>
</div>
</div>
</section>
<section id="example-12" class="level5">
<h5 class="anchored" data-anchor-id="example-12">Example</h5>
<p>Let <span class="math inline">\(F(x,y) = \langle x,y\rangle\)</span> be a vector field. (It represents a <em>source</em>.) What is the flow across the unit circle?</p>
<div class="cell" data-hold="true" data-execution_count="20">
<div class="sourceCode cell-code" id="cb26"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> t<span class="op">::</span><span class="dt">real</span></span>
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(x,y) <span class="op">=</span> [x, y]</span>
<span id="cb26-3"><a href="#cb26-3" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(v) <span class="op">=</span> <span class="fu">F</span>(v<span class="op">...</span>)</span>
<span id="cb26-4"><a href="#cb26-4" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(t) <span class="op">=</span> [<span class="fu">cos</span>(t),<span class="fu">sin</span>(t)]</span>
<span id="cb26-5"><a href="#cb26-5" aria-hidden="true" tabindex="-1"></a><span class="fu">T</span>(t) <span class="op">=</span> <span class="fu">diff</span>.(<span class="fu">r</span>(t), t)</span>
<span id="cb26-6"><a href="#cb26-6" aria-hidden="true" tabindex="-1"></a><span class="fu">normal</span>(a,b) <span class="op">=</span> [b,<span class="op">-</span>a]</span>
<span id="cb26-7"><a href="#cb26-7" aria-hidden="true" tabindex="-1"></a><span class="fu">integrate</span>((F <span class="op"></span> r)(t) <span class="op"></span> <span class="fu">normal</span>(<span class="fu">T</span>(t)<span class="op">...</span>) , (t, <span class="fl">0</span>, <span class="fl">2</span>PI))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="21">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
2 \pi
\]
</span>
</div>
</div>
</section>
<section id="example-13" class="level5">
<h5 class="anchored" data-anchor-id="example-13">Example</h5>
<p>Let <span class="math inline">\(F(x,y) = \langle x, y\rangle / \| \langle x, y\rangle\|^3\)</span>:</p>
<div class="cell" data-execution_count="21">
<div class="sourceCode cell-code" id="cb27"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a><span class="fu">F₁</span>(x,y) <span class="op">=</span> [x,y] <span class="op">/</span> <span class="fu">norm</span>([x,y])<span class="op">^</span><span class="fl">2</span></span>
<span id="cb27-2"><a href="#cb27-2" aria-hidden="true" tabindex="-1"></a><span class="fu">F₁</span>(v) <span class="op">=</span> <span class="fu">F₁</span>(v<span class="op">...</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="22">
<pre><code>F₁ (generic function with 2 methods)</code></pre>
</div>
</div>
<p>Consider <span class="math inline">\(C\)</span> to be the square with vertices at <span class="math inline">\((-1,-1)\)</span>, <span class="math inline">\((1,-1)\)</span>, <span class="math inline">\((1,1)\)</span>, and <span class="math inline">\((-1, 1)\)</span>. What is the flow across <span class="math inline">\(C\)</span> for this vector field? The region has simple outward pointing <em>unit</em> normals, these being <span class="math inline">\(\pm\hat{i}\)</span> and <span class="math inline">\(\pm\hat{j}\)</span>, the unit vectors in the <span class="math inline">\(x\)</span> and <span class="math inline">\(y\)</span> direction. The integral can be computed in 4 parts. The first (along the bottom):</p>
<div class="cell" data-hold="true" data-execution_count="22">
<div class="sourceCode cell-code" id="cb29"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> s<span class="op">::</span><span class="dt">real</span></span>
<span id="cb29-2"><a href="#cb29-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb29-3"><a href="#cb29-3" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(s) <span class="op">=</span> [<span class="op">-</span><span class="fl">1</span> <span class="op">+</span> s, <span class="op">-</span><span class="fl">1</span>]</span>
<span id="cb29-4"><a href="#cb29-4" aria-hidden="true" tabindex="-1"></a>n <span class="op">=</span> [<span class="fl">0</span>,<span class="op">-</span><span class="fl">1</span>]</span>
<span id="cb29-5"><a href="#cb29-5" aria-hidden="true" tabindex="-1"></a>A1 <span class="op">=</span> <span class="fu">integrate</span>(<span class="fu">F₁</span>(<span class="fu">r</span>(s)) <span class="op"></span> n, (s, <span class="fl">0</span>, <span class="fl">2</span>))</span>
<span id="cb29-6"><a href="#cb29-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb29-7"><a href="#cb29-7" aria-hidden="true" tabindex="-1"></a><span class="co">#The other three sides are related as each parameterization and normal is similar:</span></span>
<span id="cb29-8"><a href="#cb29-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb29-9"><a href="#cb29-9" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(s) <span class="op">=</span> [<span class="fl">1</span>, <span class="op">-</span><span class="fl">1</span> <span class="op">+</span> s]</span>
<span id="cb29-10"><a href="#cb29-10" aria-hidden="true" tabindex="-1"></a>n <span class="op">=</span> [<span class="fl">1</span>, <span class="fl">0</span>]</span>
<span id="cb29-11"><a href="#cb29-11" aria-hidden="true" tabindex="-1"></a>A2 <span class="op">=</span> <span class="fu">integrate</span>(<span class="fu">F₁</span>(<span class="fu">r</span>(s)) <span class="op"></span> n, (s, <span class="fl">0</span>, <span class="fl">2</span>))</span>
<span id="cb29-12"><a href="#cb29-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb29-13"><a href="#cb29-13" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb29-14"><a href="#cb29-14" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(s) <span class="op">=</span> [<span class="fl">1</span> <span class="op">-</span> s, <span class="fl">1</span>]</span>
<span id="cb29-15"><a href="#cb29-15" aria-hidden="true" tabindex="-1"></a>n <span class="op">=</span> [<span class="fl">0</span>, <span class="fl">1</span>]</span>
<span id="cb29-16"><a href="#cb29-16" aria-hidden="true" tabindex="-1"></a>A3 <span class="op">=</span> <span class="fu">integrate</span>(<span class="fu">F₁</span>(<span class="fu">r</span>(s)) <span class="op"></span> n, (s, <span class="fl">0</span>, <span class="fl">2</span>))</span>
<span id="cb29-17"><a href="#cb29-17" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb29-18"><a href="#cb29-18" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb29-19"><a href="#cb29-19" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(s) <span class="op">=</span> [<span class="op">-</span><span class="fl">1</span>, <span class="fl">1</span><span class="op">-</span>s]</span>
<span id="cb29-20"><a href="#cb29-20" aria-hidden="true" tabindex="-1"></a>n <span class="op">=</span> [<span class="op">-</span><span class="fl">1</span>, <span class="fl">0</span>]</span>
<span id="cb29-21"><a href="#cb29-21" aria-hidden="true" tabindex="-1"></a>A4 <span class="op">=</span> <span class="fu">integrate</span>(<span class="fu">F₁</span>(<span class="fu">r</span>(s)) <span class="op"></span> n, (s, <span class="fl">0</span>, <span class="fl">2</span>))</span>
<span id="cb29-22"><a href="#cb29-22" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb29-23"><a href="#cb29-23" aria-hidden="true" tabindex="-1"></a>A1 <span class="op">+</span> A2 <span class="op">+</span> A3 <span class="op">+</span> A4</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="23">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
2 \pi
\]
</span>
</div>
</div>
<p>As could have been anticipated by symmetry, the answer is simply <code>4A1</code> or <span class="math inline">\(2\pi\)</span>. What likely is not anticipated, is that this integral will be the same as that found by integrating over the unit circle (an easier integral):</p>
<div class="cell" data-hold="true" data-execution_count="23">
<div class="sourceCode cell-code" id="cb30"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> t<span class="op">::</span><span class="dt">real</span></span>
<span id="cb30-2"><a href="#cb30-2" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(t) <span class="op">=</span> [<span class="fu">cos</span>(t), <span class="fu">sin</span>(t)]</span>
<span id="cb30-3"><a href="#cb30-3" aria-hidden="true" tabindex="-1"></a><span class="fu">N</span>(t) <span class="op">=</span> <span class="fu">r</span>(t)</span>
<span id="cb30-4"><a href="#cb30-4" aria-hidden="true" tabindex="-1"></a><span class="fu">integrate</span>(<span class="fu">F₁</span>(<span class="fu">r</span>(t)) <span class="op"></span> <span class="fu">N</span>(t), (t, <span class="fl">0</span>, <span class="fl">2</span>PI))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="24">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
2 \pi
\]
</span>
</div>
</div>
<p>This equivalence is a consequence of the upcoming Greens theorem, as the vector field satisfies a particular equation.</p>
</section>
</section>
</section>
<section id="surface-integrals" class="level2" data-number="60.2">
<h2 data-number="60.2" class="anchored" data-anchor-id="surface-integrals"><span class="header-section-number">60.2</span> Surface integrals</h2>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../integral_vector_calculus/figures/kapoor-cloud-gate.jpg" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">The Anish Kapoor sculpture Cloud Gate maps the Cartesian grid formed by its concrete resting pad onto a curved surface showing the local distortions. Knowing the areas of the reflected grid after distortion would allow the computation of the surface area of the sculpture through addition. (Wikipedia)</figcaption><p></p>
</figure>
</div>
<p>We next turn attention to a generalization of line integrals to surface integrals. Surfaces were described in one of three ways: directly through a function as <span class="math inline">\(z=f(x,y)\)</span>, as a level curve through <span class="math inline">\(f(x,y,z) = c\)</span>, and parameterized through a function <span class="math inline">\(\Phi: R^2 \rightarrow R^3\)</span>. The level curve description is locally a function description, and the function description leads to a parameterization (<span class="math inline">\(\Phi(u,v) = \langle u,v,f(u,v)\rangle\)</span>) so we restrict to the parameterized case.</p>
<p>Consider the figure of the surface described by <span class="math inline">\(\Phi(u,v) = \langle u,v,f(u,v)\rangle\)</span>:</p>
<div class="cell" data-hold="true" data-execution_count="25">
<div class="cell-output cell-output-display" data-execution_count="26">
<p><img src="line_integrals_files/figure-html/cell-26-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The partitioning of the <span class="math inline">\(u-v\)</span> plane into a grid, lends itself to a partitioning of the surface. To compute the total <em>surface area</em> of the surface, it would be natural to begin by <em>approximating</em> the area of each cell of this partition and add. As with other sums, we would expect that as the cells got smaller in diameter, the sum would approach an integral, in this case an integral yielding the surface area.</p>
<p>Consider a single cell:</p>
<div class="cell" data-hold="true" data-execution_count="27">
<div class="cell-output cell-output-display" data-execution_count="28">
<p><img src="line_integrals_files/figure-html/cell-28-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The figure shows that a cell on the grid in the <span class="math inline">\(u-v\)</span> plane of area <span class="math inline">\(\Delta{u}\Delta{v}\)</span> maps to a cell of the partition with surface area <span class="math inline">\(\Delta{S}\)</span> which can be <em>approximated</em> by a part of the tangent plane described by two vectors <span class="math inline">\(\vec{v}_1 = \partial{\Phi}/\partial{u}\)</span> and <span class="math inline">\(\vec{v}_2 = \partial{\Phi}/\partial{v}\)</span>. These two vectors have cross product which a) points in the direction of the normal vector, and b) has magnitude yielding the approximation <span class="math inline">\(\Delta{S} \approx \|\vec{v}_1 \times \vec{v}_2\|\Delta{u}\Delta{v}\)</span>.</p>
<p>If we were to integrate the function <span class="math inline">\(G(x,y, z)\)</span> over the <em>surface</em> <span class="math inline">\(S\)</span>, then an approximating Riemann sum could be produced by <span class="math inline">\(G(c) \| \vec{v}_1 \times \vec{v}_2\| \Delta u \Delta v\)</span>, for some point <span class="math inline">\(c\)</span> on the surface.</p>
<p>In the limit a definition of an <em>integral</em> over a surface <span class="math inline">\(S\)</span> in <span class="math inline">\(R^3\)</span> is found by a two-dimensional integral over <span class="math inline">\(R\)</span> in <span class="math inline">\(R^2\)</span>:</p>
<p><span class="math display">\[
\int_S G(x,y,z) dS = \int_R G(\Phi(u,v))
\| \frac{\partial{\Phi}}{\partial{u}} \times \frac{\partial{\Phi}}{\partial{v}} \| du dv.
\]</span></p>
<p>In the case that the surface is described by <span class="math inline">\(z = f(x,y)\)</span>, then the formulas become <span class="math inline">\(\vec{v}_1 = \langle 1,0,\partial{f}/\partial{x}\rangle\)</span> and <span class="math inline">\(\vec{v}_2 = \langle 0, 1, \partial{f}/\partial{y}\rangle\)</span> with cross product <span class="math inline">\(\vec{v}_1\times\vec{v}_2 =\langle -\partial{f}/\partial{x}, -\partial{f}/\partial{y},1\rangle\)</span>.</p>
<p>The value <span class="math inline">\(\| \frac{\partial{\Phi}}{\partial{u}} \times \frac{\partial{\Phi}}{\partial{y}} \|\)</span> is called the <em>surface element</em>. As seen, it is the scaling between a unit area in the <span class="math inline">\(u-v\)</span> plane and the approximating area on the surface after the parameterization.</p>
<section id="examples-1" class="level3" data-number="60.2.1">
<h3 data-number="60.2.1" class="anchored" data-anchor-id="examples-1"><span class="header-section-number">60.2.1</span> Examples</h3>
<p>Let us see that the formula holds for some cases where the answer is known by other means.</p>
<section id="a-cone" class="level5">
<h5 class="anchored" data-anchor-id="a-cone">A cone</h5>
<p>The surface area of cone is a known quantity. In cylindrical coordinates, the cone may be described by <span class="math inline">\(z = a - br\)</span>, so the parameterization <span class="math inline">\((r, \theta) \rightarrow \langle r\cos(\theta), r\sin(\theta), a - br \rangle\)</span> maps <span class="math inline">\(T = [0, a/b] \times [0, 2\pi]\)</span> onto the surface (less the bottom).</p>
<p>The surface element is the cross product <span class="math inline">\(\langle \cos(\theta), \sin(\theta), -b\rangle\)</span> and <span class="math inline">\(\langle -r\sin(\theta), r\cos(\theta), 0\rangle\)</span>, which is:</p>
<div class="cell" data-execution_count="28">
<div class="sourceCode cell-code" id="cb31"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> 𝑹<span class="op">::</span><span class="dt">postive </span>θ<span class="op">::</span><span class="dt">positive </span>𝒂<span class="op">::</span><span class="dt">positive </span>𝒃<span class="op">::</span><span class="dt">positive</span></span>
<span id="cb31-2"><a href="#cb31-2" aria-hidden="true" tabindex="-1"></a>𝒏 <span class="op">=</span> [<span class="fu">cos</span>(θ), <span class="fu">sin</span>(θ), <span class="op">-</span>𝒃] <span class="op">×</span> [<span class="fu">-𝑹*sin</span>(θ), <span class="fu">𝑹*cos</span>(θ), <span class="fl">0</span>]</span>
<span id="cb31-3"><a href="#cb31-3" aria-hidden="true" tabindex="-1"></a>𝒔𝒆 <span class="op">=</span> <span class="fu">simplify</span>(<span class="fu">norm</span>(𝒏))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="29">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\sqrt{𝒃^{2} \left|{𝑹 \sin{\left(θ \right)}}\right|^{2} + 𝒃^{2} \left|{𝑹 \cos{\left(θ \right)}}\right|^{2} + \left|{𝑹}\right|^{2}}
\]
</span>
</div>
</div>
<p>(To do this computationally, one might compute:</p>
<div class="cell" data-hold="true" data-execution_count="29">
<div class="sourceCode cell-code" id="cb32"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb32-1"><a href="#cb32-1" aria-hidden="true" tabindex="-1"></a><span class="fu">Phi</span>(r, theta) <span class="op">=</span> [<span class="fu">r*cos</span>(theta), <span class="fu">r*sin</span>(theta), 𝒂 <span class="op">-</span> 𝒃<span class="op">*</span>r]</span>
<span id="cb32-2"><a href="#cb32-2" aria-hidden="true" tabindex="-1"></a><span class="fu">Phi</span>(𝑹, θ).<span class="fu">jacobian</span>([𝑹, θ])</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="30">
<pre><code>3×2 Matrix{Sym}:
cos(θ) -𝑹⋅sin(θ)
sin(θ) 𝑹⋅cos(θ)
-𝒃 0</code></pre>
</div>
</div>
<p>and from here pull out the two vectors to take a cross product.)</p>
<p>The surface area is then found by integrating <span class="math inline">\(G(\vec{x}) = 1\)</span>:</p>
<div class="cell" data-execution_count="30">
<div class="sourceCode cell-code" id="cb34"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a><span class="fu">integrate</span>(<span class="fl">1</span> <span class="op">*</span> 𝒔𝒆, (𝑹, <span class="fl">0</span>, 𝒂<span class="op">/</span>𝒃), (θ, <span class="fl">0</span>, <span class="fl">2</span>PI))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="31">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\frac{\pi 𝒂^{2} \sqrt{𝒃^{2} + 1}}{𝒃^{2}}
\]
</span>
</div>
</div>
<p>A formula from a <em>quick</em> Google search is <span class="math inline">\(A = \pi r(r^2 + \sqrt{h^2 + r^2}\)</span>. Does this match up?</p>
<div class="cell" data-hold="true" data-execution_count="31">
<div class="sourceCode cell-code" id="cb35"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a>𝑹 <span class="op">=</span> 𝒂<span class="op">/</span>𝒃; 𝒉 <span class="op">=</span> 𝒂</span>
<span id="cb35-2"><a href="#cb35-2" aria-hidden="true" tabindex="-1"></a><span class="cn">pi</span> <span class="op">*</span> 𝑹 <span class="op">*</span> (𝑹 <span class="op">+</span> <span class="fu">sqrt</span>(𝑹<span class="op">^</span><span class="fl">2</span> <span class="op">+</span> 𝒉<span class="op">^</span><span class="fl">2</span>)) <span class="op">|&gt;</span> simplify</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="32">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\frac{\pi 𝒂^{2} \left(\sqrt{𝒃^{2} + 1} + 1\right)}{𝒃^{2}}
\]
</span>
</div>
</div>
<p>Nope, off by a summand of <span class="math inline">\(\pi(a/b)^2 = \pi r^2\)</span>, which may be recognized as the area of the base, which we did not compute, but which the Google search did. So yes, the formulas do agree.</p>
</section>
<section id="example-14" class="level5">
<h5 class="anchored" data-anchor-id="example-14">Example</h5>
<p>The sphere has known surface area <span class="math inline">\(4\pi r^2\)</span>. Lets see if we can compute this. With the parameterization from spherical coordinates <span class="math inline">\((\theta, \phi) \rightarrow \langle r\sin\phi\cos\theta, r\sin\phi\sin\theta,r\cos\phi\rangle\)</span>, we have approaching this <em>numerically</em>:</p>
<div class="cell" data-hold="true" data-execution_count="32">
<div class="sourceCode cell-code" id="cb36"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb36-1"><a href="#cb36-1" aria-hidden="true" tabindex="-1"></a>Rad <span class="op">=</span> <span class="fl">1</span></span>
<span id="cb36-2"><a href="#cb36-2" aria-hidden="true" tabindex="-1"></a><span class="fu">Phi</span>(theta, phi) <span class="op">=</span> Rad <span class="op">*</span> [<span class="fu">sin</span>(phi)<span class="fu">*cos</span>(theta), <span class="fu">sin</span>(phi)<span class="fu">*sin</span>(theta), <span class="fu">cos</span>(phi)]</span>
<span id="cb36-3"><a href="#cb36-3" aria-hidden="true" tabindex="-1"></a><span class="fu">Phi</span>(v) <span class="op">=</span> <span class="fu">Phi</span>(v<span class="op">...</span>)</span>
<span id="cb36-4"><a href="#cb36-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb36-5"><a href="#cb36-5" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">surface_element</span>(pt)</span>
<span id="cb36-6"><a href="#cb36-6" aria-hidden="true" tabindex="-1"></a> Jac <span class="op">=</span> ForwardDiff.<span class="fu">jacobian</span>(Phi, pt)</span>
<span id="cb36-7"><a href="#cb36-7" aria-hidden="true" tabindex="-1"></a> v1, v2 <span class="op">=</span> Jac[<span class="op">:</span>,<span class="fl">1</span>], Jac[<span class="op">:</span>,<span class="fl">2</span>]</span>
<span id="cb36-8"><a href="#cb36-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">norm</span>(v1 <span class="op">×</span> v2)</span>
<span id="cb36-9"><a href="#cb36-9" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span>
<span id="cb36-10"><a href="#cb36-10" aria-hidden="true" tabindex="-1"></a>out <span class="op">=</span> <span class="fu">hcubature</span>(surface_element, (<span class="fl">0</span>, <span class="fl">0</span>), (<span class="fl">2</span>pi, <span class="fl">1</span>pi))</span>
<span id="cb36-11"><a href="#cb36-11" aria-hidden="true" tabindex="-1"></a>out[<span class="fl">1</span>] <span class="op">-</span> <span class="fl">4</span>pi<span class="op">*</span>Rad<span class="op">^</span><span class="fl">2</span> <span class="co"># *basically* zero</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="33">
<pre><code>8.15347789284715e-13</code></pre>
</div>
</div>
</section>
<section id="example-15" class="level5">
<h5 class="anchored" data-anchor-id="example-15">Example</h5>
<p>In <a href="../integrals/surface_area.mmd">Surface area</a> the following formula for the surface area of a surface of <em>revolution</em> about the <span class="math inline">\(x\)</span> axis is described by <span class="math inline">\(r=f(x)\)</span> is given:</p>
<p><span class="math display">\[
\int_a^b 2\pi f(x) \cdot \sqrt{1 + f'(x)^2} dx.
\]</span></p>
<p>Consider the transformation <span class="math inline">\((x, \theta) \rightarrow \langle x, f(x)\cos(\theta), f(x)\sin(\theta)\)</span>. This maps the region <span class="math inline">\([a,b] \times [0, 2\pi]\)</span> <em>onto</em> the surface of revolution. As such, the surface element would be:</p>
<div class="cell" data-execution_count="33">
<div class="sourceCode cell-code" id="cb38"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb38-1"><a href="#cb38-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> <span class="fu">𝒇</span>()<span class="op">::</span><span class="dt">positive </span>x<span class="op">::</span><span class="dt">real </span>theta<span class="op">::</span><span class="dt">real</span></span>
<span id="cb38-2"><a href="#cb38-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb38-3"><a href="#cb38-3" aria-hidden="true" tabindex="-1"></a><span class="fu">Phi</span>(x, theta) <span class="op">=</span> [x, <span class="fu">𝒇</span>(x)<span class="fu">*cos</span>(theta), <span class="fu">𝒇</span>(x)<span class="fu">*sin</span>(theta)]</span>
<span id="cb38-4"><a href="#cb38-4" aria-hidden="true" tabindex="-1"></a>Jac <span class="op">=</span> <span class="fu">Phi</span>(x, theta).<span class="fu">jacobian</span>([x, theta])</span>
<span id="cb38-5"><a href="#cb38-5" aria-hidden="true" tabindex="-1"></a>v1, v2 <span class="op">=</span> Jac[<span class="op">:</span>,<span class="fl">1</span>], Jac[<span class="op">:</span>,<span class="fl">2</span>]</span>
<span id="cb38-6"><a href="#cb38-6" aria-hidden="true" tabindex="-1"></a>se <span class="op">=</span> <span class="fu">norm</span>(v1 <span class="op">×</span> v2)</span>
<span id="cb38-7"><a href="#cb38-7" aria-hidden="true" tabindex="-1"></a>se <span class="op">.|&gt;</span> simplify</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="34">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\sqrt{\left|{\frac{d}{d x} 𝒇{\left(x \right)}}\right|^{2} + 1} 𝒇{\left(x \right)}
\]
</span>
</div>
</div>
<p>This in agreement with the previous formula.</p>
</section>
<section id="example-16" class="level5">
<h5 class="anchored" data-anchor-id="example-16">Example</h5>
<p>Consider the <em>upper</em> half sphere, <span class="math inline">\(S\)</span>. Compute <span class="math inline">\(\int_S z dS\)</span>.</p>
<p>Were the half sphere made of a thin uniform material, this would be computed to find the <span class="math inline">\(z\)</span> direction of the centroid.</p>
<p>We use the spherical coordinates to parameterize:</p>
<p><span class="math display">\[
\Phi(\theta, \phi) = \langle \cos(\phi)\cos(\theta), \cos(\phi)\sin(\theta), \sin(\phi) \rangle
\]</span></p>
<p>The Jacobian and surface element are computed and then the integral is performed:</p>
<div class="cell" data-hold="true" data-execution_count="34">
<div class="sourceCode cell-code" id="cb39"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb39-1"><a href="#cb39-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> theta<span class="op">::</span><span class="dt">real </span>phi<span class="op">::</span><span class="dt">real</span></span>
<span id="cb39-2"><a href="#cb39-2" aria-hidden="true" tabindex="-1"></a><span class="fu">Phi</span>(theta, phi) <span class="op">=</span> [<span class="fu">cos</span>(phi)<span class="fu">*cos</span>(theta), <span class="fu">cos</span>(phi)<span class="fu">*sin</span>(theta), <span class="fu">sin</span>(phi)]</span>
<span id="cb39-3"><a href="#cb39-3" aria-hidden="true" tabindex="-1"></a>Jac <span class="op">=</span> <span class="fu">Phi</span>(theta,phi).<span class="fu">jacobian</span>([theta, phi])</span>
<span id="cb39-4"><a href="#cb39-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb39-5"><a href="#cb39-5" aria-hidden="true" tabindex="-1"></a>v1, v2 <span class="op">=</span> Jac[<span class="op">:</span>,<span class="fl">1</span>], Jac[<span class="op">:</span>,<span class="fl">2</span>]</span>
<span id="cb39-6"><a href="#cb39-6" aria-hidden="true" tabindex="-1"></a>SurfElement <span class="op">=</span> <span class="fu">norm</span>(v1 <span class="op">×</span> v2) <span class="op">|&gt;</span> simplify</span>
<span id="cb39-7"><a href="#cb39-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb39-8"><a href="#cb39-8" aria-hidden="true" tabindex="-1"></a>z <span class="op">=</span> <span class="fu">sin</span>(phi)</span>
<span id="cb39-9"><a href="#cb39-9" aria-hidden="true" tabindex="-1"></a><span class="fu">integrate</span>(z <span class="op">*</span> SurfElement, (theta, <span class="fl">0</span>, <span class="fl">2</span>PI), (phi, <span class="fl">0</span>, PI<span class="op">/</span><span class="fl">2</span>))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="35">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\pi
\]
</span>
</div>
</div>
</section>
</section>
<section id="orientation" class="level3" data-number="60.2.2">
<h3 data-number="60.2.2" class="anchored" data-anchor-id="orientation"><span class="header-section-number">60.2.2</span> Orientation</h3>
<p>A smooth surface <span class="math inline">\(S\)</span> is <em>orientable</em> if it possible to define a unit normal vector, <span class="math inline">\(\vec{N}\)</span> that varies continuously with position. For example, a sphere has a normal vector that does this. On the other hand, a Mobius strip does not, as a normal when moved around the surface may necessarily be reversed as it returns to its starting point. For a closed, orientable smooth surface there are two possible choices for a normal, and convention chooses the one that points away from the contained region, such as the outward pointing normal for the sphere or torus.</p>
</section>
<section id="surface-integrals-in-vector-fields" class="level3" data-number="60.2.3">
<h3 data-number="60.2.3" class="anchored" data-anchor-id="surface-integrals-in-vector-fields"><span class="header-section-number">60.2.3</span> Surface integrals in vector fields</h3>
<p>Beyond finding surface area, surface integrals can also compute interesting physical phenomena. These are often associated to a vector field (in this case a function <span class="math inline">\(\vec{F}: R^3 \rightarrow R^3\)</span>), and the typical case is the <em>flux</em> through a surface defined locally by <span class="math inline">\(\vec{F} \cdot \hat{N}\)</span>, that is the <em>magnitude</em> of the <em>projection</em> of the field onto the <em>unit</em> normal vector.</p>
<p>Consider the flow of water through an opening in a time period <span class="math inline">\(\Delta t\)</span>. The amount of water mass to flow through would be the area of the opening times the velocity of the flow perpendicular to the surface times the density times the time period; symbolically: <span class="math inline">\(dS \cdot ((\rho \vec{v}) \cdot \vec{N}) \cdot \Delta t\)</span>. Dividing by <span class="math inline">\(\Delta t\)</span> gives a rate of flow as <span class="math inline">\(((\rho \vec{v}) \cdot \vec{N}) dS\)</span>. With <span class="math inline">\(F = \rho \vec{v}\)</span>, the flux integral can be seen as the rate of flow through a surface.</p>
<p>To find the normal for a surface element arising from a parameterization <span class="math inline">\(\Phi\)</span>, we have the two <em>partial</em> derivatives <span class="math inline">\(\vec{v}_1=\partial{\Phi}/\partial{u}\)</span> and <span class="math inline">\(\vec{v}_2 = \partial{\Phi}/\partial{v}\)</span>, the two column vectors of the Jacobian matrix of <span class="math inline">\(\Phi(u,v)\)</span>. These describe the tangent plane, and even more their cross product will be a) <em>normal</em> to the tangent plane and b) have magnitude yielding the surface element of the transformation.</p>
<p>From this, for a given parameterization, <span class="math inline">\(\Phi(u,v):T \rightarrow S\)</span>, the following formula is suggested for orientable surfaces:</p>
<p><span class="math display">\[
\int_S \vec{F} \cdot \hat{N} dS =
\int_T \vec{F}(\Phi(u,v)) \cdot
(\frac{\partial{\Phi}}{\partial{u}} \times \frac{\partial{\Phi}}{\partial{v}})
du dv.
\]</span></p>
<p>When the surface is described by a function, <span class="math inline">\(z=f(x,y)\)</span>, the parameterization is <span class="math inline">\((u,v) \rightarrow \langle u, v, f(u,v)\rangle\)</span>, and the two vectors are <span class="math inline">\(\vec{v}_1 = \langle 1, 0, \partial{f}/\partial{u}\rangle\)</span> and <span class="math inline">\(\vec{v}_2 = \langle 0, 1, \partial{f}/\partial{v}\rangle\)</span> and their cross product is <span class="math inline">\(\vec{v}_1\times\vec{v}_1=\langle -\partial{f}/\partial{u}, -\partial{f}/\partial{v}, 1\rangle\)</span>.</p>
<section id="example-17" class="level5">
<h5 class="anchored" data-anchor-id="example-17">Example</h5>
<p>Suppose a vector field <span class="math inline">\(F(x,y,z) = \langle 0, y, -z \rangle\)</span> is given. Let <span class="math inline">\(S\)</span> be the surface of the paraboloid <span class="math inline">\(y = x^2 + z^2\)</span> between <span class="math inline">\(y=0\)</span> and <span class="math inline">\(y=4\)</span>. Compute the surface integral <span class="math inline">\(\int_S F\cdot \hat{N} dS\)</span>.</p>
<p>This is a surface of revolution about the <span class="math inline">\(y\)</span> axis, so a parameterization is <span class="math inline">\(\Phi(y,\theta) = \langle \sqrt{y} \cos(\theta), y, \sqrt{y}\sin(\theta) \rangle\)</span>. The surface normal is given by:</p>
<div class="cell" data-hold="true" data-execution_count="35">
<div class="sourceCode cell-code" id="cb40"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb40-1"><a href="#cb40-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> y<span class="op">::</span><span class="dt">positive </span>theta<span class="op">::</span><span class="dt">positive</span></span>
<span id="cb40-2"><a href="#cb40-2" aria-hidden="true" tabindex="-1"></a><span class="fu">Phi</span>(y,theta) <span class="op">=</span> [<span class="fu">sqrt</span>(y)<span class="fu">*cos</span>(theta), y, <span class="fu">sqrt</span>(y)<span class="fu">*sin</span>(theta)]</span>
<span id="cb40-3"><a href="#cb40-3" aria-hidden="true" tabindex="-1"></a>Jac <span class="op">=</span> <span class="fu">Phi</span>(y, theta).<span class="fu">jacobian</span>([y, theta])</span>
<span id="cb40-4"><a href="#cb40-4" aria-hidden="true" tabindex="-1"></a>v1, v2 <span class="op">=</span> Jac[<span class="op">:</span>,<span class="fl">1</span>], Jac[<span class="op">:</span>,<span class="fl">2</span>]</span>
<span id="cb40-5"><a href="#cb40-5" aria-hidden="true" tabindex="-1"></a>Normal <span class="op">=</span> v1 <span class="op">×</span> v2</span>
<span id="cb40-6"><a href="#cb40-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb40-7"><a href="#cb40-7" aria-hidden="true" tabindex="-1"></a><span class="co"># With this, the surface integral becomes:</span></span>
<span id="cb40-8"><a href="#cb40-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb40-9"><a href="#cb40-9" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(x,y,z) <span class="op">=</span> [<span class="fl">0</span>, y, <span class="op">-</span>z]</span>
<span id="cb40-10"><a href="#cb40-10" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(v) <span class="op">=</span> <span class="fu">F</span>(v<span class="op">...</span>)</span>
<span id="cb40-11"><a href="#cb40-11" aria-hidden="true" tabindex="-1"></a><span class="fu">integrate</span>(<span class="fu">F</span>(<span class="fu">Phi</span>(y,theta)) <span class="op"></span> Normal, (theta, <span class="fl">0</span>, <span class="fl">2</span>PI), (y, <span class="fl">0</span>, <span class="fl">4</span>))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="36">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
- 16 \pi
\]
</span>
</div>
</div>
</section>
<section id="example-18" class="level5">
<h5 class="anchored" data-anchor-id="example-18">Example</h5>
<p>Let <span class="math inline">\(S\)</span> be the closed surface bounded by the cylinder <span class="math inline">\(x^2 + y^2 = 1\)</span>, the plane <span class="math inline">\(z=0\)</span>, and the plane <span class="math inline">\(z = 1+x\)</span>. Let <span class="math inline">\(F(x,y,z) = \langle 1, y, -z \rangle\)</span>. Compute <span class="math inline">\(\oint_S F\cdot\vec{N} dS\)</span>.</p>
<div class="cell" data-execution_count="36">
<div class="sourceCode cell-code" id="cb41"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb41-1"><a href="#cb41-1" aria-hidden="true" tabindex="-1"></a><span class="fu">𝐅</span>(x,y,z) <span class="op">=</span> [<span class="fl">1</span>, y, z]</span>
<span id="cb41-2"><a href="#cb41-2" aria-hidden="true" tabindex="-1"></a><span class="fu">𝐅</span>(v) <span class="op">=</span> <span class="fu">𝐅</span>(v<span class="op">...</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="37">
<pre><code>𝐅 (generic function with 2 methods)</code></pre>
</div>
</div>
<p>The surface has three faces, with different outward pointing normals for each. Let <span class="math inline">\(S_1\)</span> be the unit disk in the <span class="math inline">\(x-y\)</span> plane with normal <span class="math inline">\(-\hat{k}\)</span>; <span class="math inline">\(S_2\)</span> be the top part, with normal <span class="math inline">\(\langle \langle-1, 0, 1\rangle\)</span> (as the plane is <span class="math inline">\(-1x + 0y + 1z = 1\)</span>); and <span class="math inline">\(S_3\)</span> be the cylindrical part with outward pointing normal <span class="math inline">\(\vec{r}\)</span>.</p>
<p>Integrating over <span class="math inline">\(S_1\)</span>, we have the parameterization <span class="math inline">\(\Phi(r,\theta) = \langle r\cos(\theta), r\sin(\theta), 0\rangle\)</span>:</p>
<div class="cell" data-execution_count="37">
<div class="sourceCode cell-code" id="cb43"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb43-1"><a href="#cb43-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> 𝐑<span class="op">::</span><span class="dt">positive </span>𝐭heta<span class="op">::</span><span class="dt">positive</span></span>
<span id="cb43-2"><a href="#cb43-2" aria-hidden="true" tabindex="-1"></a><span class="fu">𝐏hi₁</span>(r,theta) <span class="op">=</span> [<span class="fu">r*cos</span>(theta), <span class="fu">r*sin</span>(theta), <span class="fl">0</span>]</span>
<span id="cb43-3"><a href="#cb43-3" aria-hidden="true" tabindex="-1"></a>𝐉ac₁ <span class="op">=</span> <span class="fu">𝐏hi₁</span>(𝐑, 𝐭heta).<span class="fu">jacobian</span>([𝐑, 𝐭heta])</span>
<span id="cb43-4"><a href="#cb43-4" aria-hidden="true" tabindex="-1"></a>𝐯₁, 𝐰₁ <span class="op">=</span> 𝐉ac₁[<span class="op">:</span>,<span class="fl">1</span>], 𝐉ac₁[<span class="op">:</span>,<span class="fl">2</span>]</span>
<span id="cb43-5"><a href="#cb43-5" aria-hidden="true" tabindex="-1"></a>𝐍ormal₁ <span class="op">=</span> 𝐯₁ <span class="op">×</span> 𝐰₁ <span class="op">.|&gt;</span> simplify</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="38">
<pre><code>3-element Vector{Sym}:
0
0
𝐑</code></pre>
</div>
</div>
<div class="cell" data-execution_count="38">
<div class="sourceCode cell-code" id="cb45"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb45-1"><a href="#cb45-1" aria-hidden="true" tabindex="-1"></a>A₁ <span class="op">=</span> <span class="fu">integrate</span>(<span class="fu">𝐅</span>(<span class="fu">𝐏hi₁</span>(𝐑, 𝐭heta)) <span class="op"></span> (<span class="op">-</span>𝐍ormal₁), (𝐭heta, <span class="fl">0</span>, <span class="fl">2</span>PI), (𝐑, <span class="fl">0</span>, <span class="fl">1</span>)) <span class="co"># use -Normal for outward pointing</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="39">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
0
\]
</span>
</div>
</div>
<p>Integrating over <span class="math inline">\(S_2\)</span> we use the parameterization <span class="math inline">\(\Phi(r, \theta) = \langle r\cos(\theta), r\sin(\theta), 1 + r\cos(\theta)\rangle\)</span>.</p>
<div class="cell" data-execution_count="39">
<div class="sourceCode cell-code" id="cb46"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a><span class="fu">𝐏hi₂</span>(r, theta) <span class="op">=</span> [<span class="fu">r*cos</span>(theta), <span class="fu">r*sin</span>(theta), <span class="fl">1</span> <span class="op">+</span> <span class="fu">r*cos</span>(theta)]</span>
<span id="cb46-2"><a href="#cb46-2" aria-hidden="true" tabindex="-1"></a>𝐉ac₂ <span class="op">=</span> <span class="fu">𝐏hi₂</span>(𝐑, 𝐭heta).<span class="fu">jacobian</span>([𝐑, 𝐭heta])</span>
<span id="cb46-3"><a href="#cb46-3" aria-hidden="true" tabindex="-1"></a>𝐯₂, 𝐰₂ <span class="op">=</span> 𝐉ac₂[<span class="op">:</span>,<span class="fl">1</span>], 𝐉ac₂[<span class="op">:</span>,<span class="fl">2</span>]</span>
<span id="cb46-4"><a href="#cb46-4" aria-hidden="true" tabindex="-1"></a>𝐍ormal₂ <span class="op">=</span> 𝐯₂ <span class="op">×</span> 𝐰₂ <span class="op">.|&gt;</span> simplify <span class="co"># has correct orientation</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="40">
<pre><code>3-element Vector{Sym}:
-𝐑
0
𝐑</code></pre>
</div>
</div>
<p>With this, the contribution for <span class="math inline">\(S_2\)</span> is:</p>
<div class="cell" data-execution_count="40">
<div class="sourceCode cell-code" id="cb48"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb48-1"><a href="#cb48-1" aria-hidden="true" tabindex="-1"></a>A₂ <span class="op">=</span> <span class="fu">integrate</span>(<span class="fu">𝐅</span>(<span class="fu">𝐏hi₂</span>(𝐑, 𝐭heta)) <span class="op"></span> (𝐍ormal₂), (𝐭heta, <span class="fl">0</span>, <span class="fl">2</span>PI), (𝐑, <span class="fl">0</span>, <span class="fl">1</span>))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="41">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
0
\]
</span>
</div>
</div>
<p>Finally for <span class="math inline">\(S_3\)</span>, the parameterization used is <span class="math inline">\(\Phi(z, \theta) = \langle \cos(\theta), \sin(\theta), z\rangle\)</span>, but this is over a non-rectangular region, as <span class="math inline">\(z\)</span> is between <span class="math inline">\(0\)</span> and <span class="math inline">\(1 + x\)</span>.</p>
<p>This parameterization gives a normal computed through:</p>
<div class="cell" data-execution_count="41">
<div class="sourceCode cell-code" id="cb49"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb49-1"><a href="#cb49-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> 𝐳<span class="op">::</span><span class="dt">positive</span></span>
<span id="cb49-2"><a href="#cb49-2" aria-hidden="true" tabindex="-1"></a><span class="fu">𝐏hi₃</span>(z, theta) <span class="op">=</span> [<span class="fu">cos</span>(theta), <span class="fu">sin</span>(theta), 𝐳]</span>
<span id="cb49-3"><a href="#cb49-3" aria-hidden="true" tabindex="-1"></a>𝐉ac₃ <span class="op">=</span> <span class="fu">𝐏hi₃</span>(𝐳, 𝐭heta).<span class="fu">jacobian</span>([𝐳, 𝐭heta])</span>
<span id="cb49-4"><a href="#cb49-4" aria-hidden="true" tabindex="-1"></a>𝐯₃, 𝐰₃ <span class="op">=</span> 𝐉ac₃[<span class="op">:</span>,<span class="fl">1</span>], 𝐉ac₃[<span class="op">:</span>,<span class="fl">2</span>]</span>
<span id="cb49-5"><a href="#cb49-5" aria-hidden="true" tabindex="-1"></a>𝐍ormal₃ <span class="op">=</span> 𝐯₃ <span class="op">×</span> 𝐰₃ <span class="op">.|&gt;</span> simplify <span class="co"># wrong orientation, so we change sign below</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="42">
<pre><code>3-element Vector{Sym}:
-cos(𝐭heta)
-sin(𝐭heta)
0</code></pre>
</div>
</div>
<p>The contribution is</p>
<div class="cell" data-execution_count="42">
<div class="sourceCode cell-code" id="cb51"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb51-1"><a href="#cb51-1" aria-hidden="true" tabindex="-1"></a>A₃ <span class="op">=</span> <span class="fu">integrate</span>(<span class="fu">𝐅</span>(<span class="fu">𝐏hi₃</span>(𝐑, 𝐭heta)) <span class="op"></span> (<span class="op">-</span>𝐍ormal₃), (𝐳, <span class="fl">0</span>, <span class="fl">1</span> <span class="op">+</span> <span class="fu">cos</span>(𝐭heta)), (𝐭heta, <span class="fl">0</span>, <span class="fl">2</span>PI))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="43">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
2 \pi
\]
</span>
</div>
</div>
<p>In total, the surface integral is</p>
<div class="cell" data-execution_count="43">
<div class="sourceCode cell-code" id="cb52"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb52-1"><a href="#cb52-1" aria-hidden="true" tabindex="-1"></a>A₁ <span class="op">+</span> A₂ <span class="op">+</span> A₃</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="44">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
2 \pi
\]
</span>
</div>
</div>
</section>
<section id="example-19" class="level5">
<h5 class="anchored" data-anchor-id="example-19">Example</h5>
<p>Two point charges with charges <span class="math inline">\(q\)</span> and <span class="math inline">\(q_0\)</span> will exert an electrostatic force of attraction or repulsion according to <a href="https://en.wikipedia.org/wiki/Coulomb%27s_law">Coulomb</a>s law. The Coulomb force is <span class="math inline">\(kqq_0\vec{r}/\|\vec{r}\|^3\)</span>. This force is proportional to the product of the charges, <span class="math inline">\(qq_0\)</span>, and inversely proportional to the square of the distance between them.</p>
<p>The electric field is a vector field is the field generated by the force on a test charge, and is given by <span class="math inline">\(E = kq\vec{r}/\|\vec{r}\|^3\)</span>.</p>
<p>Let <span class="math inline">\(S\)</span> be the unit sphere <span class="math inline">\(\|\vec{r}\|^2 = 1\)</span>. Compute the surface integral of the electric field over the closed surface, <span class="math inline">\(S\)</span>.</p>
<p>We have (using <span class="math inline">\(\oint\)</span> for a surface integral over a closed surface):</p>
<p><span class="math display">\[
\oint_S S \cdot \vec{N} dS =
\oint_S \frac{kq}{\|\vec{r}\|^2} \hat{r} \cdot \hat{r} dS =
\oint_S \frac{kq}{\|\vec{r}\|^2} dS =
kqq_0 \cdot SA(S) =
4\pi k q
\]</span></p>
<p>Now consider the electric field generated by a point charge within the unit sphere, but not at the origin. The integral now will not fall in place by symmetry considerations, so we will approach the problem numerically.</p>
<div class="cell" data-execution_count="44">
<div class="sourceCode cell-code" id="cb53"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb53-1"><a href="#cb53-1" aria-hidden="true" tabindex="-1"></a><span class="fu">E</span>(r) <span class="op">=</span> (<span class="fl">1</span><span class="op">/</span><span class="fu">norm</span>(r)<span class="op">^</span><span class="fl">2</span>) <span class="op">*</span> <span class="fu">uvec</span>(r) <span class="co"># kq = 1</span></span>
<span id="cb53-2"><a href="#cb53-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb53-3"><a href="#cb53-3" aria-hidden="true" tabindex="-1"></a><span class="fu">Phiₑ</span>(theta, phi) <span class="op">=</span> <span class="fl">1</span><span class="op">*</span>[<span class="fu">sin</span>(phi)<span class="fu">*cos</span>(theta), <span class="fu">sin</span>(phi) <span class="op">*</span> <span class="fu">sin</span>(theta), <span class="fu">cos</span>(phi)]</span>
<span id="cb53-4"><a href="#cb53-4" aria-hidden="true" tabindex="-1"></a><span class="fu">Phiₑ</span>(r) <span class="op">=</span> <span class="fu">Phiₑ</span>(r<span class="op">...</span>)</span>
<span id="cb53-5"><a href="#cb53-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb53-6"><a href="#cb53-6" aria-hidden="true" tabindex="-1"></a><span class="fu">normal</span>(r) <span class="op">=</span> <span class="fu">Phiₑ</span>(r)<span class="op">/</span><span class="fu">norm</span>(<span class="fu">Phiₑ</span>(r))</span>
<span id="cb53-7"><a href="#cb53-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb53-8"><a href="#cb53-8" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">SE</span>(r)</span>
<span id="cb53-9"><a href="#cb53-9" aria-hidden="true" tabindex="-1"></a> Jac <span class="op">=</span> ForwardDiff.<span class="fu">jacobian</span>(Phiₑ, r)</span>
<span id="cb53-10"><a href="#cb53-10" aria-hidden="true" tabindex="-1"></a> v1, v2 <span class="op">=</span> Jac[<span class="op">:</span>,<span class="fl">1</span>], Jac[<span class="op">:</span>,<span class="fl">2</span>]</span>
<span id="cb53-11"><a href="#cb53-11" aria-hidden="true" tabindex="-1"></a> v1 <span class="op">×</span> v2</span>
<span id="cb53-12"><a href="#cb53-12" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span>
<span id="cb53-13"><a href="#cb53-13" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb53-14"><a href="#cb53-14" aria-hidden="true" tabindex="-1"></a>a <span class="op">=</span> <span class="fu">rand</span>() <span class="op">*</span> <span class="fu">Phiₑ</span>(<span class="fl">2</span><span class="fu">pi*rand</span>(), <span class="fu">pi*rand</span>())</span>
<span id="cb53-15"><a href="#cb53-15" aria-hidden="true" tabindex="-1"></a>A1 <span class="op">=</span> <span class="fu">hcubature</span>(r <span class="op">-&gt;</span> <span class="fu">E</span>(<span class="fu">Phiₑ</span>(r)<span class="op">-</span>a) <span class="op"></span> <span class="fu">normal</span>(r) <span class="op">*</span> <span class="fu">norm</span>(<span class="fu">SE</span>(r)), (<span class="fl">0.0</span>,<span class="fl">0.0</span>), (<span class="fl">2</span>pi, <span class="fl">1</span>pi))</span>
<span id="cb53-16"><a href="#cb53-16" aria-hidden="true" tabindex="-1"></a>A1[<span class="fl">1</span>]</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="45">
<pre><code>12.566370613450168</code></pre>
</div>
</div>
<p>The answer is <span class="math inline">\(4\pi\)</span>, regardless of the choice of <code>a</code>, as long as it is <em>inside</em> the surface. (We see above, some fussiness in the limits of integration. <code>HCubature</code> does some conversion of the limits, but does not <em>currently</em> do well with mixed types, so in the above only floating point values are used.)</p>
<p>When <code>a</code> is <em>outside</em> the surface, the answer is <em>always</em> a constant:</p>
<div class="cell" data-hold="true" data-execution_count="45">
<div class="sourceCode cell-code" id="cb55"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb55-1"><a href="#cb55-1" aria-hidden="true" tabindex="-1"></a>a <span class="op">=</span> <span class="fl">2</span> <span class="op">*</span> <span class="fu">Phiₑ</span>(<span class="fl">2</span><span class="fu">pi*rand</span>(), <span class="fu">pi*rand</span>()) <span class="co"># random point with radius 2</span></span>
<span id="cb55-2"><a href="#cb55-2" aria-hidden="true" tabindex="-1"></a>A1 <span class="op">=</span> <span class="fu">hcubature</span>(r <span class="op">-&gt;</span> <span class="fu">E</span>(<span class="fu">Phiₑ</span>(r)<span class="op">-</span>a) <span class="op"></span> <span class="fu">normal</span>(r) <span class="op">*</span> <span class="fu">norm</span>(<span class="fu">SE</span>(r)), (<span class="fl">0.0</span>,<span class="fl">0.0</span>), (<span class="fl">2</span>pi, <span class="cn">pi</span><span class="op">/</span><span class="fl">2</span>))</span>
<span id="cb55-3"><a href="#cb55-3" aria-hidden="true" tabindex="-1"></a>A2 <span class="op">=</span> <span class="fu">hcubature</span>(r <span class="op">-&gt;</span> <span class="fu">E</span>(<span class="fu">Phiₑ</span>(r)<span class="op">-</span>a) <span class="op"></span> <span class="fu">normal</span>(r) <span class="op">*</span> <span class="fu">norm</span>(<span class="fu">SE</span>(r)), (<span class="fl">0.0</span>,<span class="cn">pi</span><span class="op">/</span><span class="fl">2</span>), (<span class="fl">2</span>pi, <span class="fl">1</span>pi))</span>
<span id="cb55-4"><a href="#cb55-4" aria-hidden="true" tabindex="-1"></a>A1[<span class="fl">1</span>] <span class="op">+</span> A2[<span class="fl">1</span>]</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="46">
<pre><code>-1.3888223904245933e-11</code></pre>
</div>
</div>
<p>That constant being <span class="math inline">\(0\)</span>.</p>
<p>This is a consequence of <a href="https://en.wikipedia.org/wiki/Gauss%27s_law">Gausss law</a>, which states that for an electric field <span class="math inline">\(E\)</span>, the electric flux through a closed surface is proportional to the total charge contained. (Gausss law is related to the upcoming divergence theorem.) When <code>a</code> is inside the surface, the total charge is the same regardless of exactly where, so the integrals value is always the same. When <code>a</code> is outside the surface, the total charge inside the sphere is <span class="math inline">\(0\)</span>, so the flux integral is as well.</p>
<p>Gausss law is typically used to identify the electric field by choosing a judicious surface where the surface integral can be computed. For example, suppose a ball of radius <span class="math inline">\(R_0\)</span> has a <em>uniform</em> charge. What is the electric field generated? <em>Assuming</em> it is dependent only on the distance from the center of the charged ball, we can, first, take a sphere of radius <span class="math inline">\(R &gt; R_0\)</span> and note that <span class="math inline">\(E(\vec{r})\cdot\hat{N}(r) = \|E(R)\|\)</span>, the magnitude a distance <span class="math inline">\(R\)</span> away. So the surface integral is simply <span class="math inline">\(\|E(R)\|4\pi R^2\)</span> and by Gausss law a constant depending on the total charge. So <span class="math inline">\(\|E(R)\| ~ 1/R^2\)</span>. When <span class="math inline">\(R &lt; R_0\)</span>, the same applies, but the total charge within the surface will be like <span class="math inline">\((R/R_0 )^3\)</span>, so the result will be <em>linear</em> in <span class="math inline">\(R\)</span>, as:</p>
<p><span class="math display">\[
4 \pi \|E(R)\| R^2 = k 4\pi \left(\frac{R}{R_0}\right)^3.
\]</span></p>
</section>
</section>
</section>
<section id="questions" class="level2" data-number="60.3">
<h2 data-number="60.3" class="anchored" data-anchor-id="questions"><span class="header-section-number">60.3</span> Questions</h2>
<section id="question" class="level6">
<h6 class="anchored" data-anchor-id="question">Question</h6>
<p>Let <span class="math inline">\(\vec{r}(t) = \langle e^t\cos(t), e^{-t}\sin(t) \rangle\)</span>.</p>
<p>What is <span class="math inline">\(\|\vec{r}'(1/2)\|\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="46">
<div class="cell-output cell-output-display" data-execution_count="47">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="17910799034402068280" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_17910799034402068280">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="17910799034402068280" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="17910799034402068280_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("17910799034402068280").addEventListener("change", function() {
var correct = (Math.abs(this.value - 0.699461297570161) <= 0.001);
var msgBox = document.getElementById('17910799034402068280_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_17910799034402068280")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_17910799034402068280")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
<p>What is the <span class="math inline">\(x\)</span> (first) component of <span class="math inline">\(\hat{N}(t) = \hat{T}'(t)/\|\hat{T}'(t)\|\)</span> at <span class="math inline">\(t=1/2\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="47">
<div class="cell-output cell-output-display" data-execution_count="48">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="3058858394993618434" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_3058858394993618434">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="3058858394993618434" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="3058858394993618434_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("3058858394993618434").addEventListener("change", function() {
var correct = (Math.abs(this.value - 0.3452577617116201) <= 0.001);
var msgBox = document.getElementById('3058858394993618434_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_3058858394993618434")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_3058858394993618434")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-1" class="level6">
<h6 class="anchored" data-anchor-id="question-1">Question</h6>
<p>Let <span class="math inline">\(\Phi(u,v) = \langle u,v,u^2+v^2\rangle\)</span> parameterize a surface. Find the magnitude of <span class="math inline">\(\| \partial{\Phi}/\partial{u} \times \partial{\Phi}/\partial{v} \|\)</span> at <span class="math inline">\(u=1\)</span> and <span class="math inline">\(v=2\)</span>.</p>
<div class="cell" data-hold="true" data-execution_count="48">
<div class="cell-output cell-output-display" data-execution_count="49">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="2979822363176996714" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_2979822363176996714">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="2979822363176996714" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="2979822363176996714_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("2979822363176996714").addEventListener("change", function() {
var correct = (Math.abs(this.value - 4.58257569495584) <= 0.001);
var msgBox = document.getElementById('2979822363176996714_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_2979822363176996714")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_2979822363176996714")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-2" class="level6">
<h6 class="anchored" data-anchor-id="question-2">Question</h6>
<p>For a plane <span class="math inline">\(ax+by+cz=d\)</span> find the unit normal.</p>
<div class="cell" data-hold="true" data-execution_count="49">
<div class="cell-output cell-output-display" data-execution_count="50">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="12742682309979273074" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_12742682309979273074">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_12742682309979273074_1">
<input class="form-check-input" type="radio" name="radio_12742682309979273074" id="radio_12742682309979273074_1" value="1">
<span class="label-body px-1">
\(\langle a, b, c\rangle / \| \langle a, b, c\rangle\|\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12742682309979273074_2">
<input class="form-check-input" type="radio" name="radio_12742682309979273074" id="radio_12742682309979273074_2" value="2">
<span class="label-body px-1">
\(\langle d-a, d-b, d-c\rangle / \| \langle d-a, d-b, d-c\rangle\|\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12742682309979273074_3">
<input class="form-check-input" type="radio" name="radio_12742682309979273074" id="radio_12742682309979273074_3" value="3">
<span class="label-body px-1">
\(\langle a, b, c\rangle\)
</span>
</label>
</div>
</div>
</div>
<div id="12742682309979273074_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_12742682309979273074"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('12742682309979273074_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_12742682309979273074")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_12742682309979273074")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
<p>Does it depend on <span class="math inline">\(d\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="50">
<div class="cell-output cell-output-display" data-execution_count="51">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="14022166241414218033" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_14022166241414218033">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_14022166241414218033_1">
<input class="form-check-input" type="radio" name="radio_14022166241414218033" id="radio_14022166241414218033_1" value="1">
<span class="label-body px-1">
Yes. Of course. Different values for \(d\) mean different values for \(x\), \(y\), and \(z\) are needed.
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_14022166241414218033_2">
<input class="form-check-input" type="radio" name="radio_14022166241414218033" id="radio_14022166241414218033_2" value="2">
<span class="label-body px-1">
Yes. The gradient of \(F(x,y,z) = ax + by + cz\) will be normal to the level curve \(F(x,y,z)=d\), and so this will depend on \(d\).
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_14022166241414218033_3">
<input class="form-check-input" type="radio" name="radio_14022166241414218033" id="radio_14022166241414218033_3" value="3">
<span class="label-body px-1">
No. Moving \(d\) just shifts the plane up or down the \(z\) axis, but won't change the normal vector
</span>
</label>
</div>
</div>
</div>
<div id="14022166241414218033_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_14022166241414218033"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 3;
var msgBox = document.getElementById('14022166241414218033_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_14022166241414218033")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_14022166241414218033")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-3" class="level6">
<h6 class="anchored" data-anchor-id="question-3">Question</h6>
<p>Let <span class="math inline">\(\vec{r}(t) = \langle \cos(t), \sin(t), t\rangle\)</span> and let <span class="math inline">\(F(x,y,z) = \langle -y, x, z\rangle\)</span></p>
<p>Numerically compute <span class="math inline">\(\int_0^{2\pi} F(\vec{r}(t)) \cdot \vec{r}'(t) dt\)</span>.</p>
<div class="cell" data-hold="true" data-execution_count="51">
<div class="cell-output cell-output-display" data-execution_count="52">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="8083327101606725016" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_8083327101606725016">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="8083327101606725016" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="8083327101606725016_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("8083327101606725016").addEventListener("change", function() {
var correct = (Math.abs(this.value - 26.022394109358302) <= 0.001);
var msgBox = document.getElementById('8083327101606725016_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_8083327101606725016")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_8083327101606725016")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
<p>Compute the value symbolically:</p>
<div class="cell" data-hold="true" data-execution_count="52">
<div class="cell-output cell-output-display" data-execution_count="53">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="3728100115105514396" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_3728100115105514396">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_3728100115105514396_1">
<input class="form-check-input" type="radio" name="radio_3728100115105514396" id="radio_3728100115105514396_1" value="1">
<span class="label-body px-1">
\(2\pi + 2\pi^2\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_3728100115105514396_2">
<input class="form-check-input" type="radio" name="radio_3728100115105514396" id="radio_3728100115105514396_2" value="2">
<span class="label-body px-1">
\(2\pi^2\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_3728100115105514396_3">
<input class="form-check-input" type="radio" name="radio_3728100115105514396" id="radio_3728100115105514396_3" value="3">
<span class="label-body px-1">
\(4\pi\)
</span>
</label>
</div>
</div>
</div>
<div id="3728100115105514396_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_3728100115105514396"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('3728100115105514396_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_3728100115105514396")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_3728100115105514396")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-4" class="level6">
<h6 class="anchored" data-anchor-id="question-4">Question</h6>
<p>Let <span class="math inline">\(F(x,y) = \langle 2x^3y^2, xy^4 + 1\rangle\)</span>. What is the work done in integrating <span class="math inline">\(F\)</span> along the parabola <span class="math inline">\(y=x^2\)</span> between <span class="math inline">\((-1,1)\)</span> and <span class="math inline">\((1,1)\)</span>? Give a numeric answer:</p>
<div class="cell" data-hold="true" data-execution_count="53">
<div class="cell-output cell-output-display" data-execution_count="54">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="17926333314385247436" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_17926333314385247436">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="17926333314385247436" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="17926333314385247436_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("17926333314385247436").addEventListener("change", function() {
var correct = (Math.abs(this.value - 0.36363636363636326) <= 0.001);
var msgBox = document.getElementById('17926333314385247436_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_17926333314385247436")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_17926333314385247436")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-5" class="level6">
<h6 class="anchored" data-anchor-id="question-5">Question</h6>
<p>Let <span class="math inline">\(F = \nabla{f}\)</span> where <span class="math inline">\(f:R^2 \rightarrow R\)</span>. The level curves of <span class="math inline">\(f\)</span> are curves in the <span class="math inline">\(x-y\)</span> plane where <span class="math inline">\(f(x,y)=c\)</span>, for some constant <span class="math inline">\(c\)</span>. Suppose <span class="math inline">\(\vec{r}(t)\)</span> describes a path on the level curve of <span class="math inline">\(f\)</span>. What is the value of <span class="math inline">\(\int_C F \cdot d\vec{r}\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="54">
<div class="cell-output cell-output-display" data-execution_count="55">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="9251531609568992022" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_9251531609568992022">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_9251531609568992022_1">
<input class="form-check-input" type="radio" name="radio_9251531609568992022" id="radio_9251531609568992022_1" value="1">
<span class="label-body px-1">
It will be \(0\), as \(\nabla{f}\) is orthogonal to the level curve and \(\vec{r}'\) is tangent to the level curve
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_9251531609568992022_2">
<input class="form-check-input" type="radio" name="radio_9251531609568992022" id="radio_9251531609568992022_2" value="2">
<span class="label-body px-1">
It will \(f(b)-f(a)\) for any \(b\) or \(a\)
</span>
</label>
</div>
</div>
</div>
<div id="9251531609568992022_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_9251531609568992022"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('9251531609568992022_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_9251531609568992022")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_9251531609568992022")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-6" class="level6">
<h6 class="anchored" data-anchor-id="question-6">Question</h6>
<p>Let <span class="math inline">\(F(x,y) = (x^2+y^2)^{-k/2} \langle x, y \rangle\)</span> be a radial field. The work integral around the unit circle simplifies:</p>
<p><span class="math display">\[
\int_C F\cdot \frac{dr}{dt} dt = \int_0^{2pi} \langle (1)^{-k/2} \cos(t), \sin(t) \rangle \cdot \langle-\sin(t), \cos(t)\rangle dt.
\]</span></p>
<p>For any <span class="math inline">\(k\)</span>, this integral will be:</p>
<div class="cell" data-hold="true" data-execution_count="55">
<div class="cell-output cell-output-display" data-execution_count="56">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="16878271191913953582" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_16878271191913953582">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="16878271191913953582" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="16878271191913953582_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("16878271191913953582").addEventListener("change", function() {
var correct = (Math.abs(this.value - 0) <= 0);
var msgBox = document.getElementById('16878271191913953582_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_16878271191913953582")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_16878271191913953582")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-7" class="level6">
<h6 class="anchored" data-anchor-id="question-7">Question</h6>
<p>Let <span class="math inline">\(f(x,y) = \tan^{-1}(y/x)\)</span>. We will integrate <span class="math inline">\(\nabla{f}\)</span> over the unit circle. The integrand wil be:</p>
<div class="cell" data-hold="true" data-execution_count="56">
<div class="sourceCode cell-code" id="cb57"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb57-1"><a href="#cb57-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> t<span class="op">::</span><span class="dt">real </span>x<span class="op">::</span><span class="dt">real </span>y<span class="op">::</span><span class="dt">real</span></span>
<span id="cb57-2"><a href="#cb57-2" aria-hidden="true" tabindex="-1"></a><span class="fu">f</span>(x,y) <span class="op">=</span> <span class="fu">atan</span>(y<span class="op">/</span>x)</span>
<span id="cb57-3"><a href="#cb57-3" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(t) <span class="op">=</span> [<span class="fu">cos</span>(t), <span class="fu">sin</span>(t)]</span>
<span id="cb57-4"><a href="#cb57-4" aria-hidden="true" tabindex="-1"></a>∇f <span class="op">=</span> <span class="fu">subs</span>.(<span class="fu"></span>(<span class="fu">f</span>(x,y)), x <span class="op">.=&gt;</span> <span class="fu">r</span>(t)[<span class="fl">1</span>], y <span class="op">.=&gt;</span> <span class="fu">r</span>(t)[<span class="fl">2</span>]) <span class="op">.|&gt;</span> simplify</span>
<span id="cb57-5"><a href="#cb57-5" aria-hidden="true" tabindex="-1"></a>drdt <span class="op">=</span> <span class="fu">diff</span>.(<span class="fu">r</span>(t), t)</span>
<span id="cb57-6"><a href="#cb57-6" aria-hidden="true" tabindex="-1"></a>∇f <span class="op"></span> drdt <span class="op">|&gt;</span> simplify</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="57">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
1
\]
</span>
</div>
</div>
<p>So <span class="math inline">\(\int_C \nabla{f}\cdot d\vec{r} = \int_0^{2\pi} \nabla{f}\cdot d\vec{r}/dt dt = 2\pi\)</span>.</p>
<p>Why is this surprising?</p>
<div class="cell" data-hold="true" data-execution_count="57">
<div class="cell-output cell-output-display" data-execution_count="58">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="12365516563171490142" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_12365516563171490142">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_12365516563171490142_1">
<input class="form-check-input" type="radio" name="radio_12365516563171490142" id="radio_12365516563171490142_1" value="1">
<span class="label-body px-1">
The value of \(d/dt(f\circ\vec{r})=0\), so the integral should be \(0\).
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12365516563171490142_2">
<input class="form-check-input" type="radio" name="radio_12365516563171490142" id="radio_12365516563171490142_2" value="2">
<span class="label-body px-1">
The field is a potential field, but the path integral around \(0\) is not path dependent.
</span>
</label>
</div>
</div>
</div>
<div id="12365516563171490142_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_12365516563171490142"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('12365516563171490142_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_12365516563171490142")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_12365516563171490142")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
<p>The function <span class="math inline">\(F = \nabla{f}\)</span> is</p>
<div class="cell" data-hold="true" data-execution_count="58">
<div class="cell-output cell-output-display" data-execution_count="59">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="7986639896967026301" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_7986639896967026301">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_7986639896967026301_1">
<input class="form-check-input" type="radio" name="radio_7986639896967026301" id="radio_7986639896967026301_1" value="1">
<span class="label-body px-1">
Continuous everywhere
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_7986639896967026301_2">
<input class="form-check-input" type="radio" name="radio_7986639896967026301" id="radio_7986639896967026301_2" value="2">
<span class="label-body px-1">
Not continuous everywhere
</span>
</label>
</div>
</div>
</div>
<div id="7986639896967026301_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_7986639896967026301"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('7986639896967026301_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_7986639896967026301")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_7986639896967026301")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-8" class="level6">
<h6 class="anchored" data-anchor-id="question-8">Question</h6>
<p>Let <span class="math inline">\(F(x,y) = \langle F_x, F_y\rangle = \langle 2x^3y^2, xy^4 + 1\rangle\)</span>. Compute</p>
<p><span class="math display">\[
\frac{\partial{F_y}}{\partial{x}}- \frac{\partial{F_x}}{\partial{y}}.
\]</span></p>
<p>Is this <span class="math inline">\(0\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="59">
<div class="cell-output cell-output-display" data-execution_count="60">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="12243024781218316645" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_12243024781218316645">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_12243024781218316645_1">
<input class="form-check-input" type="radio" name="radio_12243024781218316645" id="radio_12243024781218316645_1" value="1">
<span class="label-body px-1">
Yes
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12243024781218316645_2">
<input class="form-check-input" type="radio" name="radio_12243024781218316645" id="radio_12243024781218316645_2" value="2">
<span class="label-body px-1">
No
</span>
</label>
</div>
</div>
</div>
<div id="12243024781218316645_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_12243024781218316645"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('12243024781218316645_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_12243024781218316645")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_12243024781218316645")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-9" class="level6">
<h6 class="anchored" data-anchor-id="question-9">Question</h6>
<p>Let <span class="math inline">\(F(x,y) = \langle F_x, F_y\rangle = \langle 2x^3, y^4 + 1\rangle\)</span>. Compute</p>
<p><span class="math display">\[
\frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}}.
\]</span></p>
<p>Is this <span class="math inline">\(0\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="60">
<div class="cell-output cell-output-display" data-execution_count="61">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="3047379731653980443" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_3047379731653980443">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_3047379731653980443_1">
<input class="form-check-input" type="radio" name="radio_3047379731653980443" id="radio_3047379731653980443_1" value="1">
<span class="label-body px-1">
Yes
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_3047379731653980443_2">
<input class="form-check-input" type="radio" name="radio_3047379731653980443" id="radio_3047379731653980443_2" value="2">
<span class="label-body px-1">
No
</span>
</label>
</div>
</div>
</div>
<div id="3047379731653980443_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_3047379731653980443"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('3047379731653980443_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_3047379731653980443")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_3047379731653980443")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-10" class="level6">
<h6 class="anchored" data-anchor-id="question-10">Question</h6>
<p>It is not unusual to see a line integral, <span class="math inline">\(\int F\cdot d\vec{r}\)</span>, where <span class="math inline">\(F=\langle M, N \rangle\)</span> expressed as <span class="math inline">\(\int Mdx + Ndy\)</span>. This uses the notation for a differential form, so is familiar in some theoretical usages, but does not readily lend itself to computation. It does yield pleasing formulas, such as <span class="math inline">\(\oint_C x dy\)</span> to give the area of a two-dimensional region, <span class="math inline">\(D\)</span>, in terms of a line integral around its perimeter. To see that this is so, let <span class="math inline">\(\vec{r}(t) = \langle a\cos(t), b\sin(t)\rangle\)</span>, <span class="math inline">\(0 \leq t \leq 2\pi\)</span>. This parameterizes an ellipse. Let <span class="math inline">\(F(x,y) = \langle 0,x\rangle\)</span>. What does <span class="math inline">\(\oint_C xdy\)</span> become when translated into <span class="math inline">\(\int_a^b (F\circ\vec{r})\cdot\vec{r}' dt\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="61">
<div class="cell-output cell-output-display" data-execution_count="62">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="10828053898965566033" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_10828053898965566033">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_10828053898965566033_1">
<input class="form-check-input" type="radio" name="radio_10828053898965566033" id="radio_10828053898965566033_1" value="1">
<span class="label-body px-1">
\(\int_0^{2\pi} (a\cos(t)) \cdot (b\cos(t)) dt\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10828053898965566033_2">
<input class="form-check-input" type="radio" name="radio_10828053898965566033" id="radio_10828053898965566033_2" value="2">
<span class="label-body px-1">
\(\int_0^{2\pi} (-b\sin(t)) \cdot (b\cos(t)) dt\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10828053898965566033_3">
<input class="form-check-input" type="radio" name="radio_10828053898965566033" id="radio_10828053898965566033_3" value="3">
<span class="label-body px-1">
\(\int_0^{2\pi} (a\cos(t)) \cdot (a\cos(t)) dt\)
</span>
</label>
</div>
</div>
</div>
<div id="10828053898965566033_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_10828053898965566033"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('10828053898965566033_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_10828053898965566033")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_10828053898965566033")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-11" class="level6">
<h6 class="anchored" data-anchor-id="question-11">Question</h6>
<p>Let a surface be parameterized by <span class="math inline">\(\Phi(u,v) = \langle u\cos(v), u\sin(v), u\rangle\)</span>.</p>
<p>Compute <span class="math inline">\(\vec{v}_1 = \partial{\Phi}/\partial{u}\)</span></p>
<div class="cell" data-hold="true" data-execution_count="62">
<div class="cell-output cell-output-display" data-execution_count="63">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="17192466789811750902" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_17192466789811750902">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_17192466789811750902_1">
<input class="form-check-input" type="radio" name="radio_17192466789811750902" id="radio_17192466789811750902_1" value="1">
<span class="label-body px-1">
\(\langle \cos(v), \sin(v), 1\rangle\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_17192466789811750902_2">
<input class="form-check-input" type="radio" name="radio_17192466789811750902" id="radio_17192466789811750902_2" value="2">
<span class="label-body px-1">
\(\langle -u\sin(v), u\cos(v), 0\rangle\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_17192466789811750902_3">
<input class="form-check-input" type="radio" name="radio_17192466789811750902" id="radio_17192466789811750902_3" value="3">
<span class="label-body px-1">
\(u\langle -\cos(v), -\sin(v), 1\rangle\)
</span>
</label>
</div>
</div>
</div>
<div id="17192466789811750902_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_17192466789811750902"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('17192466789811750902_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_17192466789811750902")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_17192466789811750902")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
<p>Compute <span class="math inline">\(\vec{v}_2 = \partial{\Phi}/\partial{u}\)</span></p>
<div class="cell" data-hold="true" data-execution_count="63">
<div class="cell-output cell-output-display" data-execution_count="64">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="17588380190139071570" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_17588380190139071570">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_17588380190139071570_1">
<input class="form-check-input" type="radio" name="radio_17588380190139071570" id="radio_17588380190139071570_1" value="1">
<span class="label-body px-1">
\(\langle \cos(v), \sin(v), 1\rangle\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_17588380190139071570_2">
<input class="form-check-input" type="radio" name="radio_17588380190139071570" id="radio_17588380190139071570_2" value="2">
<span class="label-body px-1">
\(\langle -u\sin(v), u\cos(v), 0\rangle\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_17588380190139071570_3">
<input class="form-check-input" type="radio" name="radio_17588380190139071570" id="radio_17588380190139071570_3" value="3">
<span class="label-body px-1">
\(u\langle -\cos(v), -\sin(v), 1\rangle\)
</span>
</label>
</div>
</div>
</div>
<div id="17588380190139071570_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_17588380190139071570"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('17588380190139071570_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_17588380190139071570")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_17588380190139071570")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
<p>Compute <span class="math inline">\(\vec{v}_1 \times \vec{v}_2\)</span></p>
<div class="cell" data-hold="true" data-execution_count="64">
<div class="cell-output cell-output-display" data-execution_count="65">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="16465863959792681798" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_16465863959792681798">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_16465863959792681798_1">
<input class="form-check-input" type="radio" name="radio_16465863959792681798" id="radio_16465863959792681798_1" value="1">
<span class="label-body px-1">
\(\langle \cos(v), \sin(v), 1\rangle\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_16465863959792681798_2">
<input class="form-check-input" type="radio" name="radio_16465863959792681798" id="radio_16465863959792681798_2" value="2">
<span class="label-body px-1">
\(\langle -u\sin(v), u\cos(v), 0\rangle\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_16465863959792681798_3">
<input class="form-check-input" type="radio" name="radio_16465863959792681798" id="radio_16465863959792681798_3" value="3">
<span class="label-body px-1">
\(u\langle -\cos(v), -\sin(v), 1\rangle\)
</span>
</label>
</div>
</div>
</div>
<div id="16465863959792681798_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_16465863959792681798"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 3;
var msgBox = document.getElementById('16465863959792681798_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_16465863959792681798")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_16465863959792681798")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-12" class="level6">
<h6 class="anchored" data-anchor-id="question-12">Question</h6>
<p>For the surface parameterized by <span class="math inline">\(\Phi(u,v) = \langle uv, u^2v, uv^2\rangle\)</span> for <span class="math inline">\((u,v)\)</span> in <span class="math inline">\([0,1]\times[0,1]\)</span>, numerically find the surface area.</p>
<div class="cell" data-hold="true" data-execution_count="65">
<div class="cell-output cell-output-display" data-execution_count="66">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="18355289784229144278" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_18355289784229144278">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="18355289784229144278" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="18355289784229144278_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("18355289784229144278").addEventListener("change", function() {
var correct = (Math.abs(this.value - 0.4188868549037434) <= 0.001);
var msgBox = document.getElementById('18355289784229144278_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_18355289784229144278")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_18355289784229144278")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-13" class="level6">
<h6 class="anchored" data-anchor-id="question-13">Question</h6>
<p>For the surface parameterized by <span class="math inline">\(\Phi(u,v) = \langle uv, u^2v, uv^2\rangle\)</span> for <span class="math inline">\((u,v)\)</span> in <span class="math inline">\([0,1]\times[0,1]\)</span> and vector field <span class="math inline">\(F(x,y,z) =\langle y^2, x, z\langle\)</span>, numerically find <span class="math inline">\(\iint_S (F\cdot\hat{N}) dS\)</span>.</p>
<div class="cell" data-hold="true" data-execution_count="66">
<div class="cell-output cell-output-display" data-execution_count="67">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="16373831211012533318" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_16373831211012533318">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="16373831211012533318" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="16373831211012533318_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("16373831211012533318").addEventListener("change", function() {
var correct = (Math.abs(this.value - -0.06011904761868202) <= 0.001);
var msgBox = document.getElementById('16373831211012533318_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_16373831211012533318")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_16373831211012533318")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-14" class="level6">
<h6 class="anchored" data-anchor-id="question-14">Question</h6>
<p>Let <span class="math inline">\(F=\langle 0,0,1\rangle\)</span> and <span class="math inline">\(S\)</span> be the upper-half unit sphere, parameterized by <span class="math inline">\(\Phi(\theta, \phi) = \langle \sin(\phi)\cos(\theta), \sin(\phi)\sin(\theta), \cos(\phi)\rangle\)</span>. Compute <span class="math inline">\(\iint_S (F\cdot\hat{N}) dS\)</span> numerically. Choose the normal direction so that the answer is postive.</p>
<div class="cell" data-hold="true" data-execution_count="67">
<div class="cell-output cell-output-display" data-execution_count="68">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="18082013425534467099" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_18082013425534467099">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="18082013425534467099" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="18082013425534467099_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("18082013425534467099").addEventListener("change", function() {
var correct = (Math.abs(this.value - 3.1415926535899974) <= 0.001);
var msgBox = document.getElementById('18082013425534467099_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_18082013425534467099")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_18082013425534467099")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-15" class="level6">
<h6 class="anchored" data-anchor-id="question-15">Question</h6>
<p>Let <span class="math inline">\(\phi(x,y,z) = xy\)</span> and <span class="math inline">\(S\)</span> be the triangle <span class="math inline">\(x+y+z=1\)</span>, <span class="math inline">\(x,y,z \geq 0\)</span>. The surface may be described by <span class="math inline">\(z=f(x,y) = 1 - (x + y)\)</span>, <span class="math inline">\(0\leq y \leq 1-x, 0 \leq x \leq 1\)</span> is useful in describing the surface. With this, the following integral will compute <span class="math inline">\(\int_S \phi dS\)</span>:</p>
<p><span class="math display">\[
\int_0^1 \int_0^{1-x} xy \sqrt{1 + \left(\frac{\partial{f}}{\partial{x}}\right)^2 + \left(\frac{\partial{f}}{\partial{y}}\right)^2} dy dx.
\]</span></p>
<p>Compute this.</p>
<div class="cell" data-hold="true" data-execution_count="68">
<div class="cell-output cell-output-display" data-execution_count="69">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="12387123829968477919" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_12387123829968477919">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_12387123829968477919_1">
<input class="form-check-input" type="radio" name="radio_12387123829968477919" id="radio_12387123829968477919_1" value="1">
<span class="label-body px-1">
\(\sqrt{2}/24\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12387123829968477919_2">
<input class="form-check-input" type="radio" name="radio_12387123829968477919" id="radio_12387123829968477919_2" value="2">
<span class="label-body px-1">
\(2/\sqrt{24}\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12387123829968477919_3">
<input class="form-check-input" type="radio" name="radio_12387123829968477919" id="radio_12387123829968477919_3" value="3">
<span class="label-body px-1">
\(1/12\)
</span>
</label>
</div>
</div>
</div>
<div id="12387123829968477919_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_12387123829968477919"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('12387123829968477919_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_12387123829968477919")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_12387123829968477919")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-16" class="level6">
<h6 class="anchored" data-anchor-id="question-16">Question</h6>
<p>Let <span class="math inline">\(\Phi(u,v) = \langle u^2, uv, v^2\rangle\)</span>, <span class="math inline">\((u,v)\)</span> in <span class="math inline">\([0,1]\times[0,1]\)</span> and <span class="math inline">\(F(x,y,z) = \langle x,y^2,z^3\rangle\)</span>. Find <span class="math inline">\(\int_S (F\cdot\hat{N})dS\)</span></p>
<div class="cell" data-hold="true" data-execution_count="69">
<div class="cell-output cell-output-display" data-execution_count="70">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="11463017784291594270" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_11463017784291594270">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_11463017784291594270_1">
<input class="form-check-input" type="radio" name="radio_11463017784291594270" id="radio_11463017784291594270_1" value="1">
<span class="label-body px-1">
\(7/36\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_11463017784291594270_2">
<input class="form-check-input" type="radio" name="radio_11463017784291594270" id="radio_11463017784291594270_2" value="2">
<span class="label-body px-1">
\(1/60\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_11463017784291594270_3">
<input class="form-check-input" type="radio" name="radio_11463017784291594270" id="radio_11463017784291594270_3" value="3">
<span class="label-body px-1">
\(17/252\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_11463017784291594270_4">
<input class="form-check-input" type="radio" name="radio_11463017784291594270" id="radio_11463017784291594270_4" value="4">
<span class="label-body px-1">
\(0\)
</span>
</label>
</div>
</div>
</div>
<div id="11463017784291594270_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_11463017784291594270"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 3;
var msgBox = document.getElementById('11463017784291594270_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_11463017784291594270")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_11463017784291594270")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
</section>
</main> <!-- /main -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
const toggleBodyColorMode = (bsSheetEl) => {
const mode = bsSheetEl.getAttribute("data-mode");
const bodyEl = window.document.querySelector("body");
if (mode === "dark") {
bodyEl.classList.add("quarto-dark");
bodyEl.classList.remove("quarto-light");
} else {
bodyEl.classList.add("quarto-light");
bodyEl.classList.remove("quarto-dark");
}
}
const toggleBodyColorPrimary = () => {
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
if (bsSheetEl) {
toggleBodyColorMode(bsSheetEl);
}
}
toggleBodyColorPrimary();
const icon = "";
const anchorJS = new window.AnchorJS();
anchorJS.options = {
placement: 'right',
icon: icon
};
anchorJS.add('.anchored');
const clipboard = new window.ClipboardJS('.code-copy-button', {
target: function(trigger) {
return trigger.previousElementSibling;
}
});
clipboard.on('success', function(e) {
// button target
const button = e.trigger;
// don't keep focus
button.blur();
// flash "checked"
button.classList.add('code-copy-button-checked');
var currentTitle = button.getAttribute("title");
button.setAttribute("title", "Copied!");
setTimeout(function() {
button.setAttribute("title", currentTitle);
button.classList.remove('code-copy-button-checked');
}, 1000);
// clear code selection
e.clearSelection();
});
function tippyHover(el, contentFn) {
const config = {
allowHTML: true,
content: contentFn,
maxWidth: 500,
delay: 100,
arrow: false,
appendTo: function(el) {
return el.parentElement;
},
interactive: true,
interactiveBorder: 10,
theme: 'quarto',
placement: 'bottom-start'
};
window.tippy(el, config);
}
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
for (var i=0; i<noterefs.length; i++) {
const ref = noterefs[i];
tippyHover(ref, function() {
let href = ref.getAttribute('href');
try { href = new URL(href).hash; } catch {}
const id = href.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
return note.innerHTML;
});
}
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
for (var i=0; i<bibliorefs.length; i++) {
const ref = bibliorefs[i];
const cites = ref.parentNode.getAttribute('data-cites').split(' ');
tippyHover(ref, function() {
var popup = window.document.createElement('div');
cites.forEach(function(cite) {
var citeDiv = window.document.createElement('div');
citeDiv.classList.add('hanging-indent');
citeDiv.classList.add('csl-entry');
var biblioDiv = window.document.getElementById('ref-' + cite);
if (biblioDiv) {
citeDiv.innerHTML = biblioDiv.innerHTML;
}
popup.appendChild(citeDiv);
});
return popup.innerHTML;
});
}
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
var filterRegex = new RegExp('/' + window.location.host + '/');
var isInternal = (href) => {
return filterRegex.test(href) || localhostRegex.test(href);
}
// Inspect non-navigation links and adorn them if external
var links = window.document.querySelectorAll('a:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external)');
for (var i=0; i<links.length; i++) {
const link = links[i];
if (!isInternal(link.href)) {
// target, if specified
link.setAttribute("target", "_blank");
}
}
});
</script>
<nav class="page-navigation">
<div class="nav-page nav-page-previous">
<a href="../integral_vector_calculus/double_triple_integrals.html" class="pagination-link">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">59</span>&nbsp; <span class="chapter-title">Multi-dimensional integrals</span></span>
</a>
</div>
<div class="nav-page nav-page-next">
<a href="../integral_vector_calculus/div_grad_curl.html" class="pagination-link">
<span class="nav-page-text"><span class="chapter-number">61</span>&nbsp; <span class="chapter-title">The Gradient, Divergence, and Curl</span></span> <i class="bi bi-arrow-right-short"></i>
</a>
</div>
</nav>
</div> <!-- /content -->
<footer class="footer">
<div class="nav-footer">
<div class="nav-footer-center">Copyright 2022, John Verzani</div>
</div>
</footer>
</body></html>