CalculusWithJuliaNotes.jl/quarto/0e7f54ed/precalc/exp_log_functions.html

2103 lines
126 KiB
HTML
Raw Normal View History

2022-08-11 19:15:19 +02:00
<!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 - 15&nbsp; Exponential and logarithmic functions</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="../precalc/trig_functions.html" rel="next">
<link href="../precalc/rational_functions.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">15</span>&nbsp; <span class="chapter-title">Exponential and logarithmic functions</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" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true">Precalculus Concepts</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show">
<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 active"><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 collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-7" aria-expanded="false">Integral vector calculus</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-7" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-7" class="collapse list-unstyled sidebar-section depth1 ">
<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"><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="#exponential-functions" id="toc-exponential-functions" class="nav-link active" data-scroll-target="#exponential-functions"> <span class="header-section-number">15.1</span> Exponential functions</a></li>
<li><a href="#logarithmic-functions" id="toc-logarithmic-functions" class="nav-link" data-scroll-target="#logarithmic-functions"> <span class="header-section-number">15.2</span> Logarithmic functions</a>
<ul class="collapse">
<li><a href="#properties-of-logarithms" id="toc-properties-of-logarithms" class="nav-link" data-scroll-target="#properties-of-logarithms"> <span class="header-section-number">15.2.1</span> Properties of logarithms</a></li>
</ul></li>
<li><a href="#questions" id="toc-questions" class="nav-link" data-scroll-target="#questions"> <span class="header-section-number">15.3</span> Questions</a></li>
</ul>
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/jverzani/CalculusWithJuliaNotes.jl/edit/main/quarto/precalc/exp_log_functions.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">15</span>&nbsp; <span class="chapter-title">Exponential and logarithmic functions</span></h1>
</div>
<div class="quarto-title-meta">
</div>
</header>
<p>This section uses the following 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></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<hr>
<p>The family of exponential functions is used to model growth and decay. The family of logarithmic functions is defined here as the inverse of the exponential functions, but have reach far outside of that.</p>
<section id="exponential-functions" class="level2" data-number="15.1">
<h2 data-number="15.1" class="anchored" data-anchor-id="exponential-functions"><span class="header-section-number">15.1</span> Exponential functions</h2>
<p>The family of exponential functions is defined by <span class="math inline">\(f(x) = a^x, -\infty&lt; x &lt; \infty\)</span> and <span class="math inline">\(a &gt; 0\)</span>. For <span class="math inline">\(0 &lt; a &lt; 1\)</span> these functions decay or decrease, for <span class="math inline">\(a &gt; 1\)</span> the functions grow or increase, and if <span class="math inline">\(a=1\)</span> the function is constantly <span class="math inline">\(1\)</span>.</p>
<p>For a given <span class="math inline">\(a\)</span>, defining <span class="math inline">\(a^n\)</span> for positive integers is straightforward, as it means multiplying <span class="math inline">\(n\)</span> copies of <span class="math inline">\(a.\)</span> From this, for <em>integer powers</em>, the key properties of exponents: <span class="math inline">\(a^x \cdot a^y = a^{x+y}\)</span>, and <span class="math inline">\((a^x)^y = a^{x \cdot y}\)</span> are immediate consequences. For example with <span class="math inline">\(x=3\)</span> and <span class="math inline">\(y=2\)</span>:</p>
<p><span class="math display">\[
\begin{align*}
a^3 \cdot a^2 &amp;= (a\cdot a \cdot a) \cdot (a \cdot a) \\
&amp;= (a \cdot a \cdot a \cdot a \cdot a) \\
&amp;= a^5 = a^{3+2},\\
(a^3)^2 &amp;= (a\cdot a \cdot a) \cdot (a\cdot a \cdot a)\\
&amp;= (a\cdot a \cdot a \cdot a\cdot a \cdot a) \\
&amp;= a^6 = a^{3\cdot 2}.
\end{align*}
\]</span></p>
<p>For <span class="math inline">\(a \neq 0\)</span>, <span class="math inline">\(a^0\)</span> is defined to be <span class="math inline">\(1\)</span>.</p>
<p>For positive, integer values of <span class="math inline">\(n\)</span>, we have by definition that <span class="math inline">\(a^{-n} = 1/a^n\)</span>.</p>
<p>For <span class="math inline">\(n\)</span> a positive integer, we can define <span class="math inline">\(a^{1/n}\)</span> to be the unique positive solution to <span class="math inline">\(x^n=a\)</span>.</p>
<p>Using the key properties of exponents we can extend this to a definition of <span class="math inline">\(a^x\)</span> for any rational <span class="math inline">\(x\)</span>.</p>
<p>Defining <span class="math inline">\(a^x\)</span> for any real number requires some more sophisticated mathematics.</p>
<p>One method is to use a <a href="http://tinyurl.com/zk86c8r">theorem</a> that says a <em>bounded</em> monotonically increasing sequence will converge. (This uses the <a href="https://en.wikipedia.org/wiki/Completeness_of_the_real_numbers">Completeness Axiom</a>.) Then for <span class="math inline">\(a &gt; 1\)</span> we have if <span class="math inline">\(q_n\)</span> is a sequence of rational numbers increasing to <span class="math inline">\(x\)</span>, then <span class="math inline">\(a^{q_n}\)</span> will be a bounded sequence of increasing numbers, so will converge to a number defined to be <span class="math inline">\(a^x\)</span>. Something similar is possible for the <span class="math inline">\(0 &lt; a &lt; 1\)</span> case.</p>
<p>This definition can be done to ensure the rules of exponents hold for <span class="math inline">\(a &gt; 0\)</span>:</p>
<p><span class="math display">\[
a^{x + y} = a^x \cdot a^y, \quad (a^x)^y = a^{x \cdot y}.
\]</span></p>
<p>In <code>Julia</code> these functions are implemented using <code>^</code>. A special value of the base, <span class="math inline">\(e\)</span>, may be defined as well in terms of a limit. The exponential function <span class="math inline">\(e^x\)</span> is implemented in <code>exp</code>.</p>
<div class="cell" data-hold="true" data-execution_count="4">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(x <span class="op">-&gt;</span> (<span class="fl">1</span><span class="op">/</span><span class="fl">2</span>)<span class="op">^</span>x, <span class="op">-</span><span class="fl">2</span>, <span class="fl">2</span>, label<span class="op">=</span><span class="st">"1/2"</span>)</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(x <span class="op">-&gt;</span> <span class="fl">1</span><span class="op">^</span>x, label<span class="op">=</span><span class="st">"1"</span>)</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(x <span class="op">-&gt;</span> <span class="fl">2</span><span class="op">^</span>x, label<span class="op">=</span><span class="st">"2"</span>)</span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(x <span class="op">-&gt;</span> <span class="fu">exp</span>(x), label<span class="op">=</span><span class="st">"e"</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="5">
<p><img src="exp_log_functions_files/figure-html/cell-5-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>We see examples of some general properties:</p>
<ul>
<li>The domain is all real <span class="math inline">\(x\)</span> and the range is all <em>positive</em> <span class="math inline">\(y\)</span> (provided <span class="math inline">\(a \neq 1\)</span>).</li>
<li>For <span class="math inline">\(0 &lt; a &lt; 1\)</span> the functions are monotonically decreasing.</li>
<li>For <span class="math inline">\(a &gt; 1\)</span> the functions are monotonically increasing.</li>
<li>If <span class="math inline">\(1 &lt; a &lt; b\)</span> and <span class="math inline">\(x &gt; 0\)</span> we have <span class="math inline">\(a^x &lt; b^x\)</span>.</li>
</ul>
<section id="example" class="level5">
<h5 class="anchored" data-anchor-id="example">Example</h5>
<p><a href="http://tinyurl.com/gsy939y">Continuously</a> compounded interest allows an initial amount <span class="math inline">\(P_0\)</span> to grow over time according to <span class="math inline">\(P(t)=P_0e^{rt}\)</span>. Investigate the difference between investing <span class="math inline">\(1,000\)</span> dollars in an account which earns <span class="math inline">\(2\)</span>% as opposed to an account which earns <span class="math inline">\(8\)</span>% over <span class="math inline">\(20\)</span> years.</p>
<p>The <span class="math inline">\(r\)</span> in the formula is the interest rate, so <span class="math inline">\(r=0.02\)</span> or <span class="math inline">\(r=0.08\)</span>. To compare the differences we have:</p>
<div class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>r2, r8 <span class="op">=</span> <span class="fl">0.02</span>, <span class="fl">0.08</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>P0 <span class="op">=</span> <span class="fl">1000</span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>t <span class="op">=</span> <span class="fl">20</span></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>P0 <span class="op">*</span> <span class="fu">exp</span>(r2<span class="op">*</span>t), P0 <span class="op">*</span> <span class="fu">exp</span>(r8<span class="op">*</span>t)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="6">
<pre><code>(1491.8246976412704, 4953.0324243951145)</code></pre>
</div>
</div>
<p>As can be seen, there is quite a bit of difference.</p>
<p>In <span class="math inline">\(1494\)</span>, <a href="http://tinyurl.com/gsy939y">Pacioli</a> gave the “Rule of <span class="math inline">\(72\)</span>”, stating that to find the number of years it takes an investment to double when continuously compounded one should divide the interest rate into <span class="math inline">\(72\)</span>.</p>
<p>This formula is not quite precise, but a rule of thumb, the number is closer to <span class="math inline">\(69\)</span>, but <span class="math inline">\(72\)</span> has many divisors which makes this an easy to compute approximation. Lets see how accurate it is:</p>
<div class="cell" data-execution_count="6">
<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>t2, t8 <span class="op">=</span> <span class="fl">72</span><span class="op">/</span><span class="fl">2</span>, <span class="fl">72</span><span class="op">/</span><span class="fl">8</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="fu">exp</span>(r2<span class="op">*</span>t2), <span class="fu">exp</span>(r8<span class="op">*</span>t8)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="7">
<pre><code>(2.0544332106438876, 2.0544332106438876)</code></pre>
</div>
</div>
<p>So fairly close - after <span class="math inline">\(72/r\)</span> years the amount is <span class="math inline">\(2.05...\)</span> times more than the initial amount.</p>
</section>
<section id="example-1" class="level5">
<h5 class="anchored" data-anchor-id="example-1">Example</h5>
<p><a href="https://en.wikipedia.org/wiki/Bacterial_growth">Bacterial growth</a> (according to Wikipedia) is the asexual reproduction, or cell division, of a bacterium into two daughter cells, in a process called binary fission. During the log phase “the number of new bacteria appearing per unit time is proportional to the present population.” The article states that “Under controlled conditions, <em>cyanobacteria</em> can double their population four times a day…”</p>
<p>Suppose an initial population of <span class="math inline">\(P_0\)</span> bacteria, a formula for the number after <span class="math inline">\(n\)</span> <em>hours</em> is <span class="math inline">\(P(n) = P_0 2^{n/6}\)</span> where <span class="math inline">\(6 = 24/4\)</span>.</p>
<p>After two days what multiple of the initial amount is present if conditions are appropriate?</p>
<div class="cell" data-hold="true" data-execution_count="7">
<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>n <span class="op">=</span> <span class="fl">2</span> <span class="op">*</span> <span class="fl">24</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="fl">2</span><span class="op">^</span>(n<span class="op">/</span><span class="fl">6</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="8">
<pre><code>256.0</code></pre>
</div>
</div>
<p>That would be an enormous growth. Dont worry: “Exponential growth cannot continue indefinitely, however, because the medium is soon depleted of nutrients and enriched with wastes.”</p>
<div class="callout-note callout callout-style-default callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-caption-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>The value of <code>2^n</code> and <code>2.0^n</code> is different in <code>Julia</code>. The former remains an integer and is subject to integer overflow for <code>n &gt; 62</code>. As used above, <code>2^(n/6)</code> will not overflow for larger <code>n</code>, as when the exponent is a floating point value, the base is promoted to a floating point value.</p>
</div>
</div>
</section>
<section id="example-2" class="level5">
<h5 class="anchored" data-anchor-id="example-2">Example</h5>
<p>The famous <a href="https://en.wikipedia.org/wiki/Fibonacci_number">Fibonacci</a> numbers are <span class="math inline">\(1,1,2,3,5,8,13,\dots\)</span>, where <span class="math inline">\(F_{n+1}=F_n+F_{n-1}\)</span>. These numbers increase. To see how fast, if we <em>guess</em> that the growth is eventually exponential and assume <span class="math inline">\(F_n \approx c \cdot a^n\)</span>, then our equation is approximately <span class="math inline">\(ca^{n+1} = ca^n + ca^{n-1}\)</span>. Factoring out common terms gives <span class="math inline">\(ca^{n-1} \cdot (a^2 - a - 1) = 0\)</span>. The term <span class="math inline">\(a^{n-1}\)</span> is always positive, so any solution would satisfy <span class="math inline">\(a^2 - a -1 = 0\)</span>. The positve solution is <span class="math inline">\((1 + \sqrt{5})/2 \approx 1.618\)</span></p>
<p>That is evidence that the <span class="math inline">\(F_n \approx c\cdot 1.618^n\)</span>. (See <a href="https://en.wikipedia.org/wiki/Fibonacci_number#Relation_to_the_golden_ratio">Relation to golden ratio</a> for a related, but more explicit exact formula.</p>
</section>
<section id="example-3" class="level5">
<h5 class="anchored" data-anchor-id="example-3">Example</h5>
<p>In the previous example, the exponential family of functions is used to describe growth. Polynomial functions also increase. Could these be used instead? If so that would be great, as they are easier to reason about.</p>
<p>The key fact is that exponential growth is much greater than polynomial growth. That is for large enough <span class="math inline">\(x\)</span> and for any fixed <span class="math inline">\(a&gt;1\)</span> and positive integer <span class="math inline">\(n\)</span> it is true that <span class="math inline">\(a^x \gg x^n\)</span>.</p>
<p>Later we will see an easy way to certify this statement.</p>
</section>
<section id="the-mathematical-constant-e" class="level5">
<h5 class="anchored" data-anchor-id="the-mathematical-constant-e">The mathematical constant <span class="math inline">\(e\)</span></h5>
<p>Eulers number, <span class="math inline">\(e\)</span>, may be defined several ways. One way is to define <span class="math inline">\(e^x\)</span> by the limit <span class="math inline">\((1+x/n)^n\)</span>. Then <span class="math inline">\(e=e^1\)</span>. The value is an irrational number. This number turns up to be the natural base to use for many problems arising in Calculus. In <code>Julia</code> there are a few mathematical constants that get special treatment, so that when needed, extra precision is available. The value <code>e</code> is not immediately assigned to this value, rather <code></code> is. This is typed <code>\euler[tab]</code>. The label <code>e</code> is thought too important for other uses to reserve the name for representing a single number. However, users can issue the command <code>using Base.MathConstants</code> and <code>e</code> will be available to represent this number. When the <code>CalculusWithJulia</code> package is loaded, the value <code>e</code> is defined to be the floating point number returned by <code>exp(1)</code>. This loses the feature of arbitrary precision, but has other advantages.</p>
<p>A <a href="https://www.mathsisfun.com/numbers/e-eulers-number.html">cute</a> appearance of <span class="math inline">\(e\)</span> is in this problem: Let <span class="math inline">\(a&gt;0\)</span>. Cut <span class="math inline">\(a\)</span> into <span class="math inline">\(n\)</span> equal pieces and then multiply them. What <span class="math inline">\(n\)</span> will produce the largest value? Note that the formula is <span class="math inline">\((a/n)^n\)</span> for a given <span class="math inline">\(a\)</span> and <span class="math inline">\(n\)</span>.</p>
<p>Suppose <span class="math inline">\(a=5\)</span> then for <span class="math inline">\(n=1,2,3\)</span> we get:</p>
<div class="cell" data-hold="true" data-execution_count="8">
<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>a <span class="op">=</span> <span class="fl">5</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a>(a<span class="op">/</span><span class="fl">1</span>)<span class="op">^</span><span class="fl">1</span>, (a<span class="op">/</span><span class="fl">2</span>)<span class="op">^</span><span class="fl">2</span>, (a<span class="op">/</span><span class="fl">3</span>)<span class="op">^</span><span class="fl">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="9">
<pre><code>(5.0, 6.25, 4.629629629629631)</code></pre>
</div>
</div>
<p>Wed need to compare more, but at this point <span class="math inline">\(n=2\)</span> is the winner when <span class="math inline">\(a=5\)</span>.</p>
<p>With calculus, we will be able to see that the function <span class="math inline">\(f(x) = (a/x)^x\)</span> will be maximized at <span class="math inline">\(a/e\)</span>, but for now we approach this in an exploratory manner. Suppose <span class="math inline">\(a=5\)</span>, then we have:</p>
<div class="cell" data-hold="true" data-execution_count="9">
<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>a <span class="op">=</span> <span class="fl">5</span></span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a>n <span class="op">=</span> <span class="fl">1</span><span class="op">:</span><span class="fl">10</span></span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a><span class="fu">f</span>(n) <span class="op">=</span> (a<span class="op">/</span>n)<span class="op">^</span>n</span>
<span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a>@. [n <span class="fu">f</span>(n) (a<span class="op">/</span>n <span class="op">-</span> <span class="cn">e</span>)] <span class="co"># @. just allows broadcasting</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>10×3 Matrix{Float64}:
1.0 5.0 2.28172
2.0 6.25 -0.218282
3.0 4.62963 -1.05162
4.0 2.44141 -1.46828
5.0 1.0 -1.71828
6.0 0.334898 -1.88495
7.0 0.0948645 -2.004
8.0 0.0232831 -2.09328
9.0 0.00504136 -2.16273
10.0 0.000976562 -2.21828</code></pre>
</div>
</div>
<p>We can see more clearly that <span class="math inline">\(n=2\)</span> is the largest value for <span class="math inline">\(f\)</span> and <span class="math inline">\(a/2\)</span> is the closest value to <span class="math inline">\(e\)</span>. This would be the case for any <span class="math inline">\(a&gt;0\)</span>, pick <span class="math inline">\(n\)</span> so that <span class="math inline">\(a/n\)</span> is closest to <span class="math inline">\(e\)</span>.</p>
</section>
<section id="example-the-limits-to-growth" class="level5">
<h5 class="anchored" data-anchor-id="example-the-limits-to-growth">Example: The limits to growth</h5>
<p>The <span class="math inline">\(1972\)</span> book <a href="https://donellameadows.org/wp-content/userfiles/Limits-to-Growth-digital-scan-version.pdf">The limits to growth</a> by Meadows et. al.&nbsp;discusses the implications of exponential growth. It begins stating their conclusion (emphasis added): “If the present <em>growth</em> trends in world population, industrialization, pollution, food production, and resource depletion continue <em>unchanged</em>, the limits to growth on this planet will be reached sometime in the next <em>one hundred</em> years.” They note it is possible to alter these growth trends. We are now half way into this time period.</p>
<p>Lets consider one of their examples, the concentration of carbon dioxide in the atmosphere. In their Figure <span class="math inline">\(15\)</span> they show data from <span class="math inline">\(1860\)</span> onward of CO<span class="math inline">\(_2\)</span> concentration extrapolated out to the year <span class="math inline">\(2000\)</span>. At <a href="https://www.climate.gov/news-features/understanding-climate/climate-change-atmospheric-carbon-dioxide">climate.gov</a> we can see actual measurements from <span class="math inline">\(1960\)</span> to <span class="math inline">\(2020\)</span>. Numbers from each graph are read from the graphs, and plotted in the code below:</p>
<div class="cell" data-execution_count="10">
<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>co2_1970 <span class="op">=</span> [(<span class="fl">1860</span>, <span class="fl">293</span>), (<span class="fl">1870</span>, <span class="fl">293</span>), (<span class="fl">1880</span>, <span class="fl">294</span>), (<span class="fl">1890</span>, <span class="fl">295</span>), (<span class="fl">1900</span>, <span class="fl">297</span>),</span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a> (<span class="fl">1910</span>, <span class="fl">298</span>), (<span class="fl">1920</span>, <span class="fl">300</span>), (<span class="fl">1930</span>, <span class="fl">303</span>), (<span class="fl">1940</span>, <span class="fl">305</span>), (<span class="fl">1950</span>, <span class="fl">310</span>),</span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a> (<span class="fl">1960</span>, <span class="fl">313</span>), (<span class="fl">1970</span>, <span class="fl">320</span>), (<span class="fl">1980</span>, <span class="fl">330</span>), (<span class="fl">1990</span>, <span class="fl">350</span>), (<span class="fl">2000</span>, <span class="fl">380</span>)]</span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a>co2_2021 <span class="op">=</span> [(<span class="fl">1960</span>, <span class="fl">318</span>), (<span class="fl">1970</span>, <span class="fl">325</span>), (<span class="fl">1980</span>, <span class="fl">338</span>), (<span class="fl">1990</span>, <span class="fl">358</span>), (<span class="fl">2000</span>, <span class="fl">370</span>),</span>
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a> (<span class="fl">2010</span>, <span class="fl">390</span>), (<span class="fl">2020</span>, <span class="fl">415</span>)]</span>
<span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a>xs,ys <span class="op">=</span> <span class="fu">unzip</span>(co2_1970)</span>
<span id="cb13-8"><a href="#cb13-8" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(xs, ys, legend<span class="op">=</span><span class="cn">false</span>)</span>
<span id="cb13-9"><a href="#cb13-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-10"><a href="#cb13-10" aria-hidden="true" tabindex="-1"></a>𝒙s, 𝒚s <span class="op">=</span> <span class="fu">unzip</span>(co2_2021)</span>
<span id="cb13-11"><a href="#cb13-11" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(𝒙s, 𝒚s)</span>
<span id="cb13-12"><a href="#cb13-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-13"><a href="#cb13-13" aria-hidden="true" tabindex="-1"></a>r <span class="op">=</span> <span class="fl">0.002</span></span>
<span id="cb13-14"><a href="#cb13-14" aria-hidden="true" tabindex="-1"></a>x₀, P₀ <span class="op">=</span> <span class="fl">1960</span>, <span class="fl">313</span></span>
<span id="cb13-15"><a href="#cb13-15" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(x <span class="op">-&gt;</span> P₀ <span class="op">*</span> <span class="fu">exp</span>(r <span class="op">*</span> (x <span class="op">-</span> x₀)), <span class="fl">1950</span>, <span class="fl">1990</span>, linewidth<span class="op">=</span><span class="fl">5</span>, alpha<span class="op">=</span><span class="fl">0.25</span>)</span>
<span id="cb13-16"><a href="#cb13-16" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-17"><a href="#cb13-17" aria-hidden="true" tabindex="-1"></a>𝒓 <span class="op">=</span> <span class="fl">0.005</span></span>
<span id="cb13-18"><a href="#cb13-18" aria-hidden="true" tabindex="-1"></a>𝒙₀, 𝑷₀ <span class="op">=</span> <span class="fl">2000</span>, <span class="fl">370</span></span>
<span id="cb13-19"><a href="#cb13-19" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(x <span class="op">-&gt;</span> 𝑷₀ <span class="op">*</span> <span class="fu">exp</span>(𝒓 <span class="op">*</span> (x <span class="op">-</span> 𝒙₀)), <span class="fl">1960</span>, <span class="fl">2020</span>, linewidth<span class="op">=</span><span class="fl">5</span>, alpha<span class="op">=</span><span class="fl">0.25</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="11">
<p><img src="exp_log_functions_files/figure-html/cell-11-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>(The <code>unzip</code> function is from the <code>CalculusWithJulia</code> package and will be explained in a subsequent section.) We can see that the projections from the year <span class="math inline">\(1970\)</span> hold up fairly well</p>
<p>On this plot we added two <em>exponential</em> models. at <span class="math inline">\(1960\)</span> we added a <em>roughly</em> <span class="math inline">\(0.2\)</span> percent per year growth (a rate mentioned in an accompanying caption) and at <span class="math inline">\(2000\)</span> a roughly <span class="math inline">\(0.5\)</span> percent per year growth. The former barely keeping up with the data.</p>
<p>The word <strong>roughly</strong> above could be made exact. Suppose we knew that between <span class="math inline">\(1960\)</span> and <span class="math inline">\(1970\)</span> the rate went from <span class="math inline">\(313\)</span> to <span class="math inline">\(320\)</span>. If this followed an exponential model, then <span class="math inline">\(r\)</span> above would satisfy:</p>
<p><span class="math display">\[
P_{1970} = P_{1960} e^{r * (1970 - 1960)}
\]</span></p>
<p>or on division <span class="math inline">\(320/313 = e^{r\cdot 10}\)</span>. Solving for <span class="math inline">\(r\)</span> can be done as explained next and yields <span class="math inline">\(0.002211\dots\)</span>.</p>
</section>
</section>
<section id="logarithmic-functions" class="level2" data-number="15.2">
<h2 data-number="15.2" class="anchored" data-anchor-id="logarithmic-functions"><span class="header-section-number">15.2</span> Logarithmic functions</h2>
<p>As the exponential functions are strictly <em>decreasing</em> when <span class="math inline">\(0 &lt; a &lt; 1\)</span> and strictly <em>increasing</em> when <span class="math inline">\(a&gt;1,\)</span> in both cases an inverse function will exist. (When <span class="math inline">\(a=1\)</span> the function is a constant and is not one-to-one.) The domain of an exponential function is all real <span class="math inline">\(x\)</span> and the range is all <em>positive</em> <span class="math inline">\(x\)</span>, so these are switched around for the inverse function. Explicitly: the inverse function to <span class="math inline">\(f(x)=a^x\)</span> will have domain <span class="math inline">\((0,\infty)\)</span> and range <span class="math inline">\((-\infty, \infty)\)</span> when <span class="math inline">\(a &gt; 0, a \neq 1\)</span>.</p>
<p>The inverse function will solve for <span class="math inline">\(x\)</span> in the equation <span class="math inline">\(a^x = y\)</span>. The answer, formally, is the logarithm base <span class="math inline">\(a\)</span>, written <span class="math inline">\(\log_a(x)\)</span>.</p>
<p>That is <span class="math inline">\(a^{\log_a(x)} = x\)</span> for <span class="math inline">\(x &gt; 0\)</span> and <span class="math inline">\(\log_a(a^x) = x\)</span> for all <span class="math inline">\(x\)</span>.</p>
<p>To see how a logarithm is mathematically defined will have to wait, though the family of functions - one for each <span class="math inline">\(a&gt;0\)</span> - are implemented in <code>Julia</code> through the function <code>log(a,x)</code>. There are special cases requiring just one argument: <code>log(x)</code> will compute the natural log, base <span class="math inline">\(e\)</span> - the inverse of <span class="math inline">\(f(x) = e^x\)</span>; <code>log2(x)</code> will compute the log base <span class="math inline">\(2\)</span> - the inverse of <span class="math inline">\(f(x) = 2^x\)</span>; and <code>log10(x)</code> will compute the log base <span class="math inline">\(10\)</span> - the inverse of <span class="math inline">\(f(x)=10^x\)</span>. (Also <code>log1p</code> computes an accurate value of <span class="math inline">\(\log(1 + p)\)</span> when <span class="math inline">\(p \approx 0\)</span>.)</p>
<p>To see this in an example, we plot for base <span class="math inline">\(2\)</span> the exponential function <span class="math inline">\(f(x)=2^x\)</span>, its inverse, and the logarithm function with base <span class="math inline">\(2\)</span>:</p>
<div class="cell" data-hold="true" data-execution_count="11">
<div class="sourceCode cell-code" id="cb14"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="fu">f</span>(x) <span class="op">=</span> <span class="fl">2</span><span class="op">^</span>x</span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a>xs <span class="op">=</span> <span class="fu">range</span>(<span class="op">-</span><span class="fl">2</span>, stop<span class="op">=</span><span class="fl">2</span>, length<span class="op">=</span><span class="fl">100</span>)</span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a>ys <span class="op">=</span> <span class="fu">f</span>.(xs)</span>
<span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(xs, ys, color<span class="op">=:</span>blue, label<span class="op">=</span><span class="st">"2ˣ"</span>) <span class="co"># plot f</span></span>
<span id="cb14-5"><a href="#cb14-5" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(ys, xs, color<span class="op">=:</span>red, label<span class="op">=</span><span class="st">"f⁻¹"</span>) <span class="co"># plot f^(-1)</span></span>
<span id="cb14-6"><a href="#cb14-6" aria-hidden="true" tabindex="-1"></a>xs <span class="op">=</span> <span class="fu">range</span>(<span class="fl">1</span><span class="op">/</span><span class="fl">4</span>, stop<span class="op">=</span><span class="fl">4</span>, length<span class="op">=</span><span class="fl">100</span>)</span>
<span id="cb14-7"><a href="#cb14-7" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(xs, <span class="fu">log2</span>.(xs), color<span class="op">=:</span>green, label<span class="op">=</span><span class="st">"log₂"</span>) <span class="co"># plot log2</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="12">
<p><img src="exp_log_functions_files/figure-html/cell-12-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>Though we made three graphs, only two are seen, as the graph of <code>log2</code> matches that of the inverse function.</p>
<p>Note that we needed a bit of care to plot the inverse function directly, as the domain of <span class="math inline">\(f\)</span> is <em>not</em> the domain of <span class="math inline">\(f^{-1}\)</span>. Again, in this case the domain of <span class="math inline">\(f\)</span> is all <span class="math inline">\(x\)</span>, but the domain of <span class="math inline">\(f^{-1}\)</span> is only all <em>positive</em> <span class="math inline">\(x\)</span> values.</p>
<p>Knowing that <code>log2</code> implements an inverse function allows us to solve many problems involving doubling.</p>
<section id="example-4" class="level5">
<h5 class="anchored" data-anchor-id="example-4">Example</h5>
<p>An <a href="https://en.wikipedia.org/wiki/Wheat_and_chessboard_problem">old</a> story about doubling is couched in terms of doubling grains of wheat. To simplify the story, suppose each day an amount of grain is doubled. How many days of doubling will it take <span class="math inline">\(1\)</span> grain to become <span class="math inline">\(1\)</span> million grains?</p>
<p>The number of grains after one day is <span class="math inline">\(2\)</span>, two days is <span class="math inline">\(4\)</span>, three days is <span class="math inline">\(8\)</span> and so after <span class="math inline">\(n\)</span> days the number of grains is <span class="math inline">\(2^n\)</span>. To answer the question, we need to solve <span class="math inline">\(2^x = 1,000,000\)</span>. The logarithm function yields <span class="math inline">\(20\)</span> days (after rounding up):</p>
<div class="cell" data-execution_count="12">
<div class="sourceCode cell-code" id="cb15"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="fu">log2</span>(<span class="fl">1_000_000</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>19.931568569324174</code></pre>
</div>
</div>
</section>
<section id="example-5" class="level5">
<h5 class="anchored" data-anchor-id="example-5">Example</h5>
<p>The half-life of a radioactive material is the time it takes for half the material to decay. Different materials have quite different half lives with some quite long, and others quite short. See <a href="https://en.wikipedia.org/wiki/List_of_radioactive_isotopes_by_half-life">half lives</a> for some details.</p>
<p>The carbon <span class="math inline">\(14\)</span> isotope is a naturally occurring isotope on Earth, appearing in trace amounts. Unlike Carbon <span class="math inline">\(12\)</span> and <span class="math inline">\(13\)</span> it decays, in this case with a half life of <span class="math inline">\(5730\)</span> years (plus or minus <span class="math inline">\(40\)</span> years). In a <a href="https://en.wikipedia.org/wiki/Radiocarbon_dating">technique</a> due to Libby, measuring the amount of Carbon 14 present in an organic item can indicate the time since death. The amount of Carbon <span class="math inline">\(14\)</span> at death is essentially that of the atmosphere, and this amount decays over time. So, for example, if roughly half the carbon <span class="math inline">\(14\)</span> remains, then the death occurred about <span class="math inline">\(5730\)</span> years ago.</p>
<p>A formula for the amount of carbon <span class="math inline">\(14\)</span> remaining <span class="math inline">\(t\)</span> years after death would be <span class="math inline">\(P(t) = P_0 \cdot 2^{-t/5730}\)</span>.</p>
<p>If <span class="math inline">\(1/10\)</span> of the original carbon <span class="math inline">\(14\)</span> remains, how old is the item? This amounts to solving <span class="math inline">\(2^{-t/5730} = 1/10\)</span>. We have: <span class="math inline">\(-t/5730 = \log_2(1/10)\)</span> or:</p>
<div class="cell" data-execution_count="13">
<div class="sourceCode cell-code" id="cb17"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="op">-</span><span class="fl">5730</span> <span class="op">*</span> <span class="fu">log2</span>(<span class="fl">1</span><span class="op">/</span><span class="fl">10</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="14">
<pre><code>19034.647983704584</code></pre>
</div>
</div>
<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>(Historically) Libby and James Arnold proceeded to test the radiocarbon dating theory by analyzing samples with known ages. For example, two samples taken from the tombs of two Egyptian kings, Zoser and Sneferu, independently dated to <span class="math inline">\(2625\)</span> BC plus or minus <span class="math inline">\(75\)</span> years, were dated by radiocarbon measurement to an average of <span class="math inline">\(2800\)</span> BC plus or minus <span class="math inline">\(250\)</span> years. These results were published in Science in <span class="math inline">\(1949\)</span>. Within <span class="math inline">\(11\)</span> years of their announcement, more than <span class="math inline">\(20\)</span> radiocarbon dating laboratories had been set up worldwide. Source: <a href="http://tinyurl.com/p5msnh6">Wikipedia</a>.</p>
</div>
</div>
</section>
<section id="properties-of-logarithms" class="level3" data-number="15.2.1">
<h3 data-number="15.2.1" class="anchored" data-anchor-id="properties-of-logarithms"><span class="header-section-number">15.2.1</span> Properties of logarithms</h3>
<p>The basic graphs of logarithms (<span class="math inline">\(a &gt; 1\)</span>) are all similar, though as we see larger bases lead to slower growing functions, though all satisfy <span class="math inline">\(\log_a(1) = 0\)</span>:</p>
<div class="cell" data-execution_count="14">
<div class="sourceCode cell-code" id="cb19"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(log2, <span class="fl">1</span><span class="op">/</span><span class="fl">2</span>, <span class="fl">10</span>, label<span class="op">=</span><span class="st">"2"</span>) <span class="co"># base 2</span></span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(log, <span class="fl">1</span><span class="op">/</span><span class="fl">2</span>, <span class="fl">10</span>, label<span class="op">=</span><span class="st">"e"</span>) <span class="co"># base e</span></span>
<span id="cb19-3"><a href="#cb19-3" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(log10, <span class="fl">1</span><span class="op">/</span><span class="fl">2</span>, <span class="fl">10</span>, label<span class="op">=</span><span class="st">"10"</span>) <span class="co"># base 10</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">
<p><img src="exp_log_functions_files/figure-html/cell-15-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>Now, what do the properties of exponents imply about logarithms?</p>
<p>Consider the sum <span class="math inline">\(\log_a(u) + \log_a(v)\)</span>. If we raise <span class="math inline">\(a\)</span> to this power, we have using the powers of exponents and the inverse nature of <span class="math inline">\(a^x\)</span> and <span class="math inline">\(\log_a(x)\)</span> that:</p>
<p><span class="math display">\[
a^{\log_a(u) + \log_a(v)} = a^{\log_a(u)} \cdot a^{\log_a(v)} = u \cdot v.
\]</span></p>
<p>Taking <span class="math inline">\(\log_a\)</span> of <em>both</em> sides yields <span class="math inline">\(\log_a(u) + \log_a(v)=\log_a(u\cdot v)\)</span>. That is logarithms turn products into sums (of logs).</p>
<p>Similarly, the relation <span class="math inline">\((a^{x})^y =a^{x \cdot y}, a &gt; 0\)</span> can be used to see that <span class="math inline">\(\log_a(b^x) = x \cdot\log_a(b)\)</span>. This follows, as applying <span class="math inline">\(a^x\)</span> to each side yields the same answer.</p>
<p>Due to inverse relationship between <span class="math inline">\(a^x\)</span> and <span class="math inline">\(\log_a(x)\)</span> we have:</p>
<p><span class="math display">\[
a^{\log_a(b^x)} = b^x.
\]</span></p>
<p>Due to the rules of exponents, we have:</p>
<p><span class="math display">\[
a^{x \log_a(b)} = a^{\log_a(b) \cdot x} = (a^{\log_a(b)})^x = b^x.
\]</span></p>
<p>Finally, since <span class="math inline">\(a^x\)</span> is one-to-one (when <span class="math inline">\(a&gt;0\)</span> and <span class="math inline">\(a \neq 1\)</span>), if <span class="math inline">\(a^{\log_a(b^x)}=a^{x \log_a(b)}\)</span> it must be that <span class="math inline">\(\log_a(b^x) = x \log_a(b)\)</span>. That is, logarithms turn powers into products.</p>
<p>Finally, we use the inverse property of logarithms and powers to show that logarithms can be defined for any base. Say <span class="math inline">\(a, b &gt; 0\)</span>. Then <span class="math inline">\(\log_a(x) = \log_b(x)/\log_b(a)\)</span>. Again, to verify this we apply <span class="math inline">\(a^x\)</span> to both sides to see we get the same answer:</p>
<p><span class="math display">\[
a^{\log_a(x)} = x,
\]</span></p>
<p>this by the inverse property. Whereas, by expressing <span class="math inline">\(a=b^{\log_b(a)}\)</span> we have:</p>
<p><span class="math display">\[
a^{(\log_b(x)/\log_b(b))} = (b^{\log_b(a)})^{(\log_b(x)/\log_b(a))} =
b^{\log_b(a) \cdot \log_b(x)/\log_b(a) } = b^{\log_b(x)} = x.
\]</span></p>
<p>In short, we have these three properties of logarithmic functions:</p>
<p>If <span class="math inline">\(a, b\)</span> are positive bases; <span class="math inline">\(u,v\)</span> are positive numbers; and <span class="math inline">\(x\)</span> is any real number then:</p>
<p><span class="math display">\[
\begin{align*}
\log_a(uv) &amp;= \log_a(u) + \log_a(v), \\
\log_a(u^x) &amp;= x \log_a(u), \text{ and} \\
\log_a(u) &amp;= \log_b(u)/\log_b(a).
\end{align*}
\]</span></p>
<section id="example-6" class="level5">
<h5 class="anchored" data-anchor-id="example-6">Example</h5>
<p>Before the ubiquity of electronic calculating devices, the need to compute was still present. Ancient civilizations had abacuses to make addition easier. For multiplication and powers a <a href="https://en.wikipedia.org/wiki/Slide_rule">slide rule</a> could be used. It is easy to represent addition physically with two straight pieces of wood - just represent a number with a distance and align the two pieces so that the distances are sequentially arranged. To multiply then was as easy: represent the logarithm of a number with a distance then add the logarithms. The sum of the logarithms is the logarithm of the <em>product</em> of the original two values. Converting back to a number answers the question. The conversion back and forth is done by simply labeling the wood using a logartithmic scale. The slide rule was <a href="http://tinyurl.com/qytxo3e">invented</a> soon after Napiers initial publication on the logarithm in 1614.</p>
</section>
<section id="example-7" class="level5">
<h5 class="anchored" data-anchor-id="example-7">Example</h5>
<p>Returning to the Rule of <span class="math inline">\(72\)</span>, what should the exact number be?</p>
<p>The amount of time to double an investment that grows according to <span class="math inline">\(P_0 e^{rt}\)</span> solves <span class="math inline">\(P_0 e^{rt} = 2P_0\)</span> or <span class="math inline">\(rt = \log_e(2)\)</span>. So we get <span class="math inline">\(t=\log_e(2)/r\)</span>. As <span class="math inline">\(\log_e(2)\)</span> is</p>
<div class="cell" data-execution_count="15">
<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="fu">log</span>(<span class="cn">e</span>, <span class="fl">2</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="16">
<pre><code>0.6931471805599453</code></pre>
</div>
</div>
<p>We get the actual rule should be the “Rule of <span class="math inline">\(69.314...\)</span>.”</p>
</section>
</section>
</section>
<section id="questions" class="level2" data-number="15.3">
<h2 data-number="15.3" class="anchored" data-anchor-id="questions"><span class="header-section-number">15.3</span> Questions</h2>
<section id="question" class="level6">
<h6 class="anchored" data-anchor-id="question">Question</h6>
<p>Suppose every <span class="math inline">\(4\)</span> days, a population doubles. If the population starts with <span class="math inline">\(2\)</span> individuals, what is its size after <span class="math inline">\(4\)</span> weeks?</p>
<div class="cell" data-hold="true" data-execution_count="16">
<div class="cell-output cell-output-display" data-execution_count="17">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="8245585490609722882" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_8245585490609722882">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="8245585490609722882" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="8245585490609722882_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("8245585490609722882").addEventListener("change", function() {
var correct = (Math.abs(this.value - 256.0) <= 0.001);
var msgBox = document.getElementById('8245585490609722882_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_8245585490609722882")
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_8245585490609722882")
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>A bouncing ball rebounds to a height of <span class="math inline">\(5/6\)</span> of the previous peak height. If the ball is droppet at a height of <span class="math inline">\(3\)</span> feet, how high will it bounce after <span class="math inline">\(5\)</span> bounces?</p>
<div class="cell" data-hold="true" data-execution_count="17">
<div class="cell-output cell-output-display" data-execution_count="18">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="14956638017175111700" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_14956638017175111700">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="14956638017175111700" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="14956638017175111700_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("14956638017175111700").addEventListener("change", function() {
var correct = (Math.abs(this.value - 1.205632716049383) <= 0.001);
var msgBox = document.getElementById('14956638017175111700_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_14956638017175111700")
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_14956638017175111700")
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>Which is bigger <span class="math inline">\(e^2\)</span> or <span class="math inline">\(2^e\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="18">
<div class="cell-output cell-output-display" data-execution_count="19">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="17700984956744194057" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_17700984956744194057">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_17700984956744194057_1">
<input class="form-check-input" type="radio" name="radio_17700984956744194057" id="radio_17700984956744194057_1" value="1">
<span class="label-body px-1">
\(e^2\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_17700984956744194057_2">
<input class="form-check-input" type="radio" name="radio_17700984956744194057" id="radio_17700984956744194057_2" value="2">
<span class="label-body px-1">
\(2^e\)
</span>
</label>
</div>
</div>
</div>
<div id="17700984956744194057_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_17700984956744194057"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('17700984956744194057_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_17700984956744194057")
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_17700984956744194057")
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>Which is bigger <span class="math inline">\(\log_8(9)\)</span> or <span class="math inline">\(\log_9(10)\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="19">
<div class="cell-output cell-output-display" data-execution_count="20">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="17665989001888757192" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_17665989001888757192">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_17665989001888757192_1">
<input class="form-check-input" type="radio" name="radio_17665989001888757192" id="radio_17665989001888757192_1" value="1">
<span class="label-body px-1">
\(\log_8(9)\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_17665989001888757192_2">
<input class="form-check-input" type="radio" name="radio_17665989001888757192" id="radio_17665989001888757192_2" value="2">
<span class="label-body px-1">
\(\log_9(10)\)
</span>
</label>
</div>
</div>
</div>
<div id="17665989001888757192_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_17665989001888757192"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('17665989001888757192_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_17665989001888757192")
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_17665989001888757192")
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>If <span class="math inline">\(x\)</span>, <span class="math inline">\(y\)</span>, and <span class="math inline">\(z\)</span> satisfy <span class="math inline">\(2^x = 3^y\)</span> and <span class="math inline">\(4^y = 5^z\)</span>, what is the ratio <span class="math inline">\(x/z\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="20">
<div class="cell-output cell-output-display" data-execution_count="21">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="12476858762072777076" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_12476858762072777076">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_12476858762072777076_1">
<input class="form-check-input" type="radio" name="radio_12476858762072777076" id="radio_12476858762072777076_1" value="1">
<span class="label-body px-1">
\(\frac{\log(5)\log(4)}{\log(3)\log(2)}\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12476858762072777076_2">
<input class="form-check-input" type="radio" name="radio_12476858762072777076" id="radio_12476858762072777076_2" value="2">
<span class="label-body px-1">
\(2/5\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12476858762072777076_3">
<input class="form-check-input" type="radio" name="radio_12476858762072777076" id="radio_12476858762072777076_3" value="3">
<span class="label-body px-1">
\(\frac{\log(2)\log(3)}{\log(5)\log(4)}\)
</span>
</label>
</div>
</div>
</div>
<div id="12476858762072777076_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_12476858762072777076"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 3;
var msgBox = document.getElementById('12476858762072777076_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_12476858762072777076")
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_12476858762072777076")
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>Does <span class="math inline">\(12\)</span> satisfy <span class="math inline">\(\log_2(x) + \log_3(x) = \log_4(x)\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="21">
<div class="cell-output cell-output-display" data-execution_count="22">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="8256101338593344987" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_8256101338593344987">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_8256101338593344987_1">
<input class="form-check-input" type="radio" name="radio_8256101338593344987" id="radio_8256101338593344987_1" value="1">
<span class="label-body px-1">
Yes
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_8256101338593344987_2">
<input class="form-check-input" type="radio" name="radio_8256101338593344987" id="radio_8256101338593344987_2" value="2">
<span class="label-body px-1">
No
</span>
</label>
</div>
</div>
</div>
<div id="8256101338593344987_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_8256101338593344987"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('8256101338593344987_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_8256101338593344987")
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_8256101338593344987")
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>The <a href="https://en.wikipedia.org/wiki/Richter_magnitude_scale">Richter</a> magnitude is determined from the logarithm of the amplitude of waves recorded by seismographs (Wikipedia). The formula is <span class="math inline">\(M=\log(A) - \log(A_0)\)</span> where <span class="math inline">\(A_0\)</span> depends on the epicenter distance. Suppose an event has <span class="math inline">\(A=100\)</span> and <span class="math inline">\(A_0=1/100\)</span>. What is <span class="math inline">\(M\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="22">
<div class="cell-output cell-output-display" data-execution_count="23">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="6335596650872407305" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_6335596650872407305">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="6335596650872407305" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="6335596650872407305_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("6335596650872407305").addEventListener("change", function() {
var correct = (Math.abs(this.value - 9.210340371976184) <= 0.001);
var msgBox = document.getElementById('6335596650872407305_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_6335596650872407305")
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_6335596650872407305")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
<p>If the magnitude of one earthquake is <span class="math inline">\(9\)</span> and the magnitude of another earthquake is <span class="math inline">\(7\)</span>, how many times stronger is <span class="math inline">\(A\)</span> if <span class="math inline">\(A_0\)</span> is the same for each?</p>
<div class="cell" data-hold="true" data-execution_count="23">
<div class="cell-output cell-output-display" data-execution_count="24">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="10352217308366857177" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_10352217308366857177">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_10352217308366857177_1">
<input class="form-check-input" type="radio" name="radio_10352217308366857177" id="radio_10352217308366857177_1" value="1">
<span class="label-body px-1">
\(1000\) times
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10352217308366857177_2">
<input class="form-check-input" type="radio" name="radio_10352217308366857177" id="radio_10352217308366857177_2" value="2">
<span class="label-body px-1">
\(100\) times
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10352217308366857177_3">
<input class="form-check-input" type="radio" name="radio_10352217308366857177" id="radio_10352217308366857177_3" value="3">
<span class="label-body px-1">
\(10\) times
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10352217308366857177_4">
<input class="form-check-input" type="radio" name="radio_10352217308366857177" id="radio_10352217308366857177_4" value="4">
<span class="label-body px-1">
the same
</span>
</label>
</div>
</div>
</div>
<div id="10352217308366857177_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_10352217308366857177"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('10352217308366857177_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_10352217308366857177")
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_10352217308366857177")
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>The <a href="https://en.wikipedia.org/wiki/Loudest_band">Loudest band</a> can possibly be measured in <a href="https://en.wikipedia.org/wiki/Decibel">decibels</a>. In <span class="math inline">\(1976\)</span> the Who recorded <span class="math inline">\(126\)</span> db and in <span class="math inline">\(1986\)</span> Motorhead recorded <span class="math inline">\(130\)</span> db. Suppose both measurements record power through the formula <span class="math inline">\(db = 10 \log_{10}(P)\)</span>. What is the ratio of the Motorhead <span class="math inline">\(P\)</span> to the <span class="math inline">\(P\)</span> for the Who?</p>
<div class="cell" data-hold="true" data-execution_count="24">
<div class="cell-output cell-output-display" data-execution_count="25">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="18335041369129458576" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_18335041369129458576">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="18335041369129458576" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="18335041369129458576_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("18335041369129458576").addEventListener("change", function() {
var correct = (Math.abs(this.value - 2.5118864315095824) <= 0.001);
var msgBox = document.getElementById('18335041369129458576_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_18335041369129458576")
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_18335041369129458576")
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>Based on this graph:</p>
<div class="cell" data-hold="true" data-execution_count="25">
<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">plot</span>(log, <span class="fl">1</span><span class="op">/</span><span class="fl">4</span>, <span class="fl">4</span>, label<span class="op">=</span><span class="st">"log"</span>)</span>
<span id="cb22-2"><a href="#cb22-2" aria-hidden="true" tabindex="-1"></a><span class="fu">f</span>(x) <span class="op">=</span> x <span class="op">-</span> <span class="fl">1</span></span>
<span id="cb22-3"><a href="#cb22-3" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(f, <span class="fl">1</span><span class="op">/</span><span class="fl">4</span>, <span class="fl">4</span>, label<span class="op">=</span><span class="st">"x-1"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="26">
<p><img src="exp_log_functions_files/figure-html/cell-26-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>Which statement appears to be true?</p>
<div class="cell" data-hold="true" data-execution_count="26">
<div class="cell-output cell-output-display" data-execution_count="27">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="14353536341448426841" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_14353536341448426841">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_14353536341448426841_1">
<input class="form-check-input" type="radio" name="radio_14353536341448426841" id="radio_14353536341448426841_1" value="1">
<span class="label-body px-1">
\(x \geq 1 + \log(x)\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_14353536341448426841_2">
<input class="form-check-input" type="radio" name="radio_14353536341448426841" id="radio_14353536341448426841_2" value="2">
<span class="label-body px-1">
\(x \leq 1 + \log(x)\)
</span>
</label>
</div>
</div>
</div>
<div id="14353536341448426841_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_14353536341448426841"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('14353536341448426841_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_14353536341448426841")
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_14353536341448426841")
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>Consider this graph:</p>
<div class="cell" data-hold="true" data-execution_count="27">
<div class="sourceCode cell-code" id="cb23"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="fu">f</span>(x) <span class="op">=</span> <span class="fu">log</span>(<span class="fl">1</span><span class="op">-</span>x)</span>
<span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a><span class="fu">g</span>(x) <span class="op">=</span> <span class="op">-</span>x <span class="op">-</span> x<span class="op">^</span><span class="fl">2</span><span class="op">/</span><span class="fl">2</span></span>
<span id="cb23-3"><a href="#cb23-3" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(f, <span class="op">-</span><span class="fl">3</span>, <span class="fl">3</span><span class="op">/</span><span class="fl">4</span>, label<span class="op">=</span><span class="st">"f"</span>)</span>
<span id="cb23-4"><a href="#cb23-4" aria-hidden="true" tabindex="-1"></a><span class="fu">plot!</span>(g, <span class="op">-</span><span class="fl">3</span>, <span class="fl">3</span><span class="op">/</span><span class="fl">4</span>, label<span class="op">=</span><span class="st">"g"</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="28">
<p><img src="exp_log_functions_files/figure-html/cell-28-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>What statement appears to be true?</p>
<div class="cell" data-hold="true" data-execution_count="28">
<div class="cell-output cell-output-display" data-execution_count="29">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="11266468967174642703" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_11266468967174642703">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_11266468967174642703_1">
<input class="form-check-input" type="radio" name="radio_11266468967174642703" id="radio_11266468967174642703_1" value="1">
<span class="label-body px-1">
\(\log(1-x) \geq -x - x^2/2\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_11266468967174642703_2">
<input class="form-check-input" type="radio" name="radio_11266468967174642703" id="radio_11266468967174642703_2" value="2">
<span class="label-body px-1">
\(\log(1-x) \leq -x - x^2/2\)
</span>
</label>
</div>
</div>
</div>
<div id="11266468967174642703_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_11266468967174642703"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('11266468967174642703_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_11266468967174642703")
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_11266468967174642703")
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>Suppose <span class="math inline">\(a &gt; 1\)</span>. If <span class="math inline">\(\log_a(x) = y\)</span> what is <span class="math inline">\(\log_{1/a}(x)\)</span>? (The reciprocal property of exponents, <span class="math inline">\(a^{-x} = (1/a)^x\)</span>, is at play here.)</p>
<div class="cell" data-hold="true" data-execution_count="29">
<div class="cell-output cell-output-display" data-execution_count="30">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="9546190808271864421" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_9546190808271864421">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_9546190808271864421_1">
<input class="form-check-input" type="radio" name="radio_9546190808271864421" id="radio_9546190808271864421_1" value="1">
<span class="label-body px-1">
\(-y\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_9546190808271864421_2">
<input class="form-check-input" type="radio" name="radio_9546190808271864421" id="radio_9546190808271864421_2" value="2">
<span class="label-body px-1">
\(-1/y\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_9546190808271864421_3">
<input class="form-check-input" type="radio" name="radio_9546190808271864421" id="radio_9546190808271864421_3" value="3">
<span class="label-body px-1">
\(1/y\)
</span>
</label>
</div>
</div>
</div>
<div id="9546190808271864421_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_9546190808271864421"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('9546190808271864421_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_9546190808271864421")
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_9546190808271864421")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
<p>Based on this, the graph of <span class="math inline">\(\log_{1/a}(x)\)</span> is the graph of <span class="math inline">\(\log_a(x)\)</span> under which transformation?</p>
<div class="cell" data-hold="true" data-execution_count="30">
<div class="cell-output cell-output-display" data-execution_count="31">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="5881222279246740761" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_5881222279246740761">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_5881222279246740761_1">
<input class="form-check-input" type="radio" name="radio_5881222279246740761" id="radio_5881222279246740761_1" value="1">
<span class="label-body px-1">
Flipped over the \(x\) axis
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_5881222279246740761_2">
<input class="form-check-input" type="radio" name="radio_5881222279246740761" id="radio_5881222279246740761_2" value="2">
<span class="label-body px-1">
Flipped over the \(y\) axis
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_5881222279246740761_3">
<input class="form-check-input" type="radio" name="radio_5881222279246740761" id="radio_5881222279246740761_3" value="3">
<span class="label-body px-1">
Flipped over the line \(y=x\)
</span>
</label>
</div>
</div>
</div>
<div id="5881222279246740761_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_5881222279246740761"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('5881222279246740761_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_5881222279246740761")
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_5881222279246740761")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-11" class="level6">
<h6 class="anchored" data-anchor-id="question-11">Question</h6>
<p>Suppose <span class="math inline">\(x &lt; y\)</span>. Then for <span class="math inline">\(a &gt; 0\)</span>, <span class="math inline">\(a^y - a^x\)</span> is equal to:</p>
<div class="cell" data-hold="true" data-execution_count="31">
<div class="cell-output cell-output-display" data-execution_count="32">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="10426498690737461249" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_10426498690737461249">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_10426498690737461249_1">
<input class="form-check-input" type="radio" name="radio_10426498690737461249" id="radio_10426498690737461249_1" value="1">
<span class="label-body px-1">
\(a^{y-x} \cdot (a^x - 1)\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10426498690737461249_2">
<input class="form-check-input" type="radio" name="radio_10426498690737461249" id="radio_10426498690737461249_2" value="2">
<span class="label-body px-1">
\(a^{y-x}\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10426498690737461249_3">
<input class="form-check-input" type="radio" name="radio_10426498690737461249" id="radio_10426498690737461249_3" value="3">
<span class="label-body px-1">
\(a^x \cdot (a^{y-x} - 1)\)
</span>
</label>
</div>
</div>
</div>
<div id="10426498690737461249_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_10426498690737461249"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 3;
var msgBox = document.getElementById('10426498690737461249_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_10426498690737461249")
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_10426498690737461249")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
<p>Using <span class="math inline">\(a &gt; 1\)</span> we have:</p>
<div class="cell" data-hold="true" data-execution_count="32">
<div class="cell-output cell-output-display" data-execution_count="33">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="76919876252758724" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_76919876252758724">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_76919876252758724_1">
<input class="form-check-input" type="radio" name="radio_76919876252758724" id="radio_76919876252758724_1" value="1">
<span class="label-body px-1">
\(a^{y-x} &gt; 0\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_76919876252758724_2">
<input class="form-check-input" type="radio" name="radio_76919876252758724" id="radio_76919876252758724_2" value="2">
<span class="label-body px-1">
as \(a^x &gt; 1\), \(a^y &gt; a^x\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_76919876252758724_3">
<input class="form-check-input" type="radio" name="radio_76919876252758724" id="radio_76919876252758724_3" value="3">
<span class="label-body px-1">
as \(a^{y-x} &gt; 1\) and \(y-x &gt; 0\), \(a^y &gt; a^x\)
</span>
</label>
</div>
</div>
</div>
<div id="76919876252758724_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_76919876252758724"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 3;
var msgBox = document.getElementById('76919876252758724_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_76919876252758724")
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_76919876252758724")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
<p>If <span class="math inline">\(a &lt; 1\)</span> then:</p>
<div class="cell" data-hold="true" data-execution_count="33">
<div class="cell-output cell-output-display" data-execution_count="34">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="178484174956736" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_178484174956736">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_178484174956736_1">
<input class="form-check-input" type="radio" name="radio_178484174956736" id="radio_178484174956736_1" value="1">
<span class="label-body px-1">
as \(a^{y-x} &lt; 1\) as \(y-x &gt; 0\), \(a^y &lt; a^x\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_178484174956736_2">
<input class="form-check-input" type="radio" name="radio_178484174956736" id="radio_178484174956736_2" value="2">
<span class="label-body px-1">
\(a^{y-x} &lt; 0\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_178484174956736_3">
<input class="form-check-input" type="radio" name="radio_178484174956736" id="radio_178484174956736_3" value="3">
<span class="label-body px-1">
as \(a^x &lt; 1\), \(a^y &lt; a^x\)
</span>
</label>
</div>
</div>
</div>
<div id="178484174956736_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_178484174956736"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('178484174956736_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_178484174956736")
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_178484174956736")
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="../precalc/rational_functions.html" class="pagination-link">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">14</span>&nbsp; <span class="chapter-title">Rational functions</span></span>
</a>
</div>
<div class="nav-page nav-page-next">
<a href="../precalc/trig_functions.html" class="pagination-link">
<span class="nav-page-text"><span class="chapter-number">16</span>&nbsp; <span class="chapter-title">Trigonometric functions</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>