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

2453 lines
147 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 - 61&nbsp; The Gradient, Divergence, and Curl</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/stokes_theorem.html" rel="next">
<link href="../integral_vector_calculus/line_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">61</span>&nbsp; <span class="chapter-title">The Gradient, Divergence, and Curl</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"><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 active"><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="#the-divergence" id="toc-the-divergence" class="nav-link active" data-scroll-target="#the-divergence"> <span class="header-section-number">61.1</span> The divergence</a>
<ul class="collapse">
<li><a href="#general-n" id="toc-general-n" class="nav-link" data-scroll-target="#general-n"> <span class="header-section-number">61.1.1</span> General <span class="math inline">\(n\)</span></a></li>
</ul></li>
<li><a href="#the-curl" id="toc-the-curl" class="nav-link" data-scroll-target="#the-curl"> <span class="header-section-number">61.2</span> The curl</a>
<ul class="collapse">
<li><a href="#the-nabla-del-operator" id="toc-the-nabla-del-operator" class="nav-link" data-scroll-target="#the-nabla-del-operator"> <span class="header-section-number">61.2.1</span> The <span class="math inline">\(\nabla\)</span> (del) operator</a></li>
</ul></li>
<li><a href="#interpretation" id="toc-interpretation" class="nav-link" data-scroll-target="#interpretation"> <span class="header-section-number">61.3</span> Interpretation</a></li>
<li><a href="#the-maxwell-equations" id="toc-the-maxwell-equations" class="nav-link" data-scroll-target="#the-maxwell-equations"> <span class="header-section-number">61.4</span> The Maxwell equations</a></li>
<li><a href="#algebra-of-vector-calculus" id="toc-algebra-of-vector-calculus" class="nav-link" data-scroll-target="#algebra-of-vector-calculus"> <span class="header-section-number">61.5</span> Algebra of vector calculus</a>
<ul class="collapse">
<li><a href="#linearity" id="toc-linearity" class="nav-link" data-scroll-target="#linearity"> <span class="header-section-number">61.5.1</span> Linearity</a></li>
<li><a href="#product-rule" id="toc-product-rule" class="nav-link" data-scroll-target="#product-rule"> <span class="header-section-number">61.5.2</span> Product rule</a></li>
<li><a href="#rules-over-cross-products" id="toc-rules-over-cross-products" class="nav-link" data-scroll-target="#rules-over-cross-products"> <span class="header-section-number">61.5.3</span> Rules over cross products</a></li>
<li><a href="#vanishing-properties" id="toc-vanishing-properties" class="nav-link" data-scroll-target="#vanishing-properties"> <span class="header-section-number">61.5.4</span> Vanishing properties</a></li>
</ul></li>
<li><a href="#fundamental-theorem-of-vector-calculus" id="toc-fundamental-theorem-of-vector-calculus" class="nav-link" data-scroll-target="#fundamental-theorem-of-vector-calculus"> <span class="header-section-number">61.6</span> Fundamental theorem of vector calculus</a></li>
<li><a href="#change-of-variable" id="toc-change-of-variable" class="nav-link" data-scroll-target="#change-of-variable"> <span class="header-section-number">61.7</span> Change of variable</a>
<ul class="collapse">
<li><a href="#example-1" id="toc-example-1" class="nav-link" data-scroll-target="#example-1"> <span class="header-section-number">61.7.1</span> Example</a></li>
<li><a href="#the-gradient-in-a-new-coordinate-system" id="toc-the-gradient-in-a-new-coordinate-system" class="nav-link" data-scroll-target="#the-gradient-in-a-new-coordinate-system"> <span class="header-section-number">61.7.2</span> The gradient in a new coordinate system</a></li>
<li><a href="#the-divergence-in-a-new-coordinate-system" id="toc-the-divergence-in-a-new-coordinate-system" class="nav-link" data-scroll-target="#the-divergence-in-a-new-coordinate-system"> <span class="header-section-number">61.7.3</span> The divergence in a new coordinate system</a></li>
<li><a href="#the-curl-in-a-new-coordinate-system" id="toc-the-curl-in-a-new-coordinate-system" class="nav-link" data-scroll-target="#the-curl-in-a-new-coordinate-system"> <span class="header-section-number">61.7.4</span> The curl in a new coordinate system</a></li>
</ul></li>
<li><a href="#questions" id="toc-questions" class="nav-link" data-scroll-target="#questions"> <span class="header-section-number">61.8</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/div_grad_curl.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">61</span>&nbsp; <span class="chapter-title">The Gradient, Divergence, and Curl</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">SymPy</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<hr>
<p>The gradient of a scalar function <span class="math inline">\(f:R^n \rightarrow R\)</span> is a vector field of partial derivatives. In <span class="math inline">\(R^2\)</span>, we have:</p>
<p><span class="math display">\[
\nabla{f} = \langle \frac{\partial{f}}{\partial{x}},
\frac{\partial{f}}{\partial{y}} \rangle.
\]</span></p>
<p>It has the interpretation of pointing out the direction of greatest ascent for the surface <span class="math inline">\(z=f(x,y)\)</span>.</p>
<p>We move now to two other operations, the divergence and the curl, which combine to give a language to describe vector fields in <span class="math inline">\(R^3\)</span>.</p>
<section id="the-divergence" class="level2" data-number="61.1">
<h2 data-number="61.1" class="anchored" data-anchor-id="the-divergence"><span class="header-section-number">61.1</span> The divergence</h2>
<p>Let <span class="math inline">\(F:R^3 \rightarrow R^3 = \langle F_x, F_y, F_z\rangle\)</span> be a vector field. Consider now a small box-like region, <span class="math inline">\(R\)</span>, with surface, <span class="math inline">\(S\)</span>, on the cartesian grid, with sides of length <span class="math inline">\(\Delta x\)</span>, <span class="math inline">\(\Delta y\)</span>, and <span class="math inline">\(\Delta z\)</span> with <span class="math inline">\((x,y,z)\)</span> being one corner. The outward pointing unit normals are <span class="math inline">\(\pm \hat{i}, \pm\hat{j},\)</span> and <span class="math inline">\(\pm\hat{k}\)</span>.</p>
<div class="cell" data-hold="true" data-execution_count="4">
<div class="cell-output cell-output-display" data-execution_count="5">
<p><img src="div_grad_curl_files/figure-html/cell-5-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>Consider the sides with outward normal <span class="math inline">\(\hat{i}\)</span>. The contribution to the surface integral, <span class="math inline">\(\oint_S (F\cdot\hat{N})dS\)</span>, could be <em>approximated</em> by</p>
<p><span class="math display">\[
\left(F(x + \Delta x, y, z) \cdot \hat{i}\right) \Delta y \Delta z,
\]</span></p>
<p>whereas, the contribution for the face with outward normal <span class="math inline">\(-\hat{i}\)</span> could be approximated by:</p>
<p><span class="math display">\[
\left(F(x, y, z) \cdot (-\hat{i}) \right) \Delta y \Delta z.
\]</span></p>
<p>The functions are being evaluated at a point on the face of the surface. For Riemann integrable functions, any point in a partition may be chosen, so our choice will not restrict the generality.</p>
<p>The total contribution of the two would be:</p>
<p><span class="math display">\[
\left(F(x + \Delta x, y, z) \cdot \hat{i}\right) \Delta y \Delta z +
\left(F(x, y, z) \cdot (-\hat{i})\right) \Delta y \Delta z =
\left(F_x(x + \Delta x, y, z) - F_x(x, y, z)\right) \Delta y \Delta z,
\]</span></p>
<p>as <span class="math inline">\(F \cdot \hat{i} = F_x\)</span>.</p>
<p><em>Were</em> we to divide by <span class="math inline">\(\Delta V = \Delta x \Delta y \Delta z\)</span> <em>and</em> take a limit as the volume shrinks, the limit would be <span class="math inline">\(\partial{F}/\partial{x}\)</span>.</p>
<p>If this is repeated for the other two pair of matching faces, we get a definition for the <em>divergence</em>:</p>
<blockquote class="blockquote">
<p>The <em>divergence</em> of a vector field <span class="math inline">\(F:R^3 \rightarrow R^3\)</span> is given by</p>
<p><span class="math display">\[
\text{divergence}(F) =
\lim \frac{1}{\Delta V} \oint_S F\cdot\hat{N} dS =
\frac{\partial{F_x}}{\partial{x}} +\frac{\partial{F_y}}{\partial{y}} +\frac{\partial{F_z}}{\partial{z}}.
\]</span></p>
</blockquote>
<p>The limit expression for the divergence will hold for any smooth closed surface, <span class="math inline">\(S\)</span>, converging on <span class="math inline">\((x,y,z)\)</span>, not just box-like ones.</p>
<section id="general-n" class="level3" data-number="61.1.1">
<h3 data-number="61.1.1" class="anchored" data-anchor-id="general-n"><span class="header-section-number">61.1.1</span> General <span class="math inline">\(n\)</span></h3>
<p>The derivation of the divergence is done for <span class="math inline">\(n=3\)</span>, but could also have easily been done for two dimensions (<span class="math inline">\(n=2\)</span>) or higher dimensions <span class="math inline">\(n&gt;3\)</span>. The formula in general would be: for <span class="math inline">\(F(x_1, x_2, \dots, x_n): R^n \rightarrow R^n\)</span>:</p>
<p><span class="math display">\[
\text{divergence}(F) = \sum_{i=1}^n \frac{\partial{F_i}}{\partial{x_i}}.
\]</span></p>
<hr>
<p>In <code>Julia</code>, the divergence can be implemented different ways depending on how the problem is presented. Here are two functions from the <code>CalculusWithJulia</code> package for when the problem is symbolic or numeric:</p>
<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">divergence</span>(F<span class="op">::</span><span class="dt">Vector{Sym}</span>, vars) <span class="op">=</span> <span class="fu">sum</span>(<span class="fu">diff</span>.(F, vars))</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="fu">divergence</span>(F<span class="op">::</span><span class="dt">Function</span>, pt) <span class="op">=</span> <span class="fu">sum</span>(<span class="fu">diag</span>(ForwardDiff.<span class="fu">jacobian</span>(F, pt)))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>The latter being a bit inefficient, as all <span class="math inline">\(n^2\)</span> partial derivatives are found, but only the <span class="math inline">\(n\)</span> diagonal ones are used.</p>
</section>
</section>
<section id="the-curl" class="level2" data-number="61.2">
<h2 data-number="61.2" class="anchored" data-anchor-id="the-curl"><span class="header-section-number">61.2</span> The curl</h2>
<p>Before considering the curl for <span class="math inline">\(n=3\)</span>, we derive a related quantity in <span class="math inline">\(n=2\)</span>. The “curl” will be a measure of the microscopic circulation of a vector field. To that end we consider a microscopic box-region in <span class="math inline">\(R^2\)</span>:</p>
<div class="cell" data-hold="true" data-execution_count="6">
<div class="cell-output cell-output-display" data-execution_count="6">
<p><img src="div_grad_curl_files/figure-html/cell-7-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>Let <span class="math inline">\(F=\langle F_x, F_y\rangle\)</span>. For small enough values of <span class="math inline">\(\Delta{x}\)</span> and <span class="math inline">\(\Delta{y}\)</span> the line integral, <span class="math inline">\(\oint_C F\cdot d\vec{r}\)</span> can be <em>approximated</em> by <span class="math inline">\(4\)</span> terms:</p>
<p><span class="math display">\[
\begin{align}
\left(F(x,y) \cdot \hat{i}\right)\Delta{x} &amp;+
\left(F(x+\Delta{x},y) \cdot \hat{j}\right)\Delta{y} +
\left(F(x,y+\Delta{y}) \cdot (-\hat{i})\right)\Delta{x} +
\left(F(x,y) \cdot (-\hat{j})\right)\Delta{x}\\
&amp;=
F_x(x,y) \Delta{x} + F_y(x+\Delta{x},y)\Delta{y} +
F_x(x, y+\Delta{y}) (-\Delta{x}) + F_y(x,y) (-\Delta{y})\\
&amp;=
(F_y(x + \Delta{x}, y) - F_y(x, y))\Delta{y} -
(F_x(x, y+\Delta{y})-F_x(x,y))\Delta{x}.
\end{align}
\]</span></p>
<p>The Riemann approximation allows a choice of evaluation point for Riemann integrable functions, and the choice here lends itself to further analysis. Were the above divided by <span class="math inline">\(\Delta{x}\Delta{y}\)</span>, the area of the box, and a limit taken, partial derivatives appear to suggest this formula:</p>
<p><span class="math display">\[
\lim \frac{1}{\Delta{x}\Delta{y}} \oint_C F\cdot d\vec{r} =
\frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}}.
\]</span></p>
<p>The scalar function on the right hand side is called the (two-dimensional) curl of <span class="math inline">\(F\)</span> and the left-hand side lends itself as a measure of the microscopic circulation of the vector field, <span class="math inline">\(F:R^2 \rightarrow R^2\)</span>.</p>
<hr>
<p>Consider now a similar scenario for the <span class="math inline">\(n=3\)</span> case. Let <span class="math inline">\(F=\langle F_x, F_y,F_z\rangle\)</span> be a vector field and <span class="math inline">\(S\)</span> a box-like region with side lengths <span class="math inline">\(\Delta x\)</span>, <span class="math inline">\(\Delta y\)</span>, and <span class="math inline">\(\Delta z\)</span>, anchored at <span class="math inline">\((x,y,z)\)</span>.</p>
<div class="cell" data-hold="true" data-execution_count="7">
<div class="cell-output cell-output-display" data-execution_count="7">
<p><img src="div_grad_curl_files/figure-html/cell-8-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The box-like volume in space with the top area, with normal <span class="math inline">\(\hat{k}\)</span>, designated as <span class="math inline">\(S_1\)</span>. The curve <span class="math inline">\(C_1\)</span> traces around <span class="math inline">\(S_1\)</span> in a counter clockwise manner, consistent with the right-hand rule pointing in the outward normal direction. The face <span class="math inline">\(S_1\)</span> with unit normal <span class="math inline">\(\hat{k}\)</span> looks like:</p>
<div class="cell" data-hold="true" data-execution_count="8">
<div class="cell-output cell-output-display" data-execution_count="8">
<p><img src="div_grad_curl_files/figure-html/cell-9-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>Now we compute the <em>line integral</em>. Consider the top face, <span class="math inline">\(S_1\)</span>, connecting <span class="math inline">\((x,y,z+\Delta z), (x + \Delta x, y, z + \Delta z), (x + \Delta x, y + \Delta y, z + \Delta z), (x, y + \Delta y, z + \Delta z)\)</span>, Using the <em>right hand rule</em>, parameterize the boundary curve, <span class="math inline">\(C_1\)</span>, in a counter clockwise direction so the right hand rule yields the outward pointing normal (<span class="math inline">\(\hat{k}\)</span>). Then the integral <span class="math inline">\(\oint_{C_1} F\cdot \hat{T} ds\)</span> is <em>approximated</em> by the following Riemann sum of <span class="math inline">\(4\)</span> terms:</p>
<p><span class="math display">\[
\begin{align*}
F(x,y, z+\Delta{z}) \cdot \hat{i}\Delta{x} &amp;+ F(x+\Delta x, y, z+\Delta{z}) \cdot \hat{j} \Delta y \\
&amp;+ F(x, y+\Delta y, z+\Delta{z}) \cdot (-\hat{i}) \Delta{x} \\
&amp;+ F(x, y, z+\Delta{z}) \cdot (-\hat{j}) \Delta{y}.
\end{align*}
\]</span></p>
<p>(The points <span class="math inline">\(c_i\)</span> are chosen from the endpoints of the line segments.)</p>
<p><span class="math display">\[
\begin{align*}
\oint_{C_1} F\cdot \hat{T} ds
&amp;\approx (F_y(x+\Delta x, y, z+\Delta{z}) \\
&amp;- F_y(x, y, z+\Delta{z})) \Delta{y} \\
&amp;- (F_x(x,y + \Delta{y}, z+\Delta{z}) \\
&amp;- F_x(x, y, z+\Delta{z})) \Delta{x}
\end{align*}
\]</span></p>
<p>As before, were this divided by the <em>area</em> of the surface, we have after rearranging and cancellation:</p>
<p><span class="math display">\[
\begin{align*}
\frac{1}{\Delta{S_1}} \oint_{C_1} F \cdot \hat{T} ds &amp;\approx
\frac{F_y(x+\Delta x, y, z+\Delta{z}) - F_y(x, y, z+\Delta{z})}{\Delta{x}}\\
&amp;- \frac{F_x(x, y+\Delta y, z+\Delta{z}) - F_x(x, y, z+\Delta{z})}{\Delta{y}}.
\end{align*}
\]</span></p>
<p>In the limit, as <span class="math inline">\(\Delta{S} \rightarrow 0\)</span>, this will converge to <span class="math inline">\(\partial{F_y}/\partial{x}-\partial{F_x}/\partial{y}\)</span>.</p>
<p>Had the bottom of the box been used, a similar result would be found, up to a minus sign.</p>
<p>Unlike the two dimensional case, there are other directions to consider and here the other sides will yield different answers. Consider now the face connecting <span class="math inline">\((x,y,z), (x+\Delta{x}, y, z), (x+\Delta{x}, y, z + \Delta{z})\)</span>, and $ (x,y,z+)$ with outward pointing normal <span class="math inline">\(-\hat{j}\)</span>. Let <span class="math inline">\(S_2\)</span> denote this face and <span class="math inline">\(C_2\)</span> describe its boundary. Orient this curve so that the right hand rule points in the <span class="math inline">\(-\hat{j}\)</span> direction (the outward pointing normal). Then, as before, we can approximate:</p>
<p><span class="math display">\[
\begin{align*}
\oint_{C_2} F \cdot \hat{T} ds
&amp;\approx
F(x,y,z) \cdot \hat{i} \Delta{x} \\
&amp;+ F(x+\Delta{x},y,z) \cdot \hat{k} \Delta{z} \\
&amp;+ F(x,y,z+\Delta{z}) \cdot (-\hat{i}) \Delta{x} \\
&amp;+ F(x, y, z) \cdot (-\hat{k}) \Delta{z}\\
&amp;= (F_z(x+\Delta{x},y,z) - F_z(x, y, z))\Delta{z} -
(F_x(x,y,z+\Delta{z}) - F(x,y,z)) \Delta{x}.
\end{align*}
\]</span></p>
<p>Dividing by <span class="math inline">\(\Delta{S}=\Delta{x}\Delta{z}\)</span> and taking a limit will give:</p>
<p><span class="math display">\[
\lim \frac{1}{\Delta{S}} \oint_{C_2} F \cdot \hat{T} ds =
\frac{\partial{F_z}}{\partial{x}} - \frac{\partial{F_x}}{\partial{z}}.
\]</span></p>
<p>Had, the opposite face with outward normal <span class="math inline">\(\hat{j}\)</span> been chosen, the answer would differ by a factor of <span class="math inline">\(-1\)</span>.</p>
<p>Similarly, let <span class="math inline">\(S_3\)</span> be the face with outward normal <span class="math inline">\(\hat{i}\)</span> and curve <span class="math inline">\(C_3\)</span> bounding it with parameterization chosen so that the right hand rule points in the direction of <span class="math inline">\(\hat{i}\)</span>. This will give</p>
<p><span class="math display">\[
\lim \frac{1}{\Delta{S}} \oint_{C_3} F \cdot \hat{T} ds =
\frac{\partial{F_z}}{\partial{y}} - \frac{\partial{F_y}}{\partial{z}}.
\]</span></p>
<p>In short, depending on the face chosen, a different answer is given, but all have the same type.</p>
<blockquote class="blockquote">
<p>Define the <em>curl</em> of a <span class="math inline">\(3\)</span>-dimensional vector field <span class="math inline">\(F=\langle F_x,F_y,F_z\rangle\)</span> by:</p>
<p><span class="math display">\[
\text{curl}(F) =
\langle \frac{\partial{F_z}}{\partial{y}} - \frac{\partial{F_y}}{\partial{z}},
\frac{\partial{F_x}}{\partial{z}} - \frac{\partial{F_z}}{\partial{x}},
\frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}} \rangle.
\]</span></p>
</blockquote>
<p>If <span class="math inline">\(S\)</span> is some surface with closed boundary <span class="math inline">\(C\)</span> oriented so that the unit normal, <span class="math inline">\(\hat{N}\)</span>, of <span class="math inline">\(S\)</span> is given by the right hand rule about <span class="math inline">\(C\)</span>, then</p>
<p><span class="math display">\[
\hat{N} \cdot \text{curl}(F) = \lim \frac{1}{\Delta{S}} \oint_C F \cdot \hat{T} ds.
\]</span></p>
<p>The curl has a formal representation in terms of a <span class="math inline">\(3\times 3\)</span> determinant, similar to that used to compute the cross product, that is useful for computation:</p>
<p><span class="math display">\[
\text{curl}(F) = \det\left[
\begin{array}{}
\hat{i} &amp; \hat{j} &amp; \hat{k}\\
\frac{\partial}{\partial{x}} &amp; \frac{\partial}{\partial{y}} &amp; \frac{\partial}{\partial{z}}\\
F_x &amp; F_y &amp; F_z
\end{array}
\right]
\]</span></p>
<hr>
<p>In <code>Julia</code>, the curl can be implemented different ways depending on how the problem is presented. We will use the Jacobian matrix to compute the required partials. If the Jacobian is known, this function from the <code>CalculusWithJulia</code> package will combine the off-diagonal terms appropriately:</p>
<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><span class="kw">function</span> <span class="fu">curl</span>(J<span class="op">::</span><span class="dt">Matrix</span>)</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> Mx, Nx, Px, My, Ny, Py, Mz, Nz, Pz <span class="op">=</span> J</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> [Py<span class="op">-</span>Nz, Mz<span class="op">-</span>Px, Nx<span class="op">-</span>My] <span class="co"># ∇×VF</span></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>The computation of the Jacobian differs whether the problem is treated numerically or symbolically. Here are two functions:</p>
<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><span class="fu">curl</span>(F<span class="op">::</span><span class="dt">Vector{Sym}</span>, vars<span class="op">=</span><span class="fu">free_symbols</span>(F)) <span class="op">=</span> <span class="fu">curl</span>(F.<span class="fu">jacobian</span>(vars))</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="fu">curl</span>(F<span class="op">::</span><span class="dt">Function</span>, pt) <span class="op">=</span> <span class="fu">curl</span>(ForwardDiff.<span class="fu">jacobian</span>(F, pt))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<section id="the-nabla-del-operator" class="level3" data-number="61.2.1">
<h3 data-number="61.2.1" class="anchored" data-anchor-id="the-nabla-del-operator"><span class="header-section-number">61.2.1</span> The <span class="math inline">\(\nabla\)</span> (del) operator</h3>
<p>The divergence, gradient, and curl all involve partial derivatives. There is a notation employed that can express the operations more succinctly. Let the <a href="https://en.wikipedia.org/wiki/Del">Del operator</a> be defined in Cartesian coordinates by the formal expression:</p>
<blockquote class="blockquote">
<p><span class="math display">\[
\nabla = \langle
\frac{\partial}{\partial{x}},
\frac{\partial}{\partial{y}},
\frac{\partial}{\partial{z}}
\rangle.
\]</span></p>
</blockquote>
<p>This is a <em>vector differential operator</em> that acts on functions and vector fields through the typical notation to yield the three operations:</p>
<p><span class="math display">\[
\begin{align*}
\nabla{f} &amp;= \langle
\frac{\partial{f}}{\partial{x}},
\frac{\partial{f}}{\partial{y}},
\frac{\partial{f}}{\partial{z}}
\rangle, \quad\text{the gradient;}\\
\nabla\cdot{F} &amp;= \langle
\frac{\partial}{\partial{x}},
\frac{\partial}{\partial{y}},
\frac{\partial}{\partial{z}}
\rangle \cdot F \\
&amp;=
\langle
\frac{\partial}{\partial{x}},
\frac{\partial}{\partial{y}},
\frac{\partial}{\partial{z}}
\rangle \cdot
\langle F_x, F_y, F_z \rangle \\
&amp;=
\frac{\partial{F_x}}{\partial{x}} +
\frac{\partial{F_y}}{\partial{y}} +
\frac{\partial{F_z}}{\partial{z}},\quad\text{the divergence;}\\
\nabla\times F &amp;= \langle
\frac{\partial}{\partial{x}},
\frac{\partial}{\partial{y}},
\frac{\partial}{\partial{z}}
\rangle \times F =
\det\left[
\begin{array}{}
\hat{i} &amp; \hat{j} &amp; \hat{k} \\
\frac{\partial}{\partial{x}}&amp;
\frac{\partial}{\partial{y}}&amp;
\frac{\partial}{\partial{z}}\\
F_x &amp; F_y &amp; F_z
\end{array}
\right],\quad\text{the curl}.
\end{align*}
\]</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>Mathematically operators have not been seen previously, but the concept of an operation on a function that returns another function is a common one when using <code>Julia</code>. We have seen many examples (<code>plot</code>, <code>D</code>, <code>quadgk</code>, etc.). In computer science such functions are called <em>higher order</em> functions, as they accept arguments which are also functions.</p>
</div>
</div>
<hr>
<p>In the <code>CalculusWithJulia</code> package, the constant <code>\nabla[\tab]</code>, producing <span class="math inline">\(\nabla\)</span> implements this operator for functions and symbolic expressions.</p>
<div class="cell" data-execution_count="11">
<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="pp">@syms</span> x<span class="op">::</span><span class="dt">real </span>y<span class="op">::</span><span class="dt">real </span>z<span class="op">::</span><span class="dt">real</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">
<pre><code>(x, y, z)</code></pre>
</div>
</div>
<div class="cell" data-execution_count="12">
<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<span class="op">*</span>z</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">F</span>(x,y,z) <span class="op">=</span> [x, y, z]</span>
<span id="cb7-4"><a href="#cb7-4" 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-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a><span class="fu"></span>(<span class="fu">f</span>(x,y,z)) <span class="co"># symbolic operation on the symbolic expression f(x,y,z)</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="10">
<pre><code>3-element Vector{Sym}:
y⋅z
x⋅z
x⋅y</code></pre>
</div>
</div>
<p>This usage of <code></code> takes partial derivatives according to the order given by:</p>
<div class="cell" data-execution_count="13">
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">free_symbols</span>(<span class="fu">f</span>(x,y,z))</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>3-element Vector{Sym}:
x
y
z</code></pre>
</div>
</div>
<p>which may <strong>not</strong> be as desired. In this case, the variables can be specified using a tuple to pair up the expression with the variables to differentiate against:</p>
<div class="cell" data-execution_count="14">
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu"></span>( (<span class="fu">f</span>(x,y,z), [x,y,z]) )</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>3-element Vector{Sym}:
y⋅z
x⋅z
x⋅y</code></pre>
</div>
</div>
<p>For numeric expressions, we have:</p>
<div class="cell" data-execution_count="15">
<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu"></span>(f)(<span class="fl">1</span>,<span class="fl">2</span>,<span class="fl">3</span>) <span class="co"># a numeric computation. Also can call with a point [1,2,3]</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="13">
<pre><code>3-element Vector{Int64}:
6
3
2</code></pre>
</div>
</div>
<p>(The extra parentheses are unfortunate. Here <code></code> is called like a function.)</p>
<p>The divergence can be found symbolically:</p>
<div class="cell" data-execution_count="16">
<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="op"></span> <span class="fu">F</span>(x,y,z)</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">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
3
\]
</span>
</div>
</div>
<p>Or numerically:</p>
<div class="cell" data-execution_count="17">
<div class="sourceCode cell-code" id="cb16"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a>(∇ <span class="op"></span> F)(<span class="fl">1</span>,<span class="fl">2</span>,<span class="fl">3</span>) <span class="co"># a numeric computation. Also can call (∇ ⋅ F)([1,2,3])</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>3.0</code></pre>
</div>
</div>
<p>Similarly, the curl. Symbolically:</p>
<div class="cell" data-execution_count="18">
<div class="sourceCode cell-code" id="cb18"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="op">×</span> <span class="fu">F</span>(x,y,z)</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="16">
<pre><code>3-element Vector{Sym}:
0
0
0</code></pre>
</div>
</div>
<p>and numerically:</p>
<div class="cell" data-execution_count="19">
<div class="sourceCode cell-code" id="cb20"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a>(∇ <span class="op">×</span> F)(<span class="fl">1</span>,<span class="fl">2</span>,<span class="fl">3</span>) <span class="co"># numeric. Also can call (∇ × F)([1,2,3])</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>3-element Vector{Float64}:
0.0
0.0
0.0</code></pre>
</div>
</div>
<p>There is a subtle difference in usage. Symbolically the evaluation of <code>F(x,y,z)</code> first is desired, numerically the evaluation of <code>∇ ⋅ F</code> or <code>× F</code> first is desired. As <code></code> and <code>×</code> have lower precedence than function evaluation, parentheses must be used in the numeric case.</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>As mentioned, for the symbolic evaluations, a specification of three variables (here <code>x</code>, <code>y</code>, and <code>z</code>) is necessary. This use takes <code>free_symbols</code> to identify three free symbols which may not always be the case. (It wouldnt be for, say, <code>F(x,y,z) = [a*x,b*y,0]</code>, <code>a</code> and <code>b</code> constants.) In those cases, the notation accepts a tuple to specify the function or vector field and the variables, e.g.&nbsp;(<code>∇( (f(x,y,z), [x,y,z]) )</code>, as illustrated; <code>× (F(x,y,z), [x,y,z])</code>; or <code>∇ ⋅ (F(x,y,z), [x,y,z])</code> where this is written using function calls to produce the symbolic expression in the first positional argument, though a direct expression could also be used. In these cases, the named versions <code>gradient</code>, <code>curl</code>, and <code>divergence</code> may be preferred.</p>
</div>
</div>
</section>
</section>
<section id="interpretation" class="level2" data-number="61.3">
<h2 data-number="61.3" class="anchored" data-anchor-id="interpretation"><span class="header-section-number">61.3</span> Interpretation</h2>
<p>The divergence and curl measure complementary aspects of a vector field. The divergence is defined in terms of flow out of an infinitesimal box, the curl is about rotational flow around an infinitesimal area patch.</p>
<p>Let <span class="math inline">\(F(x,y,z) = [x, 0, 0]\)</span>, a vector field pointing in just the <span class="math inline">\(\hat{i}\)</span> direction. The divergence is simply <span class="math inline">\(1\)</span>. If <span class="math inline">\(V\)</span> is a box, as in the derivation, then the divergence measures the flow into the side with outward normal <span class="math inline">\(-\hat{i}\)</span> and through the side with outward normal <span class="math inline">\(\hat{i}\)</span> which will clearly be positive as the flow passes through the region <span class="math inline">\(V\)</span>, increasing as <span class="math inline">\(x\)</span> increases, when <span class="math inline">\(x &gt; 0\)</span>.</p>
<p>The radial vector field <span class="math inline">\(F(x,y,z) = \langle x, y, z \rangle\)</span> is also an example of a divergent field. The divergence is:</p>
<div class="cell" data-hold="true" data-execution_count="20">
<div class="sourceCode cell-code" id="cb22"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="fu">F</span>(x,y,z) <span class="op">=</span> [x,y,z]</span>
<span id="cb22-2"><a href="#cb22-2" aria-hidden="true" tabindex="-1"></a><span class="op"></span> <span class="fu">F</span>(x,y,z)</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">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
3
\]
</span>
</div>
</div>
<p>There is a constant outward flow, emanating from the origin. Here we picture the field when <span class="math inline">\(z=0\)</span>:</p>
<div class="cell" data-hold="true" data-execution_count="21">
<div class="cell-output cell-output-display" data-execution_count="19">
<p><img src="div_grad_curl_files/figure-html/cell-22-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>Consider the limit definition of the divergence:</p>
<p><span class="math display">\[
\nabla\cdot{F} = \lim \frac{1}{\Delta{V}} \oint_S F\cdot\hat{N} dA.
\]</span></p>
<p>In the vector field above, the shape along the curved edges has constant magnitude field. On the left curved edge, the length is smaller and the field is smaller than on the right. The flux across the left edge will be less than the flux across the right edge, and a net flux will exist. That is, there is divergence.</p>
<p>Now, were the field on the right edge less, it might be that the two balance out and there is no divergence. This occurs with the inverse square laws, such as for gravity and electric field:</p>
<div class="cell" data-hold="true" data-execution_count="22">
<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>R <span class="op">=</span> [x,y,z]</span>
<span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a>Rhat <span class="op">=</span> R<span class="op">/</span><span class="fu">norm</span>(R)</span>
<span id="cb23-3"><a href="#cb23-3" aria-hidden="true" tabindex="-1"></a>VF <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> Rhat</span>
<span id="cb23-4"><a href="#cb23-4" aria-hidden="true" tabindex="-1"></a><span class="op"></span> VF <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="20">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
0
\]
</span>
</div>
</div>
<hr>
<p>The vector field <span class="math inline">\(F(x,y,z) = \langle -y, x, 0 \rangle\)</span> is an example of a rotational field. Its curl can be computed symbolically through:</p>
<div class="cell" data-execution_count="23">
<div class="sourceCode cell-code" id="cb24"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a><span class="fu">curl</span>([<span class="op">-</span>y,x,<span class="fl">0</span>], [x,y,z])</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">
<pre><code>3-element Vector{Sym}:
0
0
2</code></pre>
</div>
</div>
<p>This vector field rotates as seen in this figure showing slices for different values of <span class="math inline">\(z\)</span>:</p>
<div class="cell" data-hold="true" data-execution_count="24">
<div class="cell-output cell-output-display" data-execution_count="22">
<p><img src="div_grad_curl_files/figure-html/cell-25-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The field has a clear rotation about the <span class="math inline">\(z\)</span> axis (illustrated with a line), the curl is a vector that points in the direction of the <em>right hand</em> rule as the right hand fingers follow the flow with magnitude given by the amount of rotation.</p>
<p>This is a bit misleading though, the curl is defined by a limit, and not in terms of a large box. The key point for this field is that the strength of the field is stronger as the points get farther away, so for a properly oriented small box, the integral along the closer edge will be less than that along the outer edge.</p>
<p>Consider a related field where the strength gets smaller as the point gets farther away but otherwise has the same circular rotation pattern</p>
<div class="cell" data-hold="true" data-execution_count="25">
<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>R <span class="op">=</span> [<span class="op">-</span>y, x, <span class="fl">0</span>]</span>
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true" tabindex="-1"></a>VF <span class="op">=</span> R <span class="op">/</span> <span class="fu">norm</span>(R)<span class="op">^</span><span class="fl">2</span></span>
<span id="cb26-3"><a href="#cb26-3" aria-hidden="true" tabindex="-1"></a><span class="fu">curl</span>(VF, [x,y,z]) <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="23">
<pre><code>3-element Vector{Sym}:
0
0
0</code></pre>
</div>
</div>
<p>Further, the curl of <code>R/norm(R)^3</code> now points in the <em>opposite</em> direction of the curl of <code>R</code>. This example isnt typical, as dividing by <code>norm(R)</code> with a power greater than <span class="math inline">\(1\)</span> makes the vector field discontinuous at the origin.</p>
<p>The curl of the vector field <span class="math inline">\(F(x,y,z) = \langle 0, 1+y^2, 0\rangle\)</span> is <span class="math inline">\(0\)</span>, as there is clearly no rotation as seen in this slice where <span class="math inline">\(z=0\)</span>:</p>
<div class="cell" data-hold="true" data-execution_count="26">
<div class="cell-output cell-output-display" data-execution_count="24">
<p><img src="div_grad_curl_files/figure-html/cell-27-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>Algebraically, this is so:</p>
<div class="cell" data-execution_count="27">
<div class="sourceCode cell-code" id="cb28"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a><span class="fu">curl</span>(Sym[<span class="fl">0</span>,<span class="fl">1</span><span class="op">+</span>y<span class="op">^</span><span class="fl">2</span>,<span class="fl">0</span>], [x,y,z])</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="25">
<pre><code>3-element Vector{Sym}:
0
0
0</code></pre>
</div>
</div>
<p>Now consider a similar field <span class="math inline">\(F(x,y,z) = \langle 0, 1+x^2, 0,\rangle\)</span>. A slice is somewhat similar, in that the flow lines are all in the <span class="math inline">\(\hat{j}\)</span> direction:</p>
<div class="cell" data-hold="true" data-execution_count="28">
<div class="cell-output cell-output-display" data-execution_count="26">
<p><img src="div_grad_curl_files/figure-html/cell-29-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>However, this vector field has a curl:</p>
<div class="cell" data-execution_count="29">
<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="fu">curl</span>([<span class="fl">0</span>, <span class="fl">1</span><span class="op">+</span>x<span class="op">^</span><span class="fl">2</span>,<span class="fl">0</span>], [x,y,z])</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="27">
<pre><code>3-element Vector{Sym}:
0
0
2⋅x</code></pre>
</div>
</div>
<p>The curl points in the <span class="math inline">\(\hat{k}\)</span> direction (out of the figure). A useful visualization is to mentally place a small paddlewheel at a point and imagine if it will turn. In the constant field case, there is equal flow on both sides of the axis, so it any forces on the wheel blades will balance out. In the latter example, if <span class="math inline">\(x &gt; 0\)</span>, the force on the right side will be greater than the force on the left so the paddlewheel would rotate counter clockwise. The right hand rule for this rotation will point in the upward, or <span class="math inline">\(\hat{k}\)</span> direction, as seen algebraically in the curl.</p>
<p>Following Strang, in general the curl can point in any direction, so the amount the paddlewheel will spin will be related to how the paddlewheel is oriented. The angular velocity of the wheel will be <span class="math inline">\((1/2)(\nabla\times{F})\cdot\hat{N}\)</span>, <span class="math inline">\(\hat{N}\)</span> being the normal for the paddlewheel.</p>
<p>If <span class="math inline">\(\vec{a}\)</span> is some vector and <span class="math inline">\(\hat{r} = \langle x, y, z\rangle\)</span> is the radial vector, then <span class="math inline">\(\vec{a} \times \vec{r}\)</span> has a curl, which is given by:</p>
<div class="cell" data-hold="true" data-execution_count="30">
<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="pp">@syms</span> a1 a2 a3</span>
<span id="cb32-2"><a href="#cb32-2" aria-hidden="true" tabindex="-1"></a>a <span class="op">=</span> [a1, a2, a3]</span>
<span id="cb32-3"><a href="#cb32-3" aria-hidden="true" tabindex="-1"></a>r <span class="op">=</span> [x, y, z]</span>
<span id="cb32-4"><a href="#cb32-4" aria-hidden="true" tabindex="-1"></a><span class="fu">curl</span>(a <span class="op">×</span> r, [x,y, z])</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="28">
<pre><code>3-element Vector{Sym}:
2⋅a₁
2⋅a₂
2⋅a₃</code></pre>
</div>
</div>
<p>The angular velocity then is <span class="math inline">\(\vec{a} \cdot \hat{N}\)</span>. The curl is constant. As the dot product involves the cosine of the angle between the two vectors, we see the turning speed is largest when <span class="math inline">\(\hat{N}\)</span> is parallel to <span class="math inline">\(\vec{a}\)</span>. This gives a similar statement for the curl like the gradient does for steepest growth rate: the maximum rotation rate of <span class="math inline">\(F\)</span> is <span class="math inline">\((1/2)\|\nabla\times{F}\|\)</span> in the direction of <span class="math inline">\(\nabla\times{F}\)</span>.</p>
<p>The curl of the radial vector field, <span class="math inline">\(F(x,y,z) = \langle x, y, z\rangle\)</span> will be <span class="math inline">\(\vec{0}\)</span>:</p>
<div class="cell" data-execution_count="31">
<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">curl</span>([x,y,z], [x,y,z])</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">
<pre><code>3-element Vector{Sym}:
0
0
0</code></pre>
</div>
</div>
<p>We will see that this can be anticipated, as <span class="math inline">\(F = (1/2) \nabla(x^2+y^2+z^2)\)</span> is a gradient field.</p>
<p>In fact, the curl of any radial field will be <span class="math inline">\(\vec{0}\)</span>. Here we represent a radial field as a scalar function of <span class="math inline">\(\vec{r}\)</span> time <span class="math inline">\(\hat{r}\)</span>:</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><span class="pp">@syms</span> <span class="fu">H</span>()</span>
<span id="cb36-2"><a href="#cb36-2" aria-hidden="true" tabindex="-1"></a>R <span class="op">=</span> <span class="fu">sqrt</span>(x<span class="op">^</span><span class="fl">2</span> <span class="op">+</span> y<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="cb36-3"><a href="#cb36-3" aria-hidden="true" tabindex="-1"></a>Rhat <span class="op">=</span> [x, y, z]<span class="op">/</span>R</span>
<span id="cb36-4"><a href="#cb36-4" aria-hidden="true" tabindex="-1"></a><span class="fu">curl</span>(<span class="fu">H</span>(R) <span class="op">*</span> Rhat, [x, y, z])</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-element Vector{Sym}:
0
0
0</code></pre>
</div>
</div>
<p>Were one to represent the curl in <a href="https://en.wikipedia.org/wiki/Del_in_cylindrical_and_spherical_coordinates">spherical</a> coordinates (below), this follows algebraically from the formula easily enough. To anticipate this, due to symmetry, the curl would need to be the same along any ray emanating from the origin and again by symmetry could only possible point along the ray. Mentally place a paddlewheel along the <span class="math inline">\(x\)</span> axis oriented along <span class="math inline">\(\hat{i}\)</span>. There will be no rotational forces that could make the wheel spin around the <span class="math inline">\(x\)</span>-axis, hence the curl must be <span class="math inline">\(0\)</span>.</p>
</section>
<section id="the-maxwell-equations" class="level2" data-number="61.4">
<h2 data-number="61.4" class="anchored" data-anchor-id="the-maxwell-equations"><span class="header-section-number">61.4</span> The Maxwell equations</h2>
<p>The divergence and curl appear in <a href="https://en.wikipedia.org/wiki/Maxwell%27s_equations">Maxwell</a>s equations describing the relationships of electromagnetism. In the formulas below the notation is <span class="math inline">\(E\)</span> is the electric field; <span class="math inline">\(B\)</span> is the magnetic field; <span class="math inline">\(\rho\)</span> is the charge <em>density</em> (charge per unit volume); <span class="math inline">\(J\)</span> the electric current density (current per unit area); and <span class="math inline">\(\epsilon_0\)</span>, <span class="math inline">\(\mu_0\)</span>, and <span class="math inline">\(c\)</span> are universal constants.</p>
<p>The equations in differential form are:</p>
<blockquote class="blockquote">
<p>Gausss law: <span class="math inline">\(\nabla\cdot{E} = \rho/\epsilon_0\)</span>.</p>
</blockquote>
<p>That is, the divergence of the electric field is proportional to the density. We have already mentioned this in <em>integral</em> form.</p>
<blockquote class="blockquote">
<p>Gausss law of magnetism: <span class="math inline">\(\nabla\cdot{B} = 0\)</span></p>
</blockquote>
<p>The magnetic field has no divergence. This says that there no magnetic charges (a magnetic monopole) unlike electric charge, according to Maxwells laws.</p>
<blockquote class="blockquote">
<p>Faradays law of induction: <span class="math inline">\(\nabla\times{E} = - \partial{B}/\partial{t}\)</span>.</p>
</blockquote>
<p>The curl of the <em>time-varying</em> electric field is in the direction of the partial derivative of the magnetic field. For example, if a magnet is in motion in the in the <span class="math inline">\(z\)</span> axis, then the electric field has rotation in the <span class="math inline">\(x-y\)</span> plane <em>induced</em> by the motion of the magnet.</p>
<blockquote class="blockquote">
<p>Amperes circuital law: <span class="math inline">\(\nabla\times{B} = \mu_0J + \mu_0\epsilon_0 \partial{E}/\partial{t}\)</span></p>
</blockquote>
<p>The curl of the magnetic field is related to the sum of the electric current density and the change in time of the electric field.</p>
<hr>
<p>In a region with no charges (<span class="math inline">\(\rho=0\)</span>) and no currents (<span class="math inline">\(J=\vec{0}\)</span>), such as a vacuum, these equations reduce to two divergences being <span class="math inline">\(0\)</span>: <span class="math inline">\(\nabla\cdot{E} = 0\)</span> and <span class="math inline">\(\nabla\cdot{B}=0\)</span>; and two curl relationships with time derivatives: <span class="math inline">\(\nabla\times{E}= -\partial{B}/\partial{t}\)</span> and <span class="math inline">\(\nabla\times{B} = \mu_0\epsilon_0 \partial{E}/\partial{t}\)</span>.</p>
<p>We will see later how these are differential forms are consequences of related integral forms.</p>
</section>
<section id="algebra-of-vector-calculus" class="level2" data-number="61.5">
<h2 data-number="61.5" class="anchored" data-anchor-id="algebra-of-vector-calculus"><span class="header-section-number">61.5</span> Algebra of vector calculus</h2>
<p>The divergence, gradient, and curl satisfy several algebraic <a href="https://en.wikipedia.org/wiki/Vector_calculus_identities">properties</a>.</p>
<p>Let <span class="math inline">\(f\)</span> and <span class="math inline">\(g\)</span> denote scalar functions, <span class="math inline">\(R^3 \rightarrow R\)</span> and <span class="math inline">\(F\)</span> and <span class="math inline">\(G\)</span> be vector fields, <span class="math inline">\(R^3 \rightarrow R^3\)</span>.</p>
<section id="linearity" class="level3" data-number="61.5.1">
<h3 data-number="61.5.1" class="anchored" data-anchor-id="linearity"><span class="header-section-number">61.5.1</span> Linearity</h3>
<p>As with the sum rule of univariate derivatives, these operations satisfy:</p>
<p><span class="math display">\[
\begin{align}
\nabla(f + g) &amp;= \nabla{f} + \nabla{g}\\
\nabla\cdot(F+G) &amp;= \nabla\cdot{F} + \nabla\cdot{G}\\
\nabla\times(F+G) &amp;= \nabla\times{F} + \nabla\times{G}.
\end{align}
\]</span></p>
</section>
<section id="product-rule" class="level3" data-number="61.5.2">
<h3 data-number="61.5.2" class="anchored" data-anchor-id="product-rule"><span class="header-section-number">61.5.2</span> Product rule</h3>
<p>The product rule <span class="math inline">\((uv)' = u'v + uv'\)</span> has related formulas:</p>
<p><span class="math display">\[
\begin{align}
\nabla{(fg)} &amp;= (\nabla{f}) g + f\nabla{g} = g\nabla{f} + f\nabla{g}\\
\nabla\cdot{fF} &amp;= (\nabla{f})\cdot{F} + f(\nabla\cdot{F})\\
\nabla\times{fF} &amp;= (\nabla{f})\times{F} + f(\nabla\times{F}).
\end{align}
\]</span></p>
</section>
<section id="rules-over-cross-products" class="level3" data-number="61.5.3">
<h3 data-number="61.5.3" class="anchored" data-anchor-id="rules-over-cross-products"><span class="header-section-number">61.5.3</span> Rules over cross products</h3>
<p>The cross product of two vector fields is a vector field for which the divergence and curl may be taken. There are formulas to relate to the individual terms:</p>
<p><span class="math display">\[
\begin{align}
\nabla\cdot(F \times G) &amp;= (\nabla\times{F})\cdot G - F \cdot (\nabla\times{G})\\
\nabla\times(F \times G) &amp;= F(\nabla\cdot{G}) - G(\nabla\cdot{F} + (G\cdot\nabla)F-(F\cdot\nabla)G\\
&amp;= \nabla\cdot(BA^t - AB^t).
\end{align}
\]</span></p>
<p>The curl formula is more involved.</p>
</section>
<section id="vanishing-properties" class="level3" data-number="61.5.4">
<h3 data-number="61.5.4" class="anchored" data-anchor-id="vanishing-properties"><span class="header-section-number">61.5.4</span> Vanishing properties</h3>
<p>Surprisingly, the curl and divergence satisfy two vanishing properties. First</p>
<blockquote class="blockquote">
<p>The curl of a gradient field is <span class="math inline">\(\vec{0}\)</span></p>
<p><span class="math display">\[
\nabla \times \nabla{f} = \vec{0},
\]</span></p>
</blockquote>
<p>if the scalar function <span class="math inline">\(f\)</span> is has continuous second derivatives (so the mixed partials do not depend on order).</p>
<p>Vector fields where <span class="math inline">\(F = \nabla{f}\)</span> are conservative. Conservative fields have path independence, so any line integral, <span class="math inline">\(\oint F\cdot \hat{T} ds\)</span>, around a closed loop will be <span class="math inline">\(0\)</span>. But the curl is defined as a limit of such integrals, so it too will be <span class="math inline">\(\vec{0}\)</span>. In short, conservative fields have no rotation.</p>
<p>What about the converse? If a vector field has zero curl, then integrals around infinitesimally small loops are <span class="math inline">\(0\)</span>. Does this <em>also</em> mean that integrals around larger closed loops will also be <span class="math inline">\(0\)</span>, and hence the field is conservative? The answer will be yes, <em>under assumptions</em>. But the discussion will wait for later.</p>
<p>The combination <span class="math inline">\(\nabla\cdot\nabla{f}\)</span> is defined and is called the Laplacian. This is denoted <span class="math inline">\(\Delta{f}\)</span>. The equation <span class="math inline">\(\Delta{f} = 0\)</span> is called Laplaces equation. It is <em>not</em> guaranteed for any scalar function <span class="math inline">\(f\)</span>, but the <span class="math inline">\(f\)</span> for which it holds are important.</p>
<p>Second,</p>
<blockquote class="blockquote">
<p>The divergence of a curl field is <span class="math inline">\(0\)</span>:</p>
<p><span class="math display">\[
\nabla \cdot(\nabla\times{F}) = 0.
\]</span></p>
</blockquote>
<p>This is not as clear, but can be seen algebraically as terms cancel. First:</p>
<p><span class="math display">\[
\begin{align*}
\nabla\cdot(\nabla\times{F}) &amp;=
\langle
\frac{\partial}{\partial{x}},
\frac{\partial}{\partial{y}},
\frac{\partial}{\partial{z}}\rangle \cdot
\langle
\frac{\partial{F_z}}{\partial{y}} - \frac{\partial{F_y}}{\partial{z}},
\frac{\partial{F_x}}{\partial{z}} - \frac{\partial{F_z}}{\partial{x}},
\frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}}
\rangle \\
&amp;=
\left(\frac{\partial^2{F_z}}{\partial{y}\partial{x}} - \frac{\partial^2{F_y}}{\partial{z}\partial{x}}\right) +
\left(\frac{\partial^2{F_x}}{\partial{z}\partial{y}} - \frac{\partial^2{F_z}}{\partial{x}\partial{y}}\right) +
\left(\frac{\partial^2{F_y}}{\partial{x}\partial{z}} - \frac{\partial^2{F_x}}{\partial{y}\partial{z}}\right)
\end{align*}
\]</span></p>
<p>Focusing on one component function, <span class="math inline">\(F_z\)</span> say, we see this contribution:</p>
<p><span class="math display">\[
\frac{\partial^2{F_z}}{\partial{y}\partial{x}} -
\frac{\partial^2{F_z}}{\partial{x}\partial{y}}.
\]</span></p>
<p>This is zero under the assumption that the second partial derivatives are continuous.</p>
<p>From the microscopic picture of a box this can also be seen. Again we focus on just the appearance of the <span class="math inline">\(F_z\)</span> component function. Let the faces with normals <span class="math inline">\(\hat{i}, \hat{j},-\hat{i}, -\hat{j}\)</span> be labeled <span class="math inline">\(A, B, C\)</span>, and <span class="math inline">\(D\)</span>. This figure shows <span class="math inline">\(A\)</span> (enclosed in blue) and <span class="math inline">\(B\)</span> (enclosed in green):</p>
<div class="cell" data-hold="true" data-execution_count="33">
<div class="cell-output cell-output-display" data-execution_count="31">
<p><img src="div_grad_curl_files/figure-html/cell-34-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>We will get from the <em>approximate</em> surface integral of the <em>approximate</em> curl the following terms:</p>
<div class="cell" data-hold="true" data-execution_count="34">
<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> x y z Δx Δy Δz</span>
<span id="cb38-2"><a href="#cb38-2" aria-hidden="true" tabindex="-1"></a>p1, p2, p3, p4<span class="op">=</span>(x, y, z), (x <span class="op">+</span> Δx, y, z), (x <span class="op">+</span> Δx, y <span class="op">+</span> Δy, z), (x, y <span class="op">+</span> Δy, z)</span>
<span id="cb38-3"><a href="#cb38-3" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> <span class="fu">F_z</span>()</span>
<span id="cb38-4"><a href="#cb38-4" aria-hidden="true" tabindex="-1"></a><span class="kw">global</span> exₐ <span class="op">=</span> (<span class="fu">-F_z</span>(p2<span class="op">...</span>) <span class="op">+</span> <span class="fu">F_z</span>(p3<span class="op">...</span>))<span class="op">*</span>Δz <span class="op">+</span> <span class="co"># face A</span></span>
<span id="cb38-5"><a href="#cb38-5" aria-hidden="true" tabindex="-1"></a>(<span class="fu">-F_z</span>(p3<span class="op">...</span>) <span class="op">+</span> <span class="fu">F_z</span>(p4<span class="op">...</span>))<span class="op">*</span>Δz <span class="op">+</span> <span class="co"># face B</span></span>
<span id="cb38-6"><a href="#cb38-6" aria-hidden="true" tabindex="-1"></a>(<span class="fu">F_z</span>(p1<span class="op">...</span>) <span class="op">-</span> <span class="fu">F_z</span>(p4<span class="op">...</span>))<span class="op">*</span>Δz <span class="op">+</span> <span class="co"># face C</span></span>
<span id="cb38-7"><a href="#cb38-7" aria-hidden="true" tabindex="-1"></a>(<span class="fu">F_z</span>(p2<span class="op">...</span>) <span class="op">-</span> <span class="fu">F_z</span>(p1<span class="op">...</span>))<span class="op">*</span>Δz <span class="co"># face D</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="32">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
Δz \left(- \operatorname{F_{z}}{\left(x,y,z \right)} + \operatorname{F_{z}}{\left(x + Δx,y,z \right)}\right) + Δz \left(\operatorname{F_{z}}{\left(x,y,z \right)} - \operatorname{F_{z}}{\left(x,y + Δy,z \right)}\right) + Δz \left(\operatorname{F_{z}}{\left(x,y + Δy,z \right)} - \operatorname{F_{z}}{\left(x + Δx,y + Δy,z \right)}\right) + Δz \left(- \operatorname{F_{z}}{\left(x + Δx,y,z \right)} + \operatorname{F_{z}}{\left(x + Δx,y + Δy,z \right)}\right)
\]
</span>
</div>
</div>
<p>The term for face <span class="math inline">\(A\)</span>, say, should be divided by <span class="math inline">\(\Delta{y}\Delta{z}\)</span> for the curl approximation, but this will be multiplied by the same amount for the divergence calculation, so it isnt written.</p>
<p>The expression above simplifies to:</p>
<div class="cell" data-execution_count="35">
<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="fu">simplify</span>(exₐ)</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">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
0
\]
</span>
</div>
</div>
<p>This is because of how the line integrals are oriented so that the right-hand rule gives outward pointing normals. For each up stroke for one face, there is a downstroke for a different face, and so the corresponding terms cancel each other out. So providing the limit of these two approximations holds, the vanishing identity can be anticipated from the microscopic picture.</p>
<section id="example" class="level5">
<h5 class="anchored" data-anchor-id="example">Example</h5>
<p>The <a href="https://en.wikipedia.org/wiki/Maxwell%27s_equations#Charge_conservation">invariance of charge</a> can be derived as a corollary of Maxwells equation. The divergence of the curl of the magnetic field is <span class="math inline">\(0\)</span>, leading to:</p>
<pre class="{mat}"><code>\begin{align*}
0 &amp;= \nabla\cdot(\nabla\times{B}) \\
&amp;=
\mu_0(\nabla\cdot{J} + \epsilon_0 \nabla\cdot{\frac{\partial{E}}{\partial{t}}}) \\
&amp;=
\mu_0(\nabla\cdot{J} + \epsilon_0 \frac{\partial}{\partial{t}}(\nabla\cdot{E})) \\
&amp;=
\mu_0(\nabla\cdot{J} + \frac{\partial{\rho}}{\partial{t}}).
\end{align*}</code></pre>
<p>That is <span class="math inline">\(\nabla\cdot{J} = -\partial{\rho}/\partial{t}\)</span>. This says any change in the charge density in time (<span class="math inline">\(\partial{\rho}/\partial{t}\)</span>) is balanced off by a divergence in the electric current density (<span class="math inline">\(\nabla\cdot{J}\)</span>). That is, charge cant be created or destroyed in an isolated system.</p>
</section>
</section>
</section>
<section id="fundamental-theorem-of-vector-calculus" class="level2" data-number="61.6">
<h2 data-number="61.6" class="anchored" data-anchor-id="fundamental-theorem-of-vector-calculus"><span class="header-section-number">61.6</span> Fundamental theorem of vector calculus</h2>
<p>The divergence and curl are complementary ideas. Are there other distinct ideas to sort a vector field by? The Helmholtz decomposition says not really. It states that vector fields that decay rapidly enough can be expressed in terms of two pieces: one with no curl and one with no divergence.</p>
<p>From <a href="https://en.wikipedia.org/wiki/Helmholtz_decomposition">Wikipedia</a> we have this formulation:</p>
<p>Let <span class="math inline">\(F\)</span> be a vector field on a <strong>bounded</strong> domain <span class="math inline">\(V\)</span> which is twice continuously differentiable. Let <span class="math inline">\(S\)</span> be the surface enclosing <span class="math inline">\(V\)</span>. Then <span class="math inline">\(F\)</span> can be decomposed into a curl-free component and a divergence-free component:</p>
<p><span class="math display">\[
F = -\nabla(\phi) + \nabla\times A.
\]</span></p>
<p>Without explaining why, these values can be computed using volume and surface integrals:</p>
<p><span class="math display">\[
\begin{align}
\phi(\vec{r}') &amp;=
\frac{1}{4\pi} \int_V \frac{\nabla \cdot F(\vec{r})}{\|\vec{r}'-\vec{r} \|} dV -
\frac{1}{4\pi} \oint_S \frac{F(\vec{r})}{\|\vec{r}'-\vec{r} \|} \cdot \hat{N} dS\\
A(\vec{r}') &amp;= \frac{1}{4\pi} \int_V \frac{\nabla \times F(\vec{r})}{\|\vec{r}'-\vec{r} \|} dV +
\frac{1}{4\pi} \oint_S \frac{F(\vec{r})}{\|\vec{r}'-\vec{r} \|} \times \hat{N} dS.
\end{align}
\]</span></p>
<p>If <span class="math inline">\(V = R^3\)</span>, an unbounded domain, <em>but</em> <span class="math inline">\(F\)</span> <em>vanishes</em> faster than <span class="math inline">\(1/r\)</span>, then the theorem still holds with just the volume integrals:</p>
<p><span class="math display">\[
\begin{align}
\phi(\vec{r}') &amp;=\frac{1}{4\pi} \int_V \frac{\nabla \cdot F(\vec{r})}{\|\vec{r}'-\vec{r} \|} dV\\
A(\vec{r}') &amp;= \frac{1}{4\pi} \int_V \frac{\nabla \times F(\vec{r})}{\|\vec{r}'-\vec{r}\|} dV.
\end{align}
\]</span></p>
</section>
<section id="change-of-variable" class="level2" data-number="61.7">
<h2 data-number="61.7" class="anchored" data-anchor-id="change-of-variable"><span class="header-section-number">61.7</span> Change of variable</h2>
<p>The divergence and curl are defined in a manner independent of the coordinate system, though the method to compute them depends on the Cartesian coordinate system. If that is inconvenient, then it is possible to develop the ideas in different coordinate systems.</p>
<p>Some details are <a href="https://en.wikipedia.org/wiki/Curvilinear_coordinates">here</a>, the following is based on <a href="https://www.jfoadi.me.uk/documents/lecture_mathphys2_05.pdf">some lecture notes</a>.</p>
<p>We restrict to <span class="math inline">\(n=3\)</span> and use <span class="math inline">\((x,y,z)\)</span> for Cartesian coordinates and <span class="math inline">\((u,v,w)\)</span> for an <em>orthogonal</em> curvilinear coordinate system, such as spherical or cylindrical. If <span class="math inline">\(\vec{r} = \langle x,y,z\rangle\)</span>, then</p>
<p><span class="math display">\[
\begin{align}
d\vec{r} &amp;= \langle dx,dy,dz \rangle = J \langle du,dv,dw\rangle\\
&amp;=
\left[ \frac{\partial{\vec{r}}}{\partial{u}} \vdots
\frac{\partial{\vec{r}}}{\partial{v}} \vdots
\frac{\partial{\vec{r}}}{\partial{w}} \right] \langle du,dv,dw\rangle\\
&amp;= \frac{\partial{\vec{r}}}{\partial{u}} du +
\frac{\partial{\vec{r}}}{\partial{v}} dv
\frac{\partial{\vec{r}}}{\partial{w}} dw.
\end{align}
\]</span></p>
<p>The term <span class="math inline">\({\partial{\vec{r}}}/{\partial{u}}\)</span> is tangent to the curve formed by <em>assuming</em> <span class="math inline">\(v\)</span> and <span class="math inline">\(w\)</span> are constant and letting <span class="math inline">\(u\)</span> vary. Similarly for the other partial derivatives. Orthogonality assumes that at every point, these tangent vectors are orthogonal.</p>
<p>As <span class="math inline">\({\partial{\vec{r}}}/{\partial{u}}\)</span> is a vector it has a magnitude and direction. Define the scale factors as the magnitudes:</p>
<p><span class="math display">\[
h_u = \| \frac{\partial{\vec{r}}}{\partial{u}} \|,\quad
h_v = \| \frac{\partial{\vec{r}}}{\partial{v}} \|,\quad
h_w = \| \frac{\partial{\vec{r}}}{\partial{w}} \|.
\]</span></p>
<p>and let <span class="math inline">\(\hat{e}_u\)</span>, <span class="math inline">\(\hat{e}_v\)</span>, and <span class="math inline">\(\hat{e}_w\)</span> be the unit, direction vectors.</p>
<p>This gives the following notation:</p>
<p><span class="math display">\[
d\vec{r} = h_u du \hat{e}_u + h_v dv \hat{e}_v + h_w dw \hat{e}_w.
\]</span></p>
<p>From here, we can express different formulas.</p>
<p>For line integrals, we have the line element:</p>
<p><span class="math display">\[
dl = \sqrt{d\vec{r}\cdot d\vec{r}} = \sqrt{(h_ud_u)^2 + (h_vd_v)^2 + (h_wd_w)^2}.
\]</span></p>
<p>Consider the surface for constant <span class="math inline">\(u\)</span>. The vector <span class="math inline">\(\hat{e}_v\)</span> and <span class="math inline">\(\hat{e}_w\)</span> lie in the surfaces tangent plane, and the surface element will be:</p>
<p><span class="math display">\[
dS_u = \| h_v dv \hat{e}_v \times h_w dw \hat{e}_w \| = h_v h_w dv dw \| \hat{e}_v \| = h_v h_w dv dw.
\]</span></p>
<p>This uses orthogonality, so <span class="math inline">\(\hat{e}_v \times \hat{e}_w\)</span> is parallel to <span class="math inline">\(\hat{e}_u\)</span> and has unit length. Similarly, <span class="math inline">\(dS_v = h_u h_w du dw\)</span> and <span class="math inline">\(dS_w = h_u h_v du dv\)</span> .</p>
<p>The volume element is found by <em>projecting</em> <span class="math inline">\(d\vec{r}\)</span> onto the <span class="math inline">\(\hat{e}_u\)</span>, <span class="math inline">\(\hat{e}_v\)</span>, <span class="math inline">\(\hat{e}_w\)</span> coordinate system through <span class="math inline">\((d\vec{r} \cdot\hat{e}_u) \hat{e}_u\)</span>, <span class="math inline">\((d\vec{r} \cdot\hat{e}_v) \hat{e}_v\)</span>, and <span class="math inline">\((d\vec{r} \cdot\hat{e}_w) \hat{e}_w\)</span>. Then forming the triple scalar product to compute the volume of the parallelepiped:</p>
<p><span class="math display">\[
\begin{align*}
\left[(d\vec{r} \cdot\hat{e}_u) \hat{e}_u\right] \cdot
\left(
\left[(d\vec{r} \cdot\hat{e}_v) \hat{e}_v\right] \times
\left[(d\vec{r} \cdot\hat{e}_w) \hat{e}_w\right]
\right) &amp;=
(h_u h_v h_w) ( du dv dw ) (\hat{e}_u \cdot (\hat{e}_v \times \hat{e}_w) \\
&amp;=
h_u h_v h_w du dv dw,
\end{align*}
\]</span></p>
<p>as the unit vectors are orthonormal, their triple scalar product is <span class="math inline">\(1\)</span> and <span class="math inline">\(d\vec{r}\cdot\hat{e}_u = h_u du\)</span>, etc.</p>
<section id="example-1" class="level3" data-number="61.7.1">
<h3 data-number="61.7.1" class="anchored" data-anchor-id="example-1"><span class="header-section-number">61.7.1</span> Example</h3>
<p>We consider spherical coordinates with</p>
<p><span class="math display">\[
F(r, \theta, \phi) = \langle
r \sin(\phi) \cos(\theta),
r \sin(\phi) \sin(\theta),
r \cos(\phi)
\rangle.
\]</span></p>
<p>The following figure draws curves starting at <span class="math inline">\((r_0, \theta_0, \phi_0)\)</span> formed by holding <span class="math inline">\(2\)</span> of the <span class="math inline">\(3\)</span> variables constant. The tangent vectors are added in blue. The surface <span class="math inline">\(S_r\)</span> formed by a constant value of <span class="math inline">\(r\)</span> is illustrated.</p>
<div class="cell" data-hold="true" data-execution_count="36">
<div class="cell-output cell-output-display" data-execution_count="34">
<p><img src="div_grad_curl_files/figure-html/cell-37-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The tangent vectors found from the partial derivatives of <span class="math inline">\(\vec{r}\)</span>:</p>
<p><span class="math display">\[
\begin{align}
\frac{\partial{\vec{r}}}{\partial{r}} &amp;=
\langle \cos(\theta) \cdot \sin(\phi), \sin(\theta) \cdot \sin(\phi), \cos(\phi)\rangle,\\
\frac{\partial{\vec{r}}}{\partial{\theta}} &amp;=
\langle -r\cdot\sin(\theta)\cdot\sin(\phi), r\cdot\cos(\theta)\cdot\sin(\phi), 0\rangle,\\
\frac{\partial{\vec{r}}}{\partial{\phi}} &amp;=
\langle r\cdot\cos(\theta)\cdot\cos(\phi), r\cdot\sin(\theta)\cdot\cos(\phi), -r\cdot\sin(\phi) \rangle.
\end{align}
\]</span></p>
<p>With this, we have <span class="math inline">\(h_r=1\)</span>, <span class="math inline">\(h_\theta=r\sin(\phi)\)</span>, and <span class="math inline">\(h_\phi = r\)</span>. So that</p>
<p><span class="math display">\[
\begin{align*}
dl &amp;= \sqrt{dr^2 + (r\sin(\phi)d\theta^2) + (rd\phi)^2},\\
dS_r &amp;= r^2\sin(\phi)d\theta d\phi,\\
dS_\theta &amp;= rdr d\phi,\\
dS_\phi &amp;= r\sin(\phi)dr d\theta, \quad\text{and}\\
dV &amp;= r^2\sin(\phi) drd\theta d\phi.
\end{align*}
\]</span></p>
<p>The following visualizes the volume and the surface elements.</p>
<div class="cell" data-hold="true" data-execution_count="37">
<div class="cell-output cell-output-display" data-execution_count="35">
<p><img src="div_grad_curl_files/figure-html/cell-38-output-1.svg" class="img-fluid"></p>
</div>
</div>
</section>
<section id="the-gradient-in-a-new-coordinate-system" class="level3" data-number="61.7.2">
<h3 data-number="61.7.2" class="anchored" data-anchor-id="the-gradient-in-a-new-coordinate-system"><span class="header-section-number">61.7.2</span> The gradient in a new coordinate system</h3>
<p>If <span class="math inline">\(f\)</span> is a scalar function then <span class="math inline">\(df = \nabla{f} \cdot d\vec{r}\)</span> by the chain rule. Using the curvilinear coordinates:</p>
<p><span class="math display">\[
\begin{align*}
df &amp;=
\frac{\partial{f}}{\partial{u}} du +
\frac{\partial{f}}{\partial{v}} dv +
\frac{\partial{f}}{\partial{w}} dw \\
&amp;=
\frac{1}{h_u}\frac{\partial{f}}{\partial{u}} h_udu +
\frac{1}{h_v}\frac{\partial{f}}{\partial{v}} h_vdv +
\frac{1}{h_w}\frac{\partial{f}}{\partial{w}} h_wdw.
\end{align*}
\]</span></p>
<p>But, as was used above, <span class="math inline">\(d\vec{r} \cdot \hat{e}_u = h_u du\)</span>, etc. so <span class="math inline">\(df\)</span> can be re-expressed as:</p>
<p><span class="math display">\[
df = (\frac{1}{h_u}\frac{\partial{f}}{\partial{u}}\hat{e}_u +
\frac{1}{h_v}\frac{\partial{f}}{\partial{v}}\hat{e}_v +
\frac{1}{h_w}\frac{\partial{f}}{\partial{w}}\hat{e}_w) \cdot d\vec{r} =
\nabla{f} \cdot d\vec{r}.
\]</span></p>
<p>The gradient is the part within the parentheses.</p>
<hr>
<p>As an example, in cylindrical coordinates, we have <span class="math inline">\(h_r =1\)</span>, <span class="math inline">\(h_\theta=r\)</span>, and <span class="math inline">\(h_z=1\)</span>, giving:</p>
<p><span class="math display">\[
\nabla{f} = \frac{\partial{f}}{\partial{r}}\hat{e}_r +
\frac{1}{r}\frac{\partial{f}}{\partial{\theta}}\hat{e}_\theta +
\frac{\partial{f}}{\partial{z}}\hat{e}_z
\]</span></p>
</section>
<section id="the-divergence-in-a-new-coordinate-system" class="level3" data-number="61.7.3">
<h3 data-number="61.7.3" class="anchored" data-anchor-id="the-divergence-in-a-new-coordinate-system"><span class="header-section-number">61.7.3</span> The divergence in a new coordinate system</h3>
<p>The divergence is a result of the limit of a surface integral,</p>
<p><span class="math display">\[
\nabla \cdot F = \lim \frac{1}{\Delta{V}}\oint_S F \cdot \hat{N} dS.
\]</span></p>
<p>Taking <span class="math inline">\(V\)</span> as a box in the curvilinear coordinates, with side lengths <span class="math inline">\(h_udu\)</span>, <span class="math inline">\(h_vdv\)</span>, and <span class="math inline">\(h_wdw\)</span> the surface integral is computed by projecting <span class="math inline">\(F\)</span> onto each normal area element and multiplying by the area. The task is similar to how the the divergence was derived above, only now the terms are like <span class="math inline">\(\partial{(F_uh_vh_w)}/\partial{u}\)</span> due to the scale factors (<span class="math inline">\(F_u\)</span> is the u component of <span class="math inline">\(F\)</span>.) The result is:</p>
<p><span class="math display">\[
\nabla\cdot F = \frac{1}{h_u h_v h_w}\left[
\frac{\partial{(F_uh_vh_w)}}{\partial{u}} +
\frac{\partial{(h_uF_vh_w)}}{\partial{v}} +
\frac{\partial{(h_uh_vF_w)}}{\partial{w}} \right].
\]</span></p>
<hr>
<p>For example, in cylindrical coordinates, we have</p>
<p><span class="math display">\[
\nabla \cdot F = \frac{1}{r}
\left[
\frac{\partial{F_r r}}{\partial{r}} +
\frac{\partial{F_\theta}}{\partial{\theta}} +
\frac{\partial{F_x}}{\partial{z}}
\right].
\]</span></p>
</section>
<section id="the-curl-in-a-new-coordinate-system" class="level3" data-number="61.7.4">
<h3 data-number="61.7.4" class="anchored" data-anchor-id="the-curl-in-a-new-coordinate-system"><span class="header-section-number">61.7.4</span> The curl in a new coordinate system</h3>
<p>The curl, like the divergence, can be expressed as the limit of an integral:</p>
<p><span class="math display">\[
(\nabla \times F) \cdot \hat{N} = \lim \frac{1}{\Delta{S}} \oint_C F \cdot d\vec{r},
\]</span></p>
<p>where <span class="math inline">\(S\)</span> is a surface perpendicular to <span class="math inline">\(\hat{N}\)</span> with boundary <span class="math inline">\(C\)</span>. For a small rectangular surface, the derivation is similar to above, only the scale factors are included. This gives, say, for the <span class="math inline">\(\hat{e}_u\)</span> normal, <span class="math inline">\(\frac{\partial{(h_zF_z)}}{\partial{y}} - \frac{\partial{(h_yF_y)}}{\partial{z}}\)</span>. The following determinant form combines the terms compactly:</p>
<p><span class="math display">\[
\nabla\times{F} = \det \left[
\begin{array}{}
h_u\hat{e}_u &amp; h_v\hat{e}_v &amp; h_w\hat{e}_w \\
\frac{\partial}{\partial{u}} &amp; \frac{\partial}{\partial{v}} &amp; \frac{\partial}{\partial{w}} \\
h_uF_u &amp; h_v F_v &amp; h_w F_w
\end{array}
\right].
\]</span></p>
<hr>
<p>For example, in cylindrical coordinates, the curl is:</p>
<p><span class="math display">\[
\det\left[
\begin{array}{}
\hat{r} &amp; r\hat{\theta} &amp; \hat{k} \\
\frac{\partial}{\partial{r}} &amp; \frac{\partial}{\partial{\theta}} &amp; \frac{\partial}{\partial{z}} \\
F_r &amp; rF_\theta &amp; F_z
\end{array}
\right]
\]</span></p>
<p>Applying this to the function <span class="math inline">\(F(r,\theta, z) = \hat{\theta}\)</span> we get:</p>
<p><span class="math display">\[
\text{curl}(F) = \det\left[
\begin{array}{}
\hat{r} &amp; r\hat{\theta} &amp; \hat{k} \\
\frac{\partial}{\partial{r}} &amp; \frac{\partial}{\partial{\theta}} &amp; \frac{\partial}{\partial{z}} \\
0 &amp; r &amp; 0
\end{array}
\right] =
\hat{k} \det\left[
\begin{array}{}
\frac{\partial}{\partial{r}} &amp; \frac{\partial}{\partial{\theta}}\\
0 &amp; r
\end{array}
\right] =
\hat{k}.
\]</span></p>
<p>As <span class="math inline">\(F\)</span> represents a vector field that rotates about the <span class="math inline">\(z\)</span> axis at a constant rate, the magnitude of the curl should be a constant and it should point in the <span class="math inline">\(\hat{k}\)</span> direction, as we found.</p>
</section>
</section>
<section id="questions" class="level2" data-number="61.8">
<h2 data-number="61.8" class="anchored" data-anchor-id="questions"><span class="header-section-number">61.8</span> Questions</h2>
<section id="question" class="level6">
<h6 class="anchored" data-anchor-id="question">Question</h6>
<p>Numerically find the divergence of <span class="math inline">\(F(x,y,z) = \langle xy, yz, zx\rangle\)</span> at the point <span class="math inline">\(\langle 1,2,3\rangle\)</span>.</p>
<div class="cell" data-hold="true" data-execution_count="38">
<div class="cell-output cell-output-display" data-execution_count="36">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="16744669458140525809" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_16744669458140525809">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="16744669458140525809" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="16744669458140525809_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("16744669458140525809").addEventListener("change", function() {
var correct = (Math.abs(this.value - 6) <= 0);
var msgBox = document.getElementById('16744669458140525809_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_16744669458140525809")
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_16744669458140525809")
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>Numerically find the curl of <span class="math inline">\(F(x,y,z) = \langle xy, yz, zx\rangle\)</span> at the point <span class="math inline">\(\langle 1,2,3\rangle\)</span>. What is the <span class="math inline">\(x\)</span> component?</p>
<div class="cell" data-hold="true" data-execution_count="39">
<div class="cell-output cell-output-display" data-execution_count="37">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="5496049131100411699" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_5496049131100411699">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="5496049131100411699" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="5496049131100411699_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("5496049131100411699").addEventListener("change", function() {
var correct = (Math.abs(this.value - -2.0) <= 0.001);
var msgBox = document.getElementById('5496049131100411699_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_5496049131100411699")
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_5496049131100411699")
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>Let <span class="math inline">\(F(x,y,z) = \langle \sin(x), e^{xy}, xyz\rangle\)</span>. Find the divergence of <span class="math inline">\(F\)</span> symbolically.</p>
<div class="cell" data-hold="true" data-execution_count="40">
<div class="cell-output cell-output-display" data-execution_count="38">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="10785913921897004587" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_10785913921897004587">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_10785913921897004587_1">
<input class="form-check-input" type="radio" name="radio_10785913921897004587" id="radio_10785913921897004587_1" value="1">
<span class="label-body px-1">
\(x e^{x y} + \cos{\left (x \right )}\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10785913921897004587_2">
<input class="form-check-input" type="radio" name="radio_10785913921897004587" id="radio_10785913921897004587_2" value="2">
<span class="label-body px-1">
\(x y + x e^{x y} + \cos{\left (x \right )}\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10785913921897004587_3">
<input class="form-check-input" type="radio" name="radio_10785913921897004587" id="radio_10785913921897004587_3" value="3">
<span class="label-body px-1">
\(x y + x e^{x y}\)
</span>
</label>
</div>
</div>
</div>
<div id="10785913921897004587_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_10785913921897004587"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('10785913921897004587_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_10785913921897004587")
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_10785913921897004587")
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">\(F(x,y,z) = \langle \sin(x), e^{xy}, xyz\rangle\)</span>. Find the curl of <span class="math inline">\(F\)</span> symbolically. What is the <span class="math inline">\(x\)</span> component?</p>
<div class="cell" data-hold="true" data-execution_count="41">
<div class="cell-output cell-output-display" data-execution_count="39">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="10537907741015218355" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_10537907741015218355">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_10537907741015218355_1">
<input class="form-check-input" type="radio" name="radio_10537907741015218355" id="radio_10537907741015218355_1" value="1">
<span class="label-body px-1">
\(ye^{xy}\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10537907741015218355_2">
<input class="form-check-input" type="radio" name="radio_10537907741015218355" id="radio_10537907741015218355_2" value="2">
<span class="label-body px-1">
\(xz\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10537907741015218355_3">
<input class="form-check-input" type="radio" name="radio_10537907741015218355" id="radio_10537907741015218355_3" value="3">
<span class="label-body px-1">
\(-yz\)
</span>
</label>
</div>
</div>
</div>
<div id="10537907741015218355_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_10537907741015218355"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('10537907741015218355_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_10537907741015218355")
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_10537907741015218355")
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">\(\phi(x,y,z) = x + 2y + 3z\)</span>. We know that <span class="math inline">\(\nabla\times\nabla{\phi}\)</span> is zero by the vanishing property. Compute <span class="math inline">\(\nabla\cdot\nabla{\phi}\)</span>.</p>
<div class="cell" data-hold="true" data-execution_count="42">
<div class="cell-output cell-output-display" data-execution_count="40">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="7728831996308551656" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_7728831996308551656">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_7728831996308551656_1">
<input class="form-check-input" type="radio" name="radio_7728831996308551656" id="radio_7728831996308551656_1" value="1">
<span class="label-body px-1">
\(6\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_7728831996308551656_2">
<input class="form-check-input" type="radio" name="radio_7728831996308551656" id="radio_7728831996308551656_2" value="2">
<span class="label-body px-1">
\(\vec{0}\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_7728831996308551656_3">
<input class="form-check-input" type="radio" name="radio_7728831996308551656" id="radio_7728831996308551656_3" value="3">
<span class="label-body px-1">
\(0\)
</span>
</label>
</div>
</div>
</div>
<div id="7728831996308551656_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_7728831996308551656"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 3;
var msgBox = document.getElementById('7728831996308551656_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_7728831996308551656")
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_7728831996308551656")
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>In two dimensions the curl of a gradient field simplifies to:</p>
<p><span class="math display">\[
\nabla\times\nabla{f} = \nabla\times
\langle\frac{\partial{f}}{\partial{x}},
\frac{\partial{f}}{\partial{y}}\rangle =
\frac{\partial{\frac{\partial{f}}{\partial{y}}}}{\partial{x}} -
\frac{\partial{\frac{\partial{f}}{\partial{x}}}}{\partial{y}}.
\]</span></p>
<div class="cell" data-hold="true" data-execution_count="43">
<div class="cell-output cell-output-display" data-execution_count="41">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="8847764593372058685" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_8847764593372058685">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_8847764593372058685_1">
<input class="form-check-input" type="radio" name="radio_8847764593372058685" id="radio_8847764593372058685_1" value="1">
<span class="label-body px-1">
This is \(0\) for any \(f\), as \(\nabla\times\nabla\) is \(0\) since the cross product of vector with itself is the \(0\) vector.
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_8847764593372058685_2">
<input class="form-check-input" type="radio" name="radio_8847764593372058685" id="radio_8847764593372058685_2" value="2">
<span class="label-body px-1">
This is \(0\) if the partial derivatives are continuous by Schwarz's (Clairault's) theorem
</span>
</label>
</div>
</div>
</div>
<div id="8847764593372058685_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_8847764593372058685"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('8847764593372058685_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_8847764593372058685")
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_8847764593372058685")
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>Based on this vector-field plot</p>
<div class="cell" data-hold="true" data-execution_count="44">
<div class="cell-output cell-output-display" data-execution_count="42">
<p><img src="div_grad_curl_files/figure-html/cell-45-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>which seems likely</p>
<div class="cell" data-hold="true" data-execution_count="45">
<div class="cell-output cell-output-display" data-execution_count="43">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="13498230497593881242" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_13498230497593881242">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_13498230497593881242_1">
<input class="form-check-input" type="radio" name="radio_13498230497593881242" id="radio_13498230497593881242_1" value="1">
<span class="label-body px-1">
The field is incompressible (divergence free)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_13498230497593881242_2">
<input class="form-check-input" type="radio" name="radio_13498230497593881242" id="radio_13498230497593881242_2" value="2">
<span class="label-body px-1">
The field is irrotational (curl free)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_13498230497593881242_3">
<input class="form-check-input" type="radio" name="radio_13498230497593881242" id="radio_13498230497593881242_3" value="3">
<span class="label-body px-1">
The field has a non-trivial curl and divergence
</span>
</label>
</div>
</div>
</div>
<div id="13498230497593881242_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_13498230497593881242"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('13498230497593881242_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_13498230497593881242")
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_13498230497593881242")
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>Based on this vectorfield plot</p>
<div class="cell" data-hold="true" data-execution_count="46">
<div class="cell-output cell-output-display" data-execution_count="44">
<p><img src="div_grad_curl_files/figure-html/cell-47-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>which seems likely</p>
<div class="cell" data-hold="true" data-execution_count="47">
<div class="cell-output cell-output-display" data-execution_count="45">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="7355845441831218040" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_7355845441831218040">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_7355845441831218040_1">
<input class="form-check-input" type="radio" name="radio_7355845441831218040" id="radio_7355845441831218040_1" value="1">
<span class="label-body px-1">
The field is incompressible (divergence free)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_7355845441831218040_2">
<input class="form-check-input" type="radio" name="radio_7355845441831218040" id="radio_7355845441831218040_2" value="2">
<span class="label-body px-1">
The field is irrotational (curl free)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_7355845441831218040_3">
<input class="form-check-input" type="radio" name="radio_7355845441831218040" id="radio_7355845441831218040_3" value="3">
<span class="label-body px-1">
The field has a non-trivial curl and divergence
</span>
</label>
</div>
</div>
</div>
<div id="7355845441831218040_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_7355845441831218040"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('7355845441831218040_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_7355845441831218040")
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_7355845441831218040")
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>The electric field <span class="math inline">\(E\)</span> (by Maxwells equations) satisfies:</p>
<div class="cell" data-hold="true" data-execution_count="48">
<div class="cell-output cell-output-display" data-execution_count="46">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="8474826859320876733" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_8474826859320876733">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_8474826859320876733_1">
<input class="form-check-input" type="radio" name="radio_8474826859320876733" id="radio_8474826859320876733_1" value="1">
<span class="label-body px-1">
The field is incompressible (divergence free)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_8474826859320876733_2">
<input class="form-check-input" type="radio" name="radio_8474826859320876733" id="radio_8474826859320876733_2" value="2">
<span class="label-body px-1">
The field is irrotational (curl free)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_8474826859320876733_3">
<input class="form-check-input" type="radio" name="radio_8474826859320876733" id="radio_8474826859320876733_3" value="3">
<span class="label-body px-1">
The field has a non-trivial curl and divergence
</span>
</label>
</div>
</div>
</div>
<div id="8474826859320876733_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_8474826859320876733"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 3;
var msgBox = document.getElementById('8474826859320876733_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_8474826859320876733")
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_8474826859320876733")
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>The magnetic field <span class="math inline">\(B\)</span> (by Maxwells equations) satisfies:</p>
<div class="cell" data-hold="true" data-execution_count="49">
<div class="cell-output cell-output-display" data-execution_count="47">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="7357338456968982110" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_7357338456968982110">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_7357338456968982110_1">
<input class="form-check-input" type="radio" name="radio_7357338456968982110" id="radio_7357338456968982110_1" value="1">
<span class="label-body px-1">
The field is incompressible (divergence free)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_7357338456968982110_2">
<input class="form-check-input" type="radio" name="radio_7357338456968982110" id="radio_7357338456968982110_2" value="2">
<span class="label-body px-1">
The field is irrotational (curl free)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_7357338456968982110_3">
<input class="form-check-input" type="radio" name="radio_7357338456968982110" id="radio_7357338456968982110_3" value="3">
<span class="label-body px-1">
The field has a non-trivial curl and divergence
</span>
</label>
</div>
</div>
</div>
<div id="7357338456968982110_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_7357338456968982110"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('7357338456968982110_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_7357338456968982110")
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_7357338456968982110")
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>For spherical coordinates, <span class="math inline">\(\Phi(r, \theta, \phi)=r \langle \sin\phi\cos\theta,\sin\phi\sin\theta,\cos\phi\rangle\)</span>, the scale factors are <span class="math inline">\(h_r = 1\)</span>, <span class="math inline">\(h_\theta=r\sin\phi\)</span>, and <span class="math inline">\(h_\phi=r\)</span>.</p>
<p>The curl then will then be</p>
<p><span class="math display">\[
\nabla\times{F} = \det \left[
\begin{array}{}
\hat{e}_r &amp; r\sin\phi\hat{e}_\theta &amp; r\hat{e}_\phi \\
\frac{\partial}{\partial{r}} &amp; \frac{\partial}{\partial{\theta}} &amp; \frac{\partial}{\partial{phi}} \\
F_r &amp; r\sin\phi F_\theta &amp; r F_\phi
\end{array}
\right].
\]</span></p>
<p>For a <em>radial</em> function <span class="math inline">\(F = h(r)e_r\)</span>. (That is <span class="math inline">\(F_r = h(r)\)</span>, <span class="math inline">\(F_\theta=0\)</span>, and <span class="math inline">\(F_\phi=0\)</span>. What is the curl of <span class="math inline">\(F\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="50">
<div class="cell-output cell-output-display" data-execution_count="48">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="8523024306858490197" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_8523024306858490197">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_8523024306858490197_1">
<input class="form-check-input" type="radio" name="radio_8523024306858490197" id="radio_8523024306858490197_1" value="1">
<span class="label-body px-1">
\(rh'(r)e_\phi\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_8523024306858490197_2">
<input class="form-check-input" type="radio" name="radio_8523024306858490197" id="radio_8523024306858490197_2" value="2">
<span class="label-body px-1">
\(\vec{0}\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_8523024306858490197_3">
<input class="form-check-input" type="radio" name="radio_8523024306858490197" id="radio_8523024306858490197_3" value="3">
<span class="label-body px-1">
\(re_\phi\)
</span>
</label>
</div>
</div>
</div>
<div id="8523024306858490197_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_8523024306858490197"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('8523024306858490197_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_8523024306858490197")
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_8523024306858490197")
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/line_integrals.html" class="pagination-link">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">60</span>&nbsp; <span class="chapter-title">Line and Surface Integrals</span></span>
</a>
</div>
<div class="nav-page nav-page-next">
<a href="../integral_vector_calculus/stokes_theorem.html" class="pagination-link">
<span class="nav-page-text"><span class="chapter-number">62</span>&nbsp; <span class="chapter-title">Greens Theorem, Stokes Theorem, and the Divergence Theorem</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>